{"id":48621030,"url":"https://github.com/secondary-smiles/chela","last_synced_at":"2026-04-09T03:36:09.987Z","repository":{"id":231890397,"uuid":"782938764","full_name":"secondary-smiles/chela","owner":"secondary-smiles","description":"Minimal URL Shortener","archived":false,"fork":false,"pushed_at":"2024-05-01T16:32:58.000Z","size":149,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-08T12:35:54.797Z","etag":null,"topics":["docker-compose","rust","unix-socket","url-shortener"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/secondary-smiles.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-06T13:29:55.000Z","updated_at":"2024-05-13T08:36:59.000Z","dependencies_parsed_at":"2024-05-01T17:58:58.671Z","dependency_job_id":"c08888d8-a259-477a-b3bf-f7cdbd36edf9","html_url":"https://github.com/secondary-smiles/chela","commit_stats":null,"previous_names":["secondary-smiles/chela"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/secondary-smiles/chela","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secondary-smiles%2Fchela","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secondary-smiles%2Fchela/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secondary-smiles%2Fchela/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secondary-smiles%2Fchela/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/secondary-smiles","download_url":"https://codeload.github.com/secondary-smiles/chela/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secondary-smiles%2Fchela/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31584809,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"online","status_checked_at":"2026-04-09T02:00:06.848Z","response_time":112,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["docker-compose","rust","unix-socket","url-shortener"],"created_at":"2026-04-09T03:36:09.408Z","updated_at":"2026-04-09T03:36:09.981Z","avatar_url":"https://github.com/secondary-smiles.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build and Push Docker Image](https://github.com/secondary-smiles/chela/actions/workflows/docker-image.yml/badge.svg)](https://github.com/secondary-smiles/chela/actions/workflows/docker-image.yml)\n[![Docker Image Size](https://img.shields.io/docker/image-size/secondsmiles/chela)](https://hub.docker.com/r/secondsmiles/chela)\n\n# Chela\nChela is a minimal URL shortener built in Rust. It is named after the small claw on crustaceans.\n\n## Usage\nYou can create a redirect by navigating to the `/create` page and filling out the form. By default, every path passed to Chela will be treated as a redirect except `/` and `/create`.\n\nChela also supports basic analytics for shortened URLs. This page is available at `/tracking`, and `/tracking/\u003cURL ID\u003e`.\n\n## Install and Run\n### With Docker\n#### CLI\n```bash\n$ docker run -d \\\n    -p 3000:3000 \\\n    -e DATABASE_URL=postgres://chela:password@dbhost/postgres?sslmode=disable \\\n    -e CHELA_HOST=a.com \\\n    secondsmiles/chela\n```\n\n#### Docker Compose\n```yaml\nservices:\n    chela-postgres:\n        image: postgres:15\n        environment:\n            - POSTGRES_USER=chela\n            - POSTGRES_PASSWORD=password\n        volumes:\n            - chela-db:/var/lib/postgresql/data\n        restart: unless-stopped\n    chela:\n        image: secondsmiles/chela\n        ports:\n            - 3000:3000\n        environment:\n            - DATABASE_URL=postgres://chela:password@chela-postgres/postgres?sslmode=disable\n            - CHELA_HOST=a.com\n            - CHELA_MAIN_PAGE_REDIRECT='https://example.com'\n            - CHELA_BEHIND_PROXY=1\n        depends_on:\n            - chela-postgres\n        restart: unless-stopped\n\nvolumes:\n    chela-db:\n```\n\n#### Environment Variables\n\n##### `DATABASE_URL`\nUsed to define the database connection for Chela to use.\n\n##### `CHELA_HOST`\nThe hostname that Chela should refer to itself as. Defaults to `localhost`.\n\n##### `CHELA_LISTEN_ADDRESS`\nThe address that Chela should listen on. Defaults to `0.0.0.0`. \n\n##### `CHELA_MAIN_PAGE_REDIRECT`\nA page that Chela will redirect to when `/` is requested instead of replying with the default homepage.\n\n##### `CHELA_BEHIND_PROXY`\nIf this variable is set, Chela will use the `X-Real-IP` header as the client IP address rather than the connection address.\n\n##### `CHELA_UNIX_SOCKET`\nIf you would like Chela to listen for HTTP requests over a Unix socket, set this variable to the socket path that it should use. By default, Chela will listen via a Tcp socket.\n\n##### `CHELA_ALPHABET`\nIf this variable is set, Chela will use the characters in `CHELA_ALPHABET` to create IDs for URLs. The default alphabet is `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`. See [here](https://sqids.org/faq#unique) for more information on Sqids alphabets.\n\n##### `CHELA_USES_HTTPS`\nIf this variable is set, Chela will refer to itself as `https://$CHELA_HOST` instead of the default `http://$CHELA_HOST`.\n\n### Manually\n#### Build\n```bash\n$ git clone https://github.com/secondary-smiles/chela.git\n$ cd chela\n$ cargo build -r\n```\n\n#### Run\n```bash\n$ export DATABASE_URL=postgres://chela:password@dbhost/postgres?sslmode=disable\n$ export CHELA_HOST=a.com\n$ export CHELA_LISTEN_ADDRESS=127.0.0.1\n$ ./target/release/chela\n```\n\n## Hosting\nChela uses the [axum](https://crates.io/crates/axum) to manage HTTP requests, so it is possible to expose it directly to the outer internet. However, there is no authentication for the `/create` or `/tracking` endpoints so anyone will be able to create redirects and view analytics.\n\nIf you would prefer to be the only one able to access these pages, then you can proxy Chela through Nginx with http-basic-auth. Refer to [this](https://docs.nginx.com/nginx/admin-guide/security-controls/configuring-http-basic-authentication/) documentation for more information.\n\n```nginx\nserver {\n    server_name a.com;\n    \n    location / {\n        proxy_pass http://localhost:3000;\n        proxy_set_header X-Real-IP $remote_addr;\n\n        limit_except GET HEAD {\n            auth_basic 'Restricted';\n            auth_basic_user_file /path/to/your/.htpasswd;\n        }\n    }\n\n    location /tracking {\n        proxy_pass http://localhost:3000$request_uri;\n\n        auth_basic 'Restricted';\n        auth_basic_user_file /path/to/your/.htpasswd;\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecondary-smiles%2Fchela","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsecondary-smiles%2Fchela","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecondary-smiles%2Fchela/lists"}