Portainer Templates logo

Portainer Templates

PsiTransfer PsiTransfer

Stack

File Sharing

File sharing in the WeTransfer mould: drop in files, pick how long they last, and send the link. Big uploads resume after a dropped connection, downloads come as single files, zip or tar.gz, and links can be one-time or password protected. Source: https://github.com/psi-4ward/psitransfer

Image details

Pulls: 5.6M
Architecture: amd64, arm64, arm/v7
Image size: 67 MB
Latest: v2.4
User: psitrax
Created: Apr 23, 2017
Updated: 7 days ago
Status: active

Source details

Stars: 2k
Forks: 248
Language: JavaScript
License: BSD-2-Clause
Updated: 7 days ago

Configuration

Type
Compose
Platform
linux
Image
psitrax/psitransfer:v2
Ports
${PSITRANSFER_PORT:-3030}:3000
Volumes
/data : psitransfer-data
Env vars
PSITRANSFER_UPLOAD_PASS=${PSITRANSFER_UPLOAD_PASS:?Set an upload password}PSITRANSFER_ADMIN_PASS=${PSITRANSFER_ADMIN_PASS:-}PSITRANSFER_PORT=3030
Restart
unless-stopped
Source

Notes

Set the upload password before you deploy, since the stack won't start without one. Then open http://<your-host>:3030 (or whichever port you picked), enter it, drop in some files, pick a retention and hit Upload. The download link works for anyone who has it, no password needed unless you set one on that upload under Settings. Uploads last a week by default, and anything still there after 75 days is deleted whatever was picked. If you set an admin password, /admin lists every upload with its size and downloads. Files live as plain files in the psitransfer-data volume, so they survive updates. Changing either password on the form and redeploying swaps it. Docs: github.com/psi-4ward/psitransfer

Standalone Install

Select an install method, to see config/commands for deploying PsiTransfer

Installation method

Install on Portainer

Import all app templates into your Portainer instance, for easy 1-click deploys

  1. Ensure both Docker and Portainer are installed, and up-to-date
  2. Log into your Portainer web UI
  3. Under Settings → App Templates, paste the below URL
  4. Head to Home → App Templates, and the list of apps will show up
  5. Select PsiTransfer, fill in any config options, and hit Deploy

Template Import URL

https://raw.githubusercontent.com/Lissy93/portainer-templates/main/templates.json
Show Me demo
Original stackfile

The compose file this template deploys, straight from its repo:

services:
  psitransfer:
    image: psitrax/psitransfer:v2
    restart: unless-stopped
    ports:
      - "${PSITRANSFER_PORT:-3030}:3000"
    environment:
      PSITRANSFER_UPLOAD_PASS: ${PSITRANSFER_UPLOAD_PASS:?Set an upload password}
      PSITRANSFER_ADMIN_PASS: ${PSITRANSFER_ADMIN_PASS:-}
    volumes:
      - psitransfer-data:/data

volumes:
  psitransfer-data:

Or deploy it directly from the source:

git clone https://github.com/NotAFlightRisk/portainer-templates-extras
cd portainer-templates-extras
docker compose -f apps/psitransfer/compose.yml up -d

More install options in our documentation, or see psi-4ward/psitransfer for app-specific guidance.

PsiTransfer

Current Release Dependencies Known Vulnerabilities Github Stars Docker Stars Image Size Docker Pulls Docker Automated buil Donate
Simple open source self-hosted file sharing solution. It's an alternative to paid services like Dropbox, WeTransfer.
  • No accounts, no logins
  • Mobile friendly responsive interface
  • Supports many and very big files (Streams ftw)
  • Resumable up- and downloads (tus.io)
  • Set an expire-time for your upload bucket
  • One-time downloads
  • Download all files as zip/tar.gz archive
  • Modal-style file preview
  • Requires Node >=7.4 or use --harmony-async-await flag
  • Password protected download list (AES)
  • /admin Page lists bucket information, Screenshot (disabled until you set adminPass config value)
  • Lightweight Vue based frontend apps. Gzipped (on by default) less than 100k
  • Explicit named bucket IDs with query param sid=<myBucketID>

See the blog posts about PsiTransfer: https://psi.cx/tags/PsiTransfer/ and checkout the Documentation
Screenshot

Quickstart

Docker

$ docker run -p 0.0.0.0:3000:3000 -e PSITRANSFER_ADMIN_PASS=secret -v $PWD/data:/data psitrax/psitransfer
# data volume needs UID 1000
$ sudo chown -R 1000 $PWD/data

Specify the version by using image tags
e.g.:
  • latest: corresponds to master branch
  • 2: latest stable 2.x.x
  • 1.1: latest stable 1.1.x
  • 1.0.0: exact version

Manual, precompiled

# Be sure to have NodeJS >= 12
$ node -v
v12.4.0

# Download and extract latest release package from
# https://github.com/psi-4ward/psitransfer/releases

# Install dependencies and start the app
$ NODE_ENV=production npm install
$ npm start

Manual, from source

# Compile the frontend apps
$ cd app
$ npm install
$ npm run build

# Install dependencies
$ cd ..
$ npm install
$ npm start

