Skip to main content

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 uses a configuration file that contains sections with a name of the form <number> followed by either hours, minutes, days or seconds, e.g:

[1 hour]
dir = /var/www/lbox/1hourfiles
[3 days]
dir = /var/www/lbox/3dayfiles

In the example above, any file placed on the directory /var/www/lbox/1hourfiles will be deleted when its modification time is more than one hour ago. Similarly for files placed on /var/www/lbox/3dayfiles, which will be deleted after three days.

On each section there may be more directory variables listed, the name of the variable is unimportant. Also a variable can have multiple directories, e.g.:

[1d]
dir1 = /home/fred/temp
manydirs =
   /var/www/lbox/1dayfiles
   /tmp/scratch

In this example, the files placed on any of those directories will be deleted when their modification time is one day old. 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.

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 and needs the same configuration file as the expirator utility.

To run lboxuse the command:

lbox --config=lbox.conf

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

lbox-1.0.1.tar.gz (54.4 kB view details)

Uploaded Source

Built Distribution

lbox-1.0.1-py3-none-any.whl (53.9 kB view details)

Uploaded Python 3

File details

Details for the file lbox-1.0.1.tar.gz.

File metadata

  • Download URL: lbox-1.0.1.tar.gz
  • Upload date:
  • Size: 54.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.9

File hashes

Hashes for lbox-1.0.1.tar.gz
Algorithm Hash digest
SHA256 746fcfd19b1389f36afed7ded485175d0ac0ff432e0a5c66fd543affde35adb7
MD5 13e146e769d5766b897e6958e16e1c07
BLAKE2b-256 d4b1e48ff81ab973e8f8408a165191b20bb8d6dfdaf011a07e460c47b29f0ceb

See more details on using hashes here.

File details

Details for the file lbox-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: lbox-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 53.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.9

File hashes

Hashes for lbox-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 41794a2fb38475e30012cb83755427c8a07f707adb63cdcffd48c5c8cc39b3a2
MD5 82c70d6ee88830440063659af898c351
BLAKE2b-256 015001f9ef3490563df4445bc671e61f22bef90282bac7cdef03eaf5bbb23d5b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page