{"id":13548982,"url":"https://github.com/moshee/airlift","last_synced_at":"2025-04-02T22:31:09.851Z","repository":{"id":14272332,"uuid":"16980249","full_name":"moshee/airlift","owner":"moshee","description":"A self-hosted file upload and sharing service","archived":false,"fork":false,"pushed_at":"2022-12-19T00:15:24.000Z","size":497,"stargazers_count":147,"open_issues_count":12,"forks_count":20,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-11-03T18:34:03.741Z","etag":null,"topics":["airlift","file-sharing","file-upload","go"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moshee.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}},"created_at":"2014-02-19T10:05:10.000Z","updated_at":"2024-09-20T11:31:34.000Z","dependencies_parsed_at":"2023-01-13T17:51:46.354Z","dependency_job_id":null,"html_url":"https://github.com/moshee/airlift","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moshee%2Fairlift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moshee%2Fairlift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moshee%2Fairlift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moshee%2Fairlift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moshee","download_url":"https://codeload.github.com/moshee/airlift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246905098,"owners_count":20852810,"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":["airlift","file-sharing","file-upload","go"],"created_at":"2024-08-01T12:01:16.841Z","updated_at":"2025-04-02T22:31:09.412Z","avatar_url":"https://github.com/moshee.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# Airlift :package:\n\n[![Build Status](https://travis-ci.org/moshee/airlift.svg?branch=master)](https://travis-ci.org/moshee/airlift)\n\nAirlift is a self-hosted file upload and sharing service. The clients upload\nfiles to the server and return a nice link for you to share. Just bring your\nown server and domain.\n\n:bomb: This is unstable software. It is not feature-complete and has lots of bugs.\n\nYou should use [deuiore/load.link](https://github.com/deuiore/load.link)\ninstead of this if...\n\n- ...you like PHP;\n- ...you don't like me;\n- ...you're on a free/cheap shared host that doesn't allow long-running\n  processes.\n\n#### Clients\n\n- Web interface (included in server)\n- Cross-platform CLI (included in `cmd/lift`)\n- [OS X][osx]\n\n[osx]: https://github.com/moshee/AirliftOSX\n\n# airliftd\n\n`airliftd` is the Airlift server. You drop the server on any dedicated, VPS,\nshared host, whatever, as long as it supports running a binary and gives you\naccess to ports or frontend server reverse proxying. A client sends files to it\nand recieves nice URLs to share. The server itself also provides a web-based\nclient to upload files from, as well as manage existing uploads and customize\nsome behaviors.\n\nThe server is packaged as a statically compiled binary with a few text assets\nwith no system dependencies apart from maybe libc for networking. Just download\n(or clone and build), add to your init system of choice, and run.\n\nYou can choose to run it behind a frontend server or standalone. \n\n## Installing\n\n### If you just want a binary\n\nDownload a release from [the GitHub Releases tab][1]. Put the included binary\nwherever you want in your `$PATH`.\n\n[1]: https://github.com/moshee/airlift/releases\n\n### Or if you want to build it yourself\n\n1. [Install Go](http://golang.org/doc/install) and git\n2. If you don't already have a [`GOPATH`][2]: `$ mkdir ~/go \u0026\u0026 export GOPATH=~/go` (you can use any place as your `GOPATH`)\n3. `$ go get ktkr.us/pkg/airlift/cmd/airliftd`\n\n[2]: https://github.com/golang/go/wiki/GOPATH\n\nI haven't tried to build or run it on Windows, YMMV. Works on macOS and\nGNU+Linux.\n\n## Updating\n\n1. Replace binary with new one.\n2. There is no step 2.\n\n## Usage\n\nTo run server:\n\n```\n$ airliftd\n```\n\nIn development, you can pass the flag `-rsrc .` to instruct it to load files from disk\nrooted in the working directory.\n\nThe server runs in the console. You can use whatever tools you want to\nbackground it.\n\n### Command line options\n\n```\nUsage of airliftd:\n  -debug\n        Enable debug/pprof server\n  -p int\n        Override port in config (default -1)\n  -rsrc DIR\n        Look for static and template resources in DIR (empty = use embedded resources)\n  -v    Show version and exit\n```\n\n### Sample nginx config\n\n```nginx\nserver {\n\tlisten 80;\n\tserver_name i.example.com;\n\tlocation / {\n\t\tproxy_pass http://localhost:60606;\n\n\t\t# tell the proxied server its own host (not localhost)\n\t\tproxy_set_header Host $http_host;\n\n\t\t# tell the proxied server the remote host (not localhost either)\n\t\tproxy_set_header X-Forwarded-For $remote_addr;\n\t}\n}\n```\n\n### Configuration settings\n\nWhen you start the server for the first time, it will generate a dotfolder in\nyour home directory for local configuration. Visit\n`http(s)://\u003cyourhost\u003e/config` to set up a password and change other\nconfiguration parameters. On the first setup, an empty password will not be\naccepted.\n\nIf you manually edit the config file while the server is running, you should\nsend the server process a SIGHUP to force a config reload.\n\nIf the server fails to start with a config error, you probably want to delete\n`~/.airlift-server/config` and reconfigure from scratch.\n\n**Base URL** []: The base URL that links will be returned on. This includes domain\nand path.\n\nIf you are proxying the server behind a frontend at a certain subdirectory,\nmake sure you rewrite the leading path out of the request URL so that the URLs\nsent to `airlift` are rooted. Unfortunately, since URLs are rewritten, the\nredirecting behavior of /-/login and /-/config won't work properly, so you'll have\nto do your configuration on the internal port (60606 or whatever). Could use a\nmeta redirect instead of internal redirect to fix this, but that doesn't play\nwell with how sessions and stuff are set up in here.\n\nLeaving the host field empty will cause the server to return whatever host the\nfile was posted to.\n\n**Length of File ID** [4]: Number of characters in subsequently generated file\nIDs. In general, more characters gives better collision characteristics (and\nare harder to guess).\n\n**Append File Extensions** [off]: If enabled, links generated by the upload\ntool will end with the original file's extension, e.g.\n`i.example.com/f9gW.zip` instead of `i.example.com/f9gW`.\n\n**Limit Upload Age** [off]: Enable this to automatically limit the maximum age\nof uploads by periodically pruning old uploads.\n\n**Max Age** [0]: If **Limit Upload Age** is on, uploads older than this number\nof days will be automatically deleted.\n\n**Limit Total Uploads Size** [off]: Enable this to automatically limit the size\nof the uploads folder on disk.\n\n**Max Size** [0]: If **Limit Total Uploads Size** is on, the oldest uploads\nwill be pruned on every new upload until the total size is less than this many\nmegabytes.\n\n**Enable Twitter Cards** [off]: If enabled, image uploads (which can be\nthumbnailed) will provide a Twitter Card preview when their URLs are\nmentioned in Tweets. This is achieved by serving an alternate page with\nrelevant metadata for the file when the User-Agent of the visitor includes\nTwitterbot.\n\n**Twitter Handle** []: Twitter Cards require that the Twitter handle of the\nsource's creator is included in the metadata.\n\n**Syntax Highlighting** [off]: Enable to serve text-based files with syntax\nhighlighting. The raw file can be requested by appending `?raw=1` to the URL.\n\n**Syntax Theme** []: Set the syntax highlighting color scheme.\n\n**Upload Directory** [~/.airlift-server/uploads]: This is where uploaded files\nwill be stored.\n\n**New Password** []: Change your password here.\n\n**Confirm New Password** []: Enter the new password again to confirm.\n\n### HTTPS\n\nIn order to use SSL/TLS standalone, set the following environment variables:\n\n Variable       | Value\n----------------|---------------------------------------------\n `GAS_TLS_PORT` | The port for the secure server to listen on\n `GAS_TLS_CERT` | The path to your certificate\n `GAS_TLS_KEY`  | The path to your key\n `GAS_PORT`     | *Optional:* set this to -1 if you **only** want HTTPS, not regular HTTP.\n\nIf both HTTP and HTTPS are enabled, they will both serve from the same\nexecutable and HTTP requests will redirect to HTTPS.\n\n## Development\n\n- After making modifications to static assets, use `go generate` in `cmd/airliftd`\n  to create the source files for them\n- After tagging a release, use `cmd/airlift/gen_version.bash` to create the\n  source file with the tagged version\n- Build with `go build`\n\n# lift\n\n`lift` is a CLI client interface to `airliftd`. It takes a filename as an\nargument and uploads the server at the configured host, which is stored as a\nJSON file in an OS-dependent location (`~/.airlift` on POSIX,\n`%LOCALAPPDATA%\\airlift\\airlift_config` on Windows). These may also be\nconfigured by the client.\n\nIf the server requires a password, the client will prompt for it and it will be\nsaved in a secure system-dependent fashion:\n\n- **OS X**: Keychain\n- **Windows**: encrypted in conf file using current user info\n- **Linux**: I'm not really sure so I just used Twofish\n\n### Installing\n\nBinaries will be made available for common platforms. To build it yourself,\n\n1. [Install Go](http://golang.org/doc/install)\n2. Assuming `GOPATH` is set up, `$ go install` should do it if you have a sane\n   build environment. This client uses cgo, so there may be some\n   platform-specific issues to take into consideration.\n\n#### Windows\n\nIf on Windows, set `CC` to the name of your MinGW32 compiler if needed. If the\nlinker complains, you will need to add the location of crypt32.lib (or\nlibcrypt32.a) to the linker path.\n\n#### Cygwin\n\nSince Go doesn't officially support Cygwin, you have to use MinGW32 to compile.\nYou don't have to *install* MinGW32, though, just get the MinGW32 gcc suite for\nyour architecture from the Cygwin installer and compile with either\n\n```\n$ CC=x86_64-w64-mingw32-gcc go build\n```\n\nfor 64-bit, or whatever the equivalent for 32-bit is.\n\nNote that since the Windows versions of the Go packages use all Windows APIs, it\nwon't understand anything Cygwin-specific such as symbolic links and the like.\n\n### Usage\n\nWhen you use it for the first time, you'll need to set up a host. The following\nare equivalent:\n\n```\n$ lift -h i.example.com -p 80\n$ lift -a http://i.example.com\n$ lift -a http://i.example.com:80\n```\n\nIf the server requires a password, it will be prompted for:\n\n```\n$ lift \"today's lunch.jpg\"\nServer returned error: password required\nYou'll need a new password. If the request is successful,\nit will be saved in the OS X Keychain.\nPassword:\n[▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉]\nhttp://i.example.com/dGp9\n(Copied to clipboard)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoshee%2Fairlift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoshee%2Fairlift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoshee%2Fairlift/lists"}