Configuration

There are some configs in config.js like port and data-dir. You can:
  • Edit the config.js (not recommend)
  • Add a config.production.js where production is the value from NODE_ENV
See config.dev.js
  • Define environment Variables like PSITRANSFER_UPLOAD_DIR to set the upload directory
  • To secure your PsiTransfer if exposed to the internet from unwanted, non authorized uploads use the PSITRANSFER_UPLOAD_PASS environment variable

Customization

public/pug/upload.pug and download.pug are kept simple. You can alter these files and add your logo and styles. Please keep a footnote like Powered by PsiTransfer :)

Debug

Psitransfer uses debug:
DEBUG=psitransfer:* npm start

Side notes

  • There is no (end-to-end) payload encryption (yet).
  • Download all as ZIP does not support resuming the download.

:star2: Contribution is highly welcome :metal:
Want to say thanks and buy me a beer? Donate

License

BSD

Check the logs first

Nine times out of ten the logs tell you exactly what went wrong.

  • In Portainer, go to Containers, click the container, then Logs. Or run docker logs <container>
  • Exit codes help too: 137 means killed, usually out of memory. 126 or 127 means the command inside the image is broken.

Image won't pull

Test the pull directly on the host: docker pull psitrax/psitransfer:v2

  • "manifest unknown" means the tag no longer exists.
  • "toomanyrequests" is the Docker Hub rate limit. Log in with docker login to raise it.
  • "no space left on device" means a full disk. Reclaim space with docker system prune

"exec format error"

This means the image was built for a different CPU architecture than your server.

  • This image supports: amd64, arm64, arm/v7
  • Check yours with uname -m: x86_64 is amd64, aarch64 is arm64. Raspberry Pi and other ARM boards are the usual culprits.

Container keeps restarting

The unless-stopped restart policy relaunches the app after every crash, so the real error can scroll past.

  • Check the logs right after a restart, the last few lines before it died are the useful ones.
  • Get the exit code with docker inspect <container> --format '{{.State.ExitCode}}'
  • Still stuck? Redeploy once with the restart policy set to no so the failure stays visible.

Stack won't deploy

Compose stacks fail fast on small mistakes, and Portainer shows the reason just above the editor.

  • YAML only accepts spaces for indentation, a single tab breaks the whole file.

Raise an issue

Found something which isn't working as it should? Here's how to report it.

A Compose stack

PsiTransfer is a Compose stack, a set of containers defined in one file and brought up together by Portainer, then started and stopped as a single app.

The app image

An image is the app packed up ready to go, everything PsiTransfer needs bundled into one download. This template pulls psitrax/psitransfer:v2, which Docker fetches once (about 67 MB) and then starts your own copy from.

Where the image comes from

Docker pulls its images from registries, public libraries of ready-built apps. PsiTransfer's comes from Docker Hub, published by psitrax.

Version tags

The bit after the colon in the image name is the version tag. This one pins v2, so every redeploy gives you that exact build until you bump it yourself.

Which machines it runs on

Every image is built for particular CPU types. This one ships for amd64, arm64, arm/v7, so it runs on both regular x86 servers and ARM boards like a Raspberry Pi.

Volumes

A volume is where PsiTransfer keeps its files so they survive an update or a restart. Without one, anything it saves would sit inside the container and vanish the moment it's recreated. This template mounts:

  • /data kept in the psitransfer-data volume Docker manages

Environment variables

Environment variables are the settings you hand over when you deploy, things like a password or a timezone. PsiTransfer takes 3 of them, and one needs a value before it'll start properly:

  • PSITRANSFER_UPLOAD_PASS, needs a value. Anyone uploading needs this, so strangers can't fill your disk. Downloads don't. Anything long and hard to guess, or generate one with: openssl rand -hex 16
  • PSITRANSFER_ADMIN_PASS, pulled from your own environment. Turns on the /admin page, which lists every upload. Leave blank to keep it off, or generate one with: openssl rand -hex 16
  • PSITRANSFER_PORT, defaults to 3030. Host port for the web UI

Restart policy

The restart policy here is unless-stopped, so Docker restarts PsiTransfer after a crash or reboot, but leaves it off when you stop it on purpose. You can change this on the deploy screen. The choices are no (never restart), on-failure (only after a crash), unless-stopped (restart unless you stop it), and always (bring it back no matter what).

Networking

Nothing custom is set, so PsiTransfer sits on Docker's default bridge network: its own private space that reaches the outside world only through the ports it publishes.

Container name

Once it's deployed, Portainer names the container psitransfer. That's what you'll spot in the containers list and use in commands like docker logs psitransfer.

Platform

The platform is linux, the kind of system the container is built to run on. Docker and Portainer handle this on a normal Linux server.

Open source license

PsiTransfer is open source, released under the BSD-2-Clause license. In plain terms the code is out in the open, so you're free to run it and change it to fit what you need.

Portainer app templates

Zooming out, this whole page comes from a Portainer app template: a short recipe telling Portainer how to set PsiTransfer up. Add the template list to Portainer once, then deploying PsiTransfer is a click rather than a wall of config.