Serve files via HTTP for a set duration of time.
Project description
Lbox - a litterbox clone-ish
This is a self-hosted server that makes you make available files for a limited amount of time.
Installation
The best way to install this is via pipx which will create a virtual environment and manage the dependencies for you:
pipx install lbox
That will work when the project is available from Pypi, meanwhile from the .tar.gz file as created by the build command sdist:
pipx install lbox-X.Y.tar.gz
Where, of course, X.Y is the version number.
Building from repo
You should be working on a virtual environment. On your virtual environment install the buildpackage:
python3 -m pip install build
then simply run build, which will create the source distribution (i.e. the .tar.gz file) and the wheel package:
python3 -m build
Using Lbox
Lbox scans the directory specified in the environment variable LBOX_ROOTDIR for directories with names of the form number timeunits e.g. 5 hours, 2days, 20m, etc. And the files under those directories will be deleted after the specified time elapses, being available for download in the meantime. Note that you only need to specify d, m, h and s for days, minutes, hours and seconds, respectively. Only the initial matters. Also note that whitespace between the number and the units is optional.
If the LBOX_ROOTDIR environment variable is not set, the default folder will be /var/www/lbox
The lbox server
The lboxcommand is the web server that publishes the files. It will just provide a list of the files along with its size and the time to expiration. Every file can be downloaded from the url ending in /file/<filename>, with no additional directory path. No, the server doesn't allow uploading new files, but what's the need for it? Being self hosted, you can always scpinto the right directories to share.
The lbox server runs by default on port 8080.
To run lboxuse the command:
LBOX_ROOTDIR=/path/to/dir lbox
It is recommended that a systemdis created to run lbox continuously. It is also recommended that lboxbe run on http behind a reverse proxy that handles the SSL certificate and manages security etc.
License
This project is released under the MIT license.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lbox-2.0.0.tar.gz.
File metadata
- Download URL: lbox-2.0.0.tar.gz
- Upload date:
- Size: 54.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49e57a1dadc1a57b81fa329d1a6896de1a06b77a6cb263a1754b765a87ea8b4c
|
|
| MD5 |
e41ef64719ef0bbbae2d10885169540c
|
|
| BLAKE2b-256 |
9ae8327bd76fca3c722ca7a68778245044ae1599114ab503aef3c4157d6f226f
|
File details
Details for the file lbox-2.0.0-py3-none-any.whl.
File metadata
- Download URL: lbox-2.0.0-py3-none-any.whl
- Upload date:
- Size: 53.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39bcd4e3d056c17e04e51caf81e46d7a8fcbd3e80338eeca086acd7705082a71
|
|
| MD5 |
20fe19a03bba7d5f552fbdc8abebcd9c
|
|
| BLAKE2b-256 |
447fb27f313102c79f632c7ee56b1c6131c77a3f770347d173c208d8a0d6dab2
|