Sign inSign up

blakerain/parcel

By blakerain

Updated 4 months ago

Simple and light weight file sharing webapp.

Image
Databases & storage
0

2.5K

blakerain/parcel repository overview

Parcel is a light-weight file storage web application written in Rust.

  • Support multiple users and administrators, including MFA
  • Users can be grouped into teams, with shared uploads
  • Uploaded files can be made public to allow download from anywhere
  • Number of downloads can be limited, and downloads can have an expiry date
  • Public downloads can be password protected
  • Files are stored in separate cache directory
  • Data is stored in an SQLite database

This container will run Parcel on port 3000.

docker run --name my-parcel -d blakerain/parcel

By default Parcel will store the database with sqlite://parcel.db and the cache of uploaded files under ./cache. These two locations cane overridden.

You can specify the SQLite database using the DB environment variable. For example, if you have mounted a volume under /data into which the database should be stored as parcel.db, you can set the DB environment variable to sqlite:///data/parcel.db:

docker run -d \
  --name my-parcel \
  -e DB=sqlite:///data/parcel.db \
  -v parcel_data:/data

You can specify the location of the cache files with the CACHE_DIR environment variable. For example, if you have mounted a volume parcel_data under /parcel, you could set the CACHE_DIR to /data/cache:

docker run -d \
  --name my-parcel \
  -e DB=sqlite:///data/parcel.db \
  -e CACHE_DIR=/data/cache \
  -v parcel_data:/data

Parcel uses an encrypted cookie to store session state. By default Parcel will create a new encryption secret whenever it starts. This can mean that sessions are invalidated when the container restarts. To avoid this, you can set the COOKIE_SECRET environment variable. Parcel expects this environment variable to contain 32 bytes in base-64 encoding.

You can quickly generate a new secret using openssl:

COOKIE_SECRET=$(openssl rand -base64 32 | tr -d '\n' ; echo)

Adjusting the above example container start command to include a cookie secret:

docker run -d \
  --name my-parcel \
  -e DB=sqlite:///data/parcel.db \
  -e CACHE_DIR=/data/cache \
  -e COOKIE_SECRET=$(openssl rand -base64 32 | tr -d '\n' ; echo) \
  -v parcel_data:/data

Plausible Analytics

There is support for adding a Plausible Analytics script into the <head> of each page by specifying the ANALYTICS_DOMAIN and PLAUSIBLE_SCRIPT environment variables. For example, if you hosted Plausible Analytics on pa.example.com and Parcel on parcel.example.com, you could specify the following:

docker run -d \
  --name my-parcel \
  -e DB=sqlite:///data/parcel.db \
  -e CACHE_DIR=/data/cache \
  -e COOKIE_SECRET=$(openssl rand -base64 32 | tr -d '\n' ; echo) \
  -e ANALYTICS_DOMAIN=parcel.example.com \
  -e PLAUSIBLE_SCRIPT=https://pa.example.com/js/script.js \
  -v parcel_data:/data

For more information, see the repository.

Tag summary

Content type

Image

Digest

sha256:77ee4131f

Size

66.1 MB

Last updated

4 months ago

docker pull blakerain/parcel