{"id":21934803,"url":"https://github.com/willibutz/urlnao","last_synced_at":"2025-07-22T01:31:05.036Z","repository":{"id":191663668,"uuid":"334779372","full_name":"WilliButz/urlnao","owner":"WilliButz","description":"Upload service for file sharing with weechat-android","archived":true,"fork":false,"pushed_at":"2021-02-26T20:41:49.000Z","size":98,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-22T13:42:54.929Z","etag":null,"topics":["nix","rust","weechat"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WilliButz.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}},"created_at":"2021-01-31T23:27:32.000Z","updated_at":"2024-05-11T13:05:59.000Z","dependencies_parsed_at":"2023-08-31T01:56:28.764Z","dependency_job_id":null,"html_url":"https://github.com/WilliButz/urlnao","commit_stats":null,"previous_names":["willibutz/urlnao"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/WilliButz/urlnao","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliButz%2Furlnao","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliButz%2Furlnao/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliButz%2Furlnao/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliButz%2Furlnao/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WilliButz","download_url":"https://codeload.github.com/WilliButz/urlnao/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliButz%2Furlnao/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266409443,"owners_count":23924284,"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","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["nix","rust","weechat"],"created_at":"2024-11-29T00:17:09.969Z","updated_at":"2025-07-22T01:31:04.766Z","avatar_url":"https://github.com/WilliButz.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"Urlnao\n======\n\n[![License](http://img.shields.io/badge/license-AGPL-brightgreen.svg?style=flat-square)](LICENSE)\n\n## What is Urlnao?\n\nUrlnao is an upload service for [file sharing with weechat-android](https://github.com/ubergeek42/weechat-android/wiki/File-sharing).\n\n* [What does it do?](#what-does-it-do)\n* [Building](#building)\n* [How does it work?](#how-does-it-work)\n* [Developing](#developing)\n* [Changelog](#changelog)\n* [License](#license)\n\n## What does it do?\n\n### Urlnao handles uploads, returns URLs and serves the uploaded files:\n1. A POST request is issued by a client with some file(s) to share\n2. Urlnao saves the uploaded file(s)\n3. A publicly reachable URL is then returned for each uploaded file\n\nExample upload request using curl instead of [weechat-android](https://github.com/ubergeek42/weechat-android):\n```shell\n$ curl --file file=@/path/to/some/video_file.webm https://urlnao.example.com/up\nhttps://urlnao.example.com/f/wLM1\n```\n\nThe file will then be accessible via the returned URL.\n```shell\n$ xdg-open https://urlnao.example.com/f/wLM1\n```\n\nExample upload request using curl with multiple files:\n```shell\n$ curl \\\n    --file file1=@/path/to/some/video_file.webm \\\n    --file file2=@/path/to/some/image_file.png \\\n    https://urlnao.example.com/up\nhttps://urlnao.example.com/f/wLM1\nhttps://urlnao.example.com/f/af6\n```\n\n## Building\n\nI recommend using Nix to build this package, but you can also just use `cargo build --release`.\n```shell\nnix build -f . urlnao\n```\n\n## How does it work?\n\n### Requests\n\nAll incoming requests need to be passed to Urlnao's Unix domain socket,\nideally using a proxy like Nginx for handling TLS termination.\n\nExample request with curl:\n```shell\n$ curl \\\n  --file file=@/path/to/some/image_file.png \\\n  --unix-socket /path/to/urlnao.sock \\\n  http://localhost/up\nhttps://urlnao.example.com/f/02f6a\n```\n\n### Uploads\n\nFiles are uploaded by issuing POST requests to the endpoint `/up`.\nEvery multipart request may contain more than one file,\nresulting in one public URL for each uploaded file in the response.\n\nThe returned URLs are configurable and end in a randomly generated\nshort ID, (currently) being constructed of 3 to 8 alphanumeric characters:\nExample:\n```\nhttps://u.example.com/f/02f6a\n```\n\n### Downloads\n\nAccessing the returned URL after a successful upload leads to a redirect,\nwhere the target location contains the original client-supplied filename:\n\nSimplified example:\n```\n\u003e GET https://u.example.com/f/02f6a\n\u003c 301 https://u.example.com/d/image_file.png\n\u003e GET https://u.example.com/d/image_file.png\n```\n\n### State\n\nA simple list of all current uploads,\nincluding their respective checksum and filename,\nis served from the `/state` endpoint.\n\nExample:\n```shell\n$ xdg-open https://u.example.com/state\n```\n\n### Access Control\n\nAccess control must be implemented by the upstream proxy,\nallowing for any kind of authentication that both the client and proxy support.\n\nAccess to the following endpoints should be restricted to authorized users:\n* `/up` (endpoint for uploads)\n* `/state` (endpoint listing all uploads)\n\nAlternatively only the two endpoints:\n* `/f` (default for `--shortid-path`)\n* `/d` (default for `--download-path`)\n\ncan be publicly exposed, allowing access to everything else only from a trusted network.\n\n## Developing\n\nDevelopment is done with the help of [Nix](https://nixos.org/)\n\n### Development Environment\n\n```shell\n$ nix-shell\n...\n[nix-shell]$ cargo build --release\n```\n\n### Integration Test\n\nA simple integration test can be found here: [nix/test.nix](nix/test.nix)\n\nTo run the NixOS VM test run:\n```shell\n$ nix build -f . test\n```\n\nTo run the test VM interactively run:\n```shell\n$ nix build -f . text.driver\n$ ./result/bin/nixos-test-driver\n```\n\n## Changelog\n\n### v0.3.0\n**BUG FIXES**\n+ fixed race condition with duplicate file uploads\n\n**FEATURES / ENHANCEMENTS**\n+ added some basic documentation\n+ refactored some parts\n\n### v0.2.0\n**BREAKING**\n+ files are now served under `/d/\u003coriginal_filename\u003e` after a redirect from `/f/\u003cshort-id\u003e`\n\n**FEATURES / ENHANCEMENTS**\n+ each command-line parameter now includes a short description\n+ more elaborate information about the runtime configuration is now printed on startup\n+ unnecessary sub-paths following a valid request path are no longer ignored\n+ the new endpoint `/state/` returns a rendered list of all current uploads\n\n### v0.1.0\nMVP\n\n## License\n\nGNU Affero General Public License version 3, see [LICENSE](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillibutz%2Furlnao","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillibutz%2Furlnao","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillibutz%2Furlnao/lists"}