Git.Cschad: sb.ma

[py] Fork of git.0x0.st/mia/0x0 - invite only instance: https://sb.ma

Secure Bin (sb)

Secure Bin is a fork of https://git.0x0.st/mia/0x0, but unlick 0x0 it's invite only!

Image

Configuration

To configure sb, copy examples/config.py to instance/config.py, then edit it. Resonable defaults are set, but there's a couple options you'll need to change before running sb for the first time.

By default, the configuration is stored in the Flask instance directory. Normally, this is in ./instance, but it might be different for your system. For details, see the Flask documentation.

If you are running nginx, you should use the X-Accel-Redirect header. To make it work, include this in your nginx config’s server block:

location /up {
    internal;
}

where /up is whatever you’ve configured as FHOST_STORAGE_PATH.

For all other servers, set FHOST_USE_X_ACCEL_REDIRECT to False and USE_X_SENDFILE to True, assuming your server supports this. Otherwise, Flask will serve the file with chunked encoding, which has several downsides, one of them being that range requests will not work. This is a problem for example when streaming media files: It won’t be possible to seek, and some ISOBMFF (MP4) files will not play at all.

To make files expire, simply run FLASK_APP=fhost flask prune every now and then. You can use the provided systemd unit files for this:

examples/0x0-prune.service
examples/0x0-prune.timer

Make sure to edit them to match your system configuration. In particular, set the user and paths in 0x0-prune.service.

Before running the service for the first time and every time you update it from this git repository, run FLASK_APP=fhost flask db upgrade.

python gic.py

Usage:

sb.sh is a shell script that lets you easily upload things via curl

curl https://git.cschad.com/scripts/raw/sb > sb && chomd +x sb
# Make sure the script is in your $PATH
# Add your private token
sb -sf somefile.txt # Upload somefile.txt and use secret URLs
sb -a https://example.com # archieve example.com
sb -e 3 -u "https://example.com/some/very/long/url"  # Shorten a url

Moderation UI

Please see: https://git.0x0.st/mia/0x0

To do