{"id":17874349,"url":"https://github.com/modprog/shorty","last_synced_at":"2025-04-03T00:13:12.824Z","repository":{"id":105083435,"uuid":"397186779","full_name":"ModProg/shorty","owner":"ModProg","description":"A small url shortener with minimal configuration","archived":false,"fork":false,"pushed_at":"2021-09-25T23:22:22.000Z","size":1003,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-08T14:22:24.658Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","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/ModProg.png","metadata":{"files":{"readme":"README.adoc","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-17T09:16:29.000Z","updated_at":"2021-09-25T23:21:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"f907762c-781b-41dd-9928-e40b6367ad33","html_url":"https://github.com/ModProg/shorty","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ModProg%2Fshorty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ModProg%2Fshorty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ModProg%2Fshorty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ModProg%2Fshorty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ModProg","download_url":"https://codeload.github.com/ModProg/shorty/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246911467,"owners_count":20853657,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-28T11:08:35.160Z","updated_at":"2025-04-03T00:13:12.801Z","avatar_url":"https://github.com/ModProg.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"= Shorty - URL shortener\n:source-highlighter: rouge\n\n== Wordlists \n\nThe Corpora of the Universität Leipzig, licensed under https://creativecommons.org/licenses/by/4.0/[CC BY], are used for generating the wordlists. (https://web.archive.org/web/20210730003345/https://wortschatz.uni-leipzig.de/en/usage[Terms of Usage]) You can download the files here: https://wortschatz.uni-leipzig.de/en/download/English[Corpora].\n\n== API\n|===\n| Method | Path | Description | Body | Response\n\n| POST   \n| `/w`\n| Short a URL via wordlist \n| \nThe URL to shorten\n| \nThe shortened URL\n\n| POST   \n| `/c`\n| Short a URL via random characters `[a-zA-Z0-9]` \n| \nThe URL to shorten\n| \nThe shortened URL\n\n| DELETE   \na| `/\u003cident\u003e`\n| Deletes a shortened URL\nNote that this is the same URL as the `GET`\n| \n|\n\n| GET\na| `/\u003cident\u003e`\n| Redirects to the matching `target` URL\n| \na| `307`\n\n|===\n\n== Configuration\n\nYou can configure `shorty` via environment variables. You can set those via the `--env` tag:\n\n|===\n| Name          | Default                  | Description\n| BASE_URL      | `http://127.0.0.1:8000/` | The URL returned when shortening urls.\n| CHARED_LENGTH | `4`                      | The length of the random characters used for shortened URL's.\n| WORDED_LENGTH | `1`                      | The length of the random words used for shortened URL's.\n| PASSWORD      | *NOT-SET*                | If set `POST` and `DELETE` requests are only authenticated with the cookie `PASSWORD` set to the correct password.\n|===\n\n== Examples\n\nYou can run `shorty` with `docker` or `podman`:\n\n```sh\npodman run -p 8000:8000 ghcr.io/modprog/shorty\n```\nor\n```sh\ndocker run -p 8000:8000 ghcr.io/modprog/shorty\n```\n\nTo set all configurable options:\n\n```sh\npodman run -p 8000:8000 \\\n  --env WORDED_LENGTH=1 --env CHARED_LENGTH=4 --env BASE_URL=http://127.0.0.1:8000/ \\\n  ghcr.io/modprog/shorty\n```\n\nTo shorten a URL make a `POST` request:\n\nUsing the wordlist:\n```sh\ncurl -X POST http://localhost:8000/w -d https://togglebit.io/posts/terminal-game-jam/\n```\n\nUsing random characters:\n\n```sh\ncurl -X POST http://localhost:8000/c -d https://togglebit.io/posts/terminal-game-jam/\n```\n\nAfterwards just open the returned URL in a browser of your choice.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodprog%2Fshorty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmodprog%2Fshorty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodprog%2Fshorty/lists"}