{"id":16167515,"url":"https://github.com/crueter/trance","last_synced_at":"2025-04-07T05:51:40.358Z","repository":{"id":159514201,"uuid":"410391148","full_name":"crueter/trance","owner":"crueter","description":"dead-simple, super minimal file upload service in C","archived":false,"fork":false,"pushed_at":"2022-02-11T03:38:19.000Z","size":62,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-13T10:18:23.399Z","etag":null,"topics":["file-sharing","file-upload","upload-file"],"latest_commit_sha":null,"homepage":"https://file.swurl.xyz","language":"C","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/crueter.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":"2021-09-25T22:03:03.000Z","updated_at":"2024-11-26T05:24:05.000Z","dependencies_parsed_at":"2023-05-20T20:15:14.259Z","dependency_job_id":null,"html_url":"https://github.com/crueter/trance","commit_stats":null,"previous_names":["crueter/trance"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crueter%2Ftrance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crueter%2Ftrance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crueter%2Ftrance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crueter%2Ftrance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crueter","download_url":"https://codeload.github.com/crueter/trance/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247601486,"owners_count":20964864,"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":["file-sharing","file-upload","upload-file"],"created_at":"2024-10-10T03:08:25.825Z","updated_at":"2025-04-07T05:51:39.984Z","avatar_url":"https://github.com/crueter.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"A dead-simple, self-hostable file-upload service, written in C using [Mongoose](https://cesanta.com).\n\nThis project is largely based off of my [pacebin](https://git.swurl.xyz/swirl/pacebin), itself based off of my [clink](https://git.swurl.xyz/swirl/clink) project. The code is nearly identical to that found on pacebin, as they're pretty much the exact same thing.\n\nPlease access this project on my [Gitea](https://git.swurl.xyz/swirl/trance) instance, NOT GitHub.\n\n# Features\n- Tiny executable size (~80kb)\n- No dependencies, just libc\n- Extremely simple to use--basic POST and GET\n- No bloated webapp, just a simple reverse proxy\n- Super light on resources\n- Basic and easy file deletion\n- No duplicate filenames\n- Fast!\n- Basic filesystem storage--easy to manage without external programs/libraries\n\n# Self-Hosting\nYou can host this yourself.\n\nNote: all commands here are done as root.\n\n## Building \u0026 Installing\nTo build this project, you'll need a libc implementation (only tested with glibc), optionally a separate libcrypt implementation, and Git. Most Linux distributions should have all of these by default, but in case yours doesn't:\n- `pacman -S glibc libxcrypt git`\n- `emerge --ask sys-libs/glibc dev-vcs/git`\n- `apt install glibc git`\n\n1. Clone this repository:\n\n```bash\ngit clone https://git.swurl.xyz/swirl/trance \u0026\u0026 cd trance\n```\n\n2. Now, you need to compile. When compiling, you can easily change the maximum size of uploaded files. Simply specify the variable `MAX_SIZE`; i.e. for a 100MB limit: `make MAX_SIZE=104857600`. This defaults to 50MB.\n```bash\nmake\n```\n\n3. Now, you need to install. NGINX and systemd files are provided in this project; you may choose not to install them.\n\nFor all install commands, you may optionally provide `prefix` and `DESTDIR` options. This is useful for packagers; i.e. for a PKGBUILD: `make prefix=/usr DESTDIR=${pkgdir} install`.\n\nAvailable install commands are as follows:\n- `make install` installs the executable, NGINX, and systemd files.\n- `make install-bin` installs the executable file.\n- `make install-systemd` installs the systemd file, as well as its environment file.\n- `make install-nginx` installs the NGINX file.\n\nFor example, on a non-systemd system using NGINX, you would run `make install-bin install-nginx`.\n\n4. If using systemd, change the environment file to reflect your desired options:\n```bash\nvim /etc/trance.conf\n```\n\n5. You can now enable and start the service:\n```bash\nsystemctl enable --now trance\n```\n\nThe server should now be running on localhost at port 8082.\n\n## NGINX Reverse Proxy\nAn NGINX file is provided with this project. Sorry, no support for Apache or lighttpd or anything else; should've chosen a better HTTP server.\n\nFor this, you'll need [NGINX](https://nginx.org/en/download.html) (obviously), certbot, and its NGINX plugin. Most Linux distributions should have these in their repositories, i.e.:\n- `pacman -S nginx certbot-nginx`\n- `emerge --ask www-servers/nginx app-crypt/certbot-nginx`\n- `apt install nginx python-certbot-nginx`\n\nThis section assumes you've already followed the last.\n\n1. Change the domain in the NGINX file:\n```bash\nsed -i 's/your.doma.in/[DOMAIN HERE]' /etc/nginx/sites-available/trance\n```\n\n2. Enable the site:\n```bash\nln -s /etc/nginx/sites-{available,enabled}/trance\n```\n\n3. Enable HTTPS for the site:\n```bash\ncertbot --nginx -d [DOMAIN HERE]\n```\n\n4. Enable and start NGINX:\n```bash\nsystemctl enable --now nginx\n```\n\nIf it's already running, reload:\n```bash\nsystemctl reload nginx\n```\n\nYour site should be running at https://your.doma.in. Test it by going there, and trying the examples. If they don't work, open an issue.\n\n# Contributions\nContributions are always welcome.\n\n# FAQ\n## A user has made a file containing bad content! What do I do?\nClean it up, janny!\n\nDeleting a file can be done simply by running:\n```bash\nrm /srv/trance/*/SHORTIDHERE\n```\n\nThe short ID is the random hexadecimal string BEFORE the filename. You can usually find it through NGINX logs or something.\n\nReplace `/srv/trance` with whatever your data directory is.\n\n## Can I blacklist certain words from being used in files and filenames?\nNo. While it might be possible through some NGINX stuff, **this is not supported nor it is encouraged.**\n\n## Is this an IP grabber?\nNo. If access logs are turned on, then the server administrator can see your IP, but management of access logs is up to them.\n\n## Can I use this without a reverse proxy?\nProbably, I don't know. Won't have HTTPS though, so either way, I heavily recommend you use a reverse proxy.\n\n## What's the seed for?\nThe seed is used for generating deletion keys. Do not share it whatsoever.\n\n## What operating systems are supported?\nI've only tested it on my Arch Linux server, but it should work perfectly fine on all Linux distributions. Probably doesn't work on Windows.\n\n## Can I run this in a subdirectory of my site?\nYes. Simply put the `proxy_pass` directive in a subdirectory, i.e.:\n```\nlocation /paste {\n    proxy_pass http://localhost:8082;\n}\n```\n\n## Why'd you make this?\nEvery file upload service sucks. Simple as. All of the self-hostable options I could find had problems, including:\n- Loads of unnecessary dependencies\n- Huge executable size (Go lol)\n- Used some bloated webapp with no basic API\n- Feature bloat; i.e. encryption, auto-expiration, etc.\n- Written in Ruby, NodeJS, PHP, or some other bad language\n- No direct reverse-proxy support\n- Reliance on statically serving the index files\n- Reliance on static configuration like the host\n- Reliance on other services (i.e. link shorteners)\n\nThis project is intended to be a file upload service that is **as simple as possible**. Literally just upload, download, and delete files. That's it.\n\nAlso, there were surprisingly none written in C.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrueter%2Ftrance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrueter%2Ftrance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrueter%2Ftrance/lists"}