yopass Documentation
repository·master·Indexed 25 days ago
https://github.com/jhaals/yopassA secure secret-sharing platform using end-to-end encryption via OpenPGP. Yopass allows users to share passwords, secrets, and files without accounts or plaintext server storage. It supports multiple deployment methods including AWS CDK, Docker Compose, and Kubernetes, and offers flexible storage backends such as Memcached and Redis. The system includes a server (yopass-server) with support for OIDC authentication, S3 file storage, and Prometheus metrics, as well as a CLI for encrypting and decrypting secrets.
What's inside yopass
- Yopass is an open-source, end-to-end encrypted secret sharing service. It encrypts secrets in the browser using OpenPGP before they are sent to the server. Consequently, the server only stores ciphertext and never has access to the plaintext. Secrets are designed to self-destruct either upon retrieval or after a configured expiration period has passed.
Correlate Webhook Events with Secrets using Fingerprints
masterThe
secret_idin the webhook payload is a deterministic fingerprint. To map a webhook event back to a specific secret, compute the first 12 hex characters of the SHA-256 hash of the raw secret ID (the path segment of the share link).Formula:
secret_id = first 12 hex characters of SHA-256(raw secret ID)Example (Bash):
printf '%s' '8GjMyrJDkLwmnvKg9N1bzS' | sha256sum | cut -c1-12Example (Python):
import hashlib fingerprint = hashlib.sha256(raw_id.encode()).hexdigest()[:12]Configure the yopass license key in AWS SSM
masterBefore deploying the CDK stack, you must store the yopass license key (JWT) in the AWS SSM Parameter Store. The stack expects the key to be located at the path
/yopass/license-key.aws ssm put-parameter --name /yopass/license-key --type String --value '<jwt>'Install Yopass using Docker Compose with Redis
masterTo run Yopass with a Redis storage backend, use the following Docker Compose configuration.
Prerequisites:
- Docker and Docker Compose (v2+)
- Port
1337available on your machine
- Create a
docker-compose.ymlfile with the following content:
services: yopass: image: jhaals/yopass:latest ports: - "1337:1337" environment: DATABASE: redis REDIS: redis://redis:6379/0 depends_on: - redis redis: image: redis:7-alpine- Start the services:
docker compose up -d- Access the application at http://localhost:1337.
Install the yopass CLI
masterInstall the
yopassCLI using Go. Note that installations protected with OpenID Connect are not supported by the CLI.go install github.com/jhaals/yopass/cmd/yopass@latestSet a Custom Logo
masterReplace the default Yopass logo in the navbar and browser tab using the
--logo-urlflag (orLOGO_URLenvironment variable). This requires a valid--license-key.Image Requirements:
- Format: SVG (recommended), PNG, JPEG, or WebP.
- Shape: Square (displayed at 32×32 px).
- Resolution: At least 64×64 px for Retina displays.
- File size: Keep below 100 KB.
Usage Modes:
- Relative Path: e.g.,
/mylogo.png. If using Docker, copy the file into the frontend's/publicdirectory. - External URL: e.g.,
https://cdn.example.com/logo.svg. The server automatically updates theimg-srcContent Security Policy (CSP) to allow this origin.
FROM jhaals/yopass:latest COPY mylogo.png /public/mylogo.pngdocker build -t yopass-custom . docker run -p 1337:1337 yopass-custom \ --license-key your-license-key \ --logo-url /mylogo.pngConfigure Built-in TLS for Yopass
masterYou can serve Yopass over HTTPS directly by providing paths to a PEM-encoded TLS certificate and private key using the
--tls-certand--tls-keyflags. Yopass enforces a minimum TLS version of TLS 1.2. Note that both flags must be provided together, or the server will fail to start.Example: Using Let's Encrypt certificates
yopass-server \ --tls-cert /etc/letsencrypt/live/yopass.example.com/fullchain.pem \ --tls-key /etc/letsencrypt/live/yopass.example.com/privkey.pemExample: Using self-signed certificates (Development only)
openssl req -x509 -nodes -newkey rsa:4096 \ -keyout tls.key -out tls.crt \ -days 365 -subj "/CN=localhost" yopass-server --tls-cert tls.crt --tls-key tls.keyyopass-server \ --tls-cert /etc/ssl/yopass/tls.crt \ --tls-key /etc/ssl/yopass/tls.keyConfigure Prometheus to scrape Yopass metrics
masterAdd a scrape job to your
prometheus.yml. If running in Docker, use the container name as the target.scrape_configs: - job_name: yopass static_configs: - targets: ["yopass-host:9090"]Configure the Database file storage backend
masterThe default file storage backend stores files alongside text secrets in Memcached or Redis. No extra configuration is required for this mode.
Limitations:
- Memcached: Has a default item size limit of ~1 MB. Files larger than this will fail to store.
- Redis: While it has a higher limit, it is not ideal for large binary objects.
- A warning is printed at startup if
--max-file-sizeexceeds 1 MB without a dedicated file store (disk or S3) configured.
yopass-server # file-store defaults to the database backendSecure the Yopass metrics endpoint
masterThe metrics endpoint has no authentication. You should restrict access at the network level.
Option 1: Firewall (ufw) Allow only specific IP ranges to access port 9090 and deny public access.
Option 2: Nginx Basic Auth Place Nginx in front of the metrics port to require authentication.
Option 3: Docker Internal Network (Recommended) In Docker Compose, do not map the metrics port to the host. Instead, let Prometheus scrape the container via the internal Docker network by omitting the
ports:entry for the Yopass service.# Expose to internal network only — no host port mapping yopass: environment: METRICS_PORT: "9090" # No "ports:" entry for 9090Set file size limits
masterUse the
--max-file-sizeflag to set the maximum allowed upload size. It accepts human-readable suffixes likeKB,MB, andGB.Important: Without a valid
--license-key, file size is capped at 1 MB regardless of your configuration. A warning will be logged when this cap is applied.--max-file-size 10KB --max-file-size 512KB --max-file-size 10MB --max-file-size 1.5GBDeploy Yopass on Kubernetes
masterUse the provided Kubernetes manifest for a minimal setup. Note that you must configure TLS before using this in a production environment.
kubectl apply -f deploy/yopass-k8.yaml kubectl port-forward service/yopass 1337:1337