CyberChef
Web app for encoding, decoding, encrypting, compressing and picking apart data, by chaining hundreds of small operations into a recipe.
Security / Development / Tools
Web app for your two-factor authentication codes, a self-hosted stand-in for Google Authenticator: add accounts by scanning or uploading their QR codes, then copy codes from any browser.
It isn't in the main Portainer Templates list yet, so use this one. Portainer takes one URL at a time, so it swaps out whatever list you had before.
In Portainer, head to Settings --> App Templates, paste this in as the URL and save.
https://raw.githubusercontent.com/NotAFlightRisk/portainer-templates-extras/main/templates.json http://<your-server>:8200 in a browser.The same file Portainer deploys. It reads its settings from a .env next to it.
services:
2fauth:
image: 2fauth/2fauth:8
restart: unless-stopped
ports:
- "${TWOFAUTH_PORT:-8200}:8000"
environment:
APP_KEY: ${TWOFAUTH_APP_KEY:?Set an app key of exactly 32 characters}
APP_URL: ""
volumes:
- 2fauth-data:/2fauth
volumes:
2fauth-data:
Fill in the blanks, as 2FAuth won't start without them.
# App key (required) - Exactly 32 characters. Generate one with: openssl rand -hex 16. Keep it the same when you redeploy.
TWOFAUTH_APP_KEY=
# Host port for the web UI
TWOFAUTH_PORT=8200 Grab the file and start it.
mkdir 2fauth && cd 2fauth
curl -fsSL -o compose.yml https://raw.githubusercontent.com/NotAFlightRisk/portainer-templates-extras/main/apps/2fauth/compose.yml
# save the .env tab here as .env first
docker compose up -d Set the app key before you deploy (exactly 32 characters, openssl rand -hex 16 makes one), since the stack won't start without it. Keep it the same from then on, as it signs logins and encrypts your codes if you turn on encryption. Then open http://<your-host>:8200 (or whichever port you picked) and register: the first account becomes the admin. Anyone who can reach it can register after that, so once you're in, tick Disable registration under Admin panel --> Authentication (the menu under your email). Scanning a QR code with the camera and passkeys both need HTTPS, so behind plain http you'll be uploading QR screenshots and signing in with a password. Everything lives in the 2fauth-data volume, and since that's every 2FA secret you've got, back it up. Docs: docs.2fauth.app
What the Portainer form asks for. With compose they go in the .env file instead.
| Variable | What it's for | Default |
|---|---|---|
TWOFAUTH_APP_KEY | App key (required) Exactly 32 characters. Generate one with: openssl rand -hex 16. Keep it the same when you redeploy. | Needs filling in |
TWOFAUTH_PORT | Host port for the web UI | 8200 |
The containers this stack runs, with ports as they come out of the box.
| Service | Image | Ports |
|---|---|---|
2fauth | 2fauth/2fauth:8 | 8200:8000 |