||1 week ago|
|.vscode||3 weeks ago|
|docs||1 week ago|
|src||1 week ago|
|static||4 weeks ago|
|templates/localhost:8282||4 weeks ago|
|.env||3 weeks ago|
|.gitignore||2 weeks ago|
|Cargo.lock||2 weeks ago|
|Cargo.toml||2 weeks ago|
|LICENSE||2 months ago|
|README.md||2 weeks ago|
|config.toml||2 weeks ago|
|schema.sql||2 weeks ago|
This is the repository for a ephemeral file hosting server. It receives files and serves them on request. After a while it decides to delete them. That's it!
This project is a re-write of QuadFile, a project I found years ago, being a old python project, It already wasn't the fastest it could be. I extended on it's features into my own fork, and now that I want to learn rust, I've decided to stop work on it, and start work on the 2nd generation of the server; Ephemeral.
What Exactly does it do?
- Receives files from users
- Sends files to users.
- Allows the admin to configure what files are allowed.
- Allows the admin to configure how long files are stored for. (See here)
- Allows the admin to configure if the files should be renamed automatically.
- Has a cool 'API' and is nicely configured for ShareX to upload files! (also see: SUpload)
- Generates cool statistics about what files are being uploaded/downloaded in a way that it can be shown on grafana.
Okay, how do I install it?
That's a little more complicated. Eventually we'll have 2 different environments, development and production, each with different logging and such.
- Make sure you have a /supported/ database installed and working, either sqlite, or Postgres.
- Initialise the database with the following command
sqlite3 ephemeral.db < schema.sql1.1. If you want to speed up sqlite a little bit more, run
sqlite3 ephemeral.dband then
PRAGMA synchronous = OFF;and then Ctrl+D
- Compile and run ephemeral with
LOG=debug cargo runfor the debug build.
LOG=info cargo run -rwill run the release build.
Configuration is done by settings environment variables in the launch command. (This definitely isn't because I cannot be bothered implementing a proper config file in code.)
|HOST||0.0.0.0||What IP the application listens on|
|PORT||8282||What port the application listens on.|
|EPHEMERAL_LOG||(Required) Sets the log level output|
|ENGINE||2||Sets the engine mode|
|CLEANER_INTERVAL||1800||How long the cleaner task runs, in seconds.|
|FILE_EXPIRY_MIN||7||(Depends on engine setting) The Minimum a file /should/ exist on the server for.|
|FILE_EXPIRY_MAX||365||(Depends on engine setting) The Longest a file /should/ exist on the server for.|
|MAX_FILESIZE*||1073741824||The 'cap' for calculating expiry.|
*MAX_FILESIZE doesn't actually set the maximum allowed filesize, it's only used for calculating the expiry.
Wierd Security things you should probably be aware of
If you're running outside of a reverse proxy, it's possible to access any file on the file system that is readable by the user.
Since we use the HTTP Host header to find the theme, you could set your host to something like
../../../../etc/passwd and it may or may not work.
Chucking it behind a proxy (that uses the config in the documentation) means a invalid Host header /should/ break.
TODO: Test this please before I start using it publically, it rEALLY isn't a smart idea. :)
exhail - seriously, without your babying me on IRC, I woudln't have been able to do this. audron - who told me to use rust in the first place, and showed me a bunch of cool stuff. Areganno - improved upon the StableDiffusion logo. (and by that I mean completely remade it) Shadowhand & hailey - I had a moment of weakness while writing nginx configs, and they were there when I needed them the most.