{"id":36457217,"url":"https://github.com/gokaykucuk/elevator","last_synced_at":"2026-01-11T23:05:26.561Z","repository":{"id":57546419,"uuid":"155267439","full_name":"gokaykucuk/elevator","owner":"gokaykucuk","description":"A golang library to requrest and switch to superuser with one line.","archived":false,"fork":false,"pushed_at":"2018-10-30T22:57:45.000Z","size":28,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T12:06:25.658Z","etag":null,"topics":["cli","sudo","superuser","superuser-privileges"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gokaykucuk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-29T19:16:33.000Z","updated_at":"2018-10-30T22:57:46.000Z","dependencies_parsed_at":"2022-09-26T18:30:55.402Z","dependency_job_id":null,"html_url":"https://github.com/gokaykucuk/elevator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gokaykucuk/elevator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gokaykucuk%2Felevator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gokaykucuk%2Felevator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gokaykucuk%2Felevator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gokaykucuk%2Felevator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gokaykucuk","download_url":"https://codeload.github.com/gokaykucuk/elevator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gokaykucuk%2Felevator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28326198,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T22:11:01.104Z","status":"ssl_error","status_checked_at":"2026-01-11T22:10:58.990Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","sudo","superuser","superuser-privileges"],"created_at":"2026-01-11T23:05:25.572Z","updated_at":"2026-01-11T23:05:26.556Z","avatar_url":"https://github.com/gokaykucuk.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"![icon](https://gokaykucuk.com/cdn/elevator.svg)\n# elevator\n[![Maintainability](https://api.codeclimate.com/v1/badges/083de9bce09a2a67c06d/maintainability)](https://codeclimate.com/github/gokaykucuk/elevator/maintainability)\n[![codecov](https://codecov.io/gh/gokaykucuk/elevator/branch/master/graph/badge.svg)](https://codecov.io/gh/gokaykucuk/elevator)\n[![Build Status](https://travis-ci.org/gokaykucuk/elevator.svg?branch=master)](https://travis-ci.org/gokaykucuk/elevator)\n[![Coveralls](https://img.shields.io/coveralls/gokaykucuk/elevator/master.svg)](https://coveralls.io/github/gokaykucuk/elevator)\n![license](https://img.shields.io/github/license/mashape/apistatus.svg)\n[![readthedocs](https://readthedocs.org/projects/gokaykucukelevator/badge/?version=latest)](https://readthedocs.org/projects/gokaykucukelevator/)\n\nA golang library for requesting self-sudo.\n\nSimply put, the idea is in the runtime, if the process is not started with superuser permissions, request them\nand then restart the application. The only rule is, this libraries `CheckAndRequestElevation()` function *MUST* be\ncalled as the first thing before the main application loads.\n\nTo supply the sudo username and password during development locally, just use the environment variables defined as,\n\n    ELEVATOR_SUDO_PASSWORD=12341234\n\nAs you should already know, what i described a moment ago is a terrible idea, and you should never do it. But, if\nyou feel like not entering the password again and again on every restart while debugging your application, it's\nactually a quite useful tool. Maybe I'll provide more elegant ways of supplying a default password and username in\nfuture.\n\n\n### Installation\n\nJust as any other go package, you can get it with `go get`\n\n    go get -u github.com/gokaykucuk/elevator\n\n\n### Example\n\n    package main\n    \n    import (\n    \t\"github.com/gokaykucuk/elevator\"\n    \t\"gitlab.com/...\"\n    )\n    \n    var (\n    \tversion   = \"No version provided\"\n    \tcommit    = \"No commit provided\"\n    \tbuildTime = \"No build timestamp provided\"\n    )\n    \n    func main() {\n    \televator.CheckAndRequestElevation()\n    \tcmd.SetVersion(\u0026cmd.Version{\n    \t\tVersion:   version,\n    \t\tCommit:    commit,  \n    \t\tBuildTime: buildTime,\n    \t})\n    \tcmd.Execute()\n    }\n\n\n### Contributing\nYou can create a PR and as long as it makes sense, and doesn't enlarge the scope of the project by 2, it'll be merged.\n\n### Testing\nCurrently there are no real tests because i don't have a good idea how to write them. If you have any good ideas please\nopen a pull request.\n\n### TODO\n- Make it windows compatibale?\n- Make another function which will only check but not ask for permissions","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgokaykucuk%2Felevator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgokaykucuk%2Felevator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgokaykucuk%2Felevator/lists"}