{"id":23406231,"url":"https://github.com/zozs/i","last_synced_at":"2025-04-11T21:50:47.376Z","repository":{"id":40575925,"uuid":"279258557","full_name":"zozs/i","owner":"zozs","description":"My own image/file upload service","archived":false,"fork":false,"pushed_at":"2024-08-04T18:46:55.000Z","size":613,"stargazers_count":3,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-25T17:49:28.215Z","etag":null,"topics":["screenshot"],"latest_commit_sha":null,"homepage":"https://sr.ht/~zozs/i/","language":"Rust","has_issues":false,"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/zozs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-07-13T09:33:16.000Z","updated_at":"2024-08-04T18:46:58.000Z","dependencies_parsed_at":"2024-07-15T13:03:46.752Z","dependency_job_id":"1fd962c8-d1be-475d-af85-b0787ece76f5","html_url":"https://github.com/zozs/i","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zozs%2Fi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zozs%2Fi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zozs%2Fi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zozs%2Fi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zozs","download_url":"https://codeload.github.com/zozs/i/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248487733,"owners_count":21112188,"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":["screenshot"],"created_at":"2024-12-22T13:32:48.504Z","updated_at":"2025-04-11T21:50:47.351Z","avatar_url":"https://github.com/zozs.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# i\n\ni is an upload service over HTTP that you can run on your own server.\n\nIt is useful to, for example, easily upload screenshots from your computer to your own server, and get a short URL such as `https://i.example.com/oYP59upc.png`, which you can send to your friends over, e.g., chat or mail.\n\nIt works over HTTP, which makes it easy to upload files using different clients. It is also easy to both upload and download files from everywhere in the world, as long as you can make a regular HTTP connection. If desired, it uses HTTP Basic Authentication to ensure that not everyone can upload files to your server. Filenames are auto-generated random strings (by default), to avoid file enumeration. Optionally, you can also upload and keep the original filename.\n\nOther features:\n\n* Provides a `/recent` page where you can see recent uploads\n* The recent page also provides thumbnails of upload for easier browsing\n\n## Bugs, feature requests, development\n\nBug tracker, mailing lists, and the canonical source code repo is hosted on Sourcehut [https://sr.ht/~zozs/i/](https://sr.ht/~zozs/i/).\n\n## Compile\n\nRun `cargo build`\n\n## Running (during development)\n\nRun `RUST_LOG=debug cargo run`\n\n## Uploading files\n\nCheck the [client-side](client-side/) directory in this repo for some examples on how files or screenshots can be uploaded to the server.\n\nNote that you need to modify the server URL in each script to point to your own running instance.\n\nThe following examples are included:\n\n* [screenshot-open.sh](client-side/screenshot-open.sh) Take a screenshot of a selected area of the screen, upload it, and open the resulting URL in the default browser.\n* [wayland-screenshot-open.sh](client-side/wayland-screenshot-open.sh) The same as above, but uses `grim` and `slurp` instead, and works well in a Wayland environment.\n* [screenshot.sh](client-side/screenshot.sh) Take a screenshot of a selected area of the screen, upload it, and copy the resulting URL to the clipboard.\n* [icp](client-side/icp) Upload a file from the terminal using `icp file.txt`, upload it, and open the resulting URL in the default browser.\n* [upload-with-i.desktop](client-side/upload-with-i.desktop) Copy file to `~/.local/share/file-manager/actions/` to add \"Upload with i\" entry to the context menu in your file manager. Needs to be modified with the correct path to `icp` above, on the `Exec` line.\n* [ios-shortcut.png](client-side/ios-shortcut.png) An image describing an iOS shortcut that can be used from the Share menu on images and documents. Will upload to the server, and put the resulting URL in the clipboard, so that it can be pasted into an e-mail or text.\n\n### Using curl\n\nCan be done using `curl`. The following command-line uploads a file `testfile.txt` in the current directory to the server.\nA random filename will be generated by the server and returned in the JSON object, as well as in a `Location:` header (since the response will be a 303 See Other upon success, unless configured otherwise, see below) Thus, in the example below, the uploaded file will be available at `http://localhost:8088/Uake9Um7.txt`.\n\n```\n$ curl -F file=@testfile.txt http://localhost:8088\n\n{\"url\":\"http://localhost:8088/Uake9Um7.txt\"}\n```\n\nThe following example will upload the same file, but will use the original filename instead, which can be seen in the response URL.\n\n```\n$ curl -F file=@testfile.txt -F options='{\"useOriginalFilename\":true}' http://localhost:8088\n\n{\"url\":\"http://localhost:8088/testfile.txt\"}\n```\n\n### Disabling redirect headers\n\nFor certain clients (e.g., iOS Shortcuts), it may be desirable to not have a `Location` header, or the 303 status code. If the option `\"redirect\":false` is added to the `options` object, the return code will instead be 200 OK, and there will be no `Location` header. The returned JSON object is the same, however.\n\n```\n$ curl -F file=@testfile.txt -F options='{\"redirect\":false}' http://localhost:8088\n\n{\"url\":\"http://localhost:8088/Uake9Um7.txt\"}\n```\n\n## Configuration\n\nSet the following environmental variables to configure `i`.\nYou can also set all settings by using arguments instead, such as `i -P 1234` to change port.\nSee `i --help` for details.\n\n* `AUTH_USER`: Set to the username for basic auth if you want to require authentication to upload files. Empty means no authentication.\n* `AUTH_PASS`: Set to the password for basic auth if you want to require authentication to upload files. Empty means no authentication.\n* `BASE_DIR`: Set to the file system directory where uploaded files will be stored to and served from. Default `./tmp`.\n* `SERVER_URL`: Set to the complete server URL base which should be used when generating links. Default: `http://localhost:8088`.\n* `PORT`: Which port `i` should listen to. Default `8088`.\n* `RECENTS`: How many entries to show in the list of recent uploads at the `/recent` endpoint (default: 15)\n* `THUMBNAIL_SIZE`: The width and height in pixels for the generated thumbnails (default: 150)\n\nSet `RUST_LOG` to a valid [EnvFilter](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html) string to customize tracing. Example `RUST_LOG=\"i=info,[request]=debug\"` to log requests too.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzozs%2Fi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzozs%2Fi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzozs%2Fi/lists"}