A web-based password manager with zero-knowledge architecture. All cryptography happens client-side in the browser using OpenPGP.js. The server stores only encrypted blobs β it never sees plaintext passwords or private keys.
- Client-side encryption β PGP encryption/decryption in the browser with OpenPGP.js
- Zero-knowledge architecture β Server never sees plaintext passwords or private keys
- Multi-user support β Each user identified by their PGP key fingerprint
- Two-factor authentication β Optional TOTP (2FA) for server access
- Import/Export β Compatible with standard
.password-storedirectory format (pass CLI compatible) - Password generator β Configurable random password generation
- Session management β 5-minute JWT sessions with automatic expiry
- Git sync β Backup and sync encrypted entries to any Git repository (GitHub, GitLab, Gitea)
- TOTP codes β Store and generate TOTP codes using
otpauth://URI format (pass-otp compatible) - Theme toggle β Auto-switching light/dark themes based on time of day (8AM-10PM)
- Account management β Clear local data or permanently delete account with passphrase confirmation
- Entry signing (optional) β sign entries with your PGP key so tampering by the server or the Git remote is detected; optional strict mode refuses unsigned entries
- Argon2id key protection (optional) β stronger at-rest protection for the private key
- Auto-hide sensitive content β Password and notes auto-hide after 15 seconds with countdown timer
- PGP key auto-lock β Decrypted PGP key auto-locks after 30s of inactivity
- Rate limiting β Sliding window rate limiting on authentication endpoints (5 attempts / 15 min default)
- Registration protection β TOTP-based registration codes to prevent unauthorized account creation
βββββββββββββββββββββββββββββββββββββββ
β Browser (SPA) β
β + OpenPGP.js + IndexedDB β
β + PGP encrypt/decrypt β
β + TOTP code generation β
ββββββββββββββββββββββββββββββββββββββ
β HTTPS + CORS + JWT
ββββββββββββββββΌβββββββββββββββββββββββ
β Go API Server (SQLite backend) β
β + JWT Auth + bcrypt + TOTP β
β + Rate limiting β
β + Git sync (go-git) β
βββββββββββββββββββββββββββββββββββββββ
β HTTPS (PAT) / SSH (key)
ββββββββββββββββΌβββββββββββββββββββββββ
β Remote Git Repo (optional) β
β βββ *.gpg (encrypted blobs) β
βββββββββββββββββββββββββββββββββββββββ
| Layer | Technology |
|---|---|
| Frontend | TypeScript + Preact + Vite |
| Crypto | OpenPGP.js + Web Crypto API (PBKDF2) |
| Backend | Go 1.26 + SQLite (pure-Go, no CGO) |
| Git | go-git (pure Go, no Git CLI needed) |
| Auth | bcrypt + JWT (5-min) + TOTP (2FA) |
| Testing | Playwright (88 E2E tests) + Vitest |
| Deploy | Single binary (embedded SPA) / Docker |
- Go 1.26+
- Node.js 24+
- npm
- Docker (for container deployment)
The frontend is embedded into the Go binary, so a single build produces one self-contained executable that serves both the API and the SPA.
# 1. Build the frontend (output goes to frontend/dist)
cd frontend && npm run build && cd ..
# 2. Build the single binary (embeds frontend/dist)
go build -o webpass-server ./cmd/srvThe Go build still compiles if
frontend/distonly contains the committed placeholder, but the resulting binary serves no UI. To serve assets from disk instead of embedding them (e.g. local dev with live edits), setSTATIC_DIR.
# Set environment variables
export JWT_SECRET=$(openssl rand -hex 32)
export DB_PATH=./db.sqlite3
# Run server (development)
go run ./cmd/srv
# Or run the compiled binary
./webpass-serverServer listens on :8080 by default.
The web UI normally creates the account because it generates the OpenPGP
keypair in the browser. For headless setups, scripts/create-account.sh can
register an account with your existing key or generate a new one:
# Use an existing key from the local GnuPG keyring
./scripts/create-account.sh --url https://webpass.example.com \
--gpg-key you@example.com --pgp-passphrase 'key-passphrase'
# Use an existing private key file
./scripts/create-account.sh --url https://webpass.example.com \
--private-key ~/my-key.private.asc
# Generate a new keypair
./scripts/create-account.sh --url https://webpass.example.comThe script writes the armored public/private keys next to the current directory
(or --out-dir). Import the private key into the web UI (Setup β Import key)
to use the same account there. Keep the private key and its passphrase backed
up: without them the encrypted vault cannot be recovered. Run
./scripts/create-account.sh --help for all options (bash, curl,
gpg >= 2.2, jq).
WebPass entry content is pass-compatible. If the account uses the same key
as your pass store, import the encrypted entries directly:
./scripts/import-passstore.sh --url https://webpass.example.com \
--fingerprint <PGP-FPR> --store ~/.password-storeThe script verifies that the store's recipients match the account key and
uploads the .gpg files through POST /api/{fingerprint}/import. It supports
--totp CODE / --recovery-code CODE when 2FA is enabled and --dry-run to
preview the paths.
If the account key differs from the store key, use the web UI import (Settings β Import), which decrypts and re-encrypts each entry with the account key. Create the archive with:
tar -czf passstore.tar.gz -C ~/.password-store .Open Settings β PGP Key Management β Change PGP Passphrase. The client decrypts the private key with the current passphrase and re-encrypts it with the new one; the key, fingerprint, public key and all entries stay the same, and the server is not involved.
- The login password is separate and is not changed.
- Other devices and previously exported
.ascbackups still use the old passphrase. Re-export the private key and update them, or use device transfer. - Cancel any active device transfer first.
- The key is locked after the change; unlock it again with the new passphrase.
- Optional Argon2id: tick Protect the key with Argon2id to use the RFC 9580
Argon2id string-to-key instead of iterated-and-salted S2K. It is far more
expensive to brute-force offline (matters for exported
.ascbackups and your browser's IndexedDB). Trade-off: exported private keys need GnuPG 2.5+ (or another RFC 9580 tool) to be imported, and unlocking needs WebAssembly (the CSP allows'wasm-unsafe-eval'for this). Untick it and change the passphrase again to go back; entries and the fingerprint never change.
Entries are encrypted to your public key, which the server and a Git remote also have, so an attacker who controls either could swap in a different entry and WebPass could not tell. With Settings β Entry Signing β Sign new and edited entries, each saved entry is signed with your private key (sign-then-encrypt) and the signature is verified whenever an entry is opened.
- Opt-in and per device; nothing changes until you enable it. Saving a signed entry (new or edited) needs your PGP passphrase when the key is locked.
- A signature that is present but invalid blocks the entry ("Signature check failedβ¦"), whether or not signing is enabled.
- With signing enabled, entries without a signature (created earlier, imported, or changed outside WebPass) show a warning. Sign all entries signs every entry that is not signed yet; entries that fail to decrypt or verify are skipped and listed. Signing all needs your PGP passphrase when the key is locked.
- Strict: block unsigned entries (per device, off by default) refuses to open or edit an entry without a signature, so an attacker cannot downgrade a signed entry to an unsigned copy. Turning it on needs signing enabled and your PGP passphrase (the check decrypts every entry); it is refused while any entry is still unsigned, and the message lists them. Turning signing off also turns strict mode off. "Sign all entries" still works in strict mode.
- Strict mode is only as strong as the device it is set on: it is stored with the account in this browser's IndexedDB and is not synced to other devices.
- Signed entries remain normal OpenPGP messages:
gpg/passcan still decrypt them (andgpgwill verify the signature).
- On the old device open Settings β Device Transfer, enter a temporary pairing code twice and press Create 15-minute link.
- On the new device scan the QR code or open the displayed link, log in, and enter the same pairing code. The client downloads the ciphertext (the link's one-time token is required) and verifies the pairing code locally; it then sends a pairing-code proof.
- The old device shows the requesting device's IP and User-Agent and only enables Approve after verifying the proof locally. Press Approve (or Deny).
- The encrypted private key is imported. You will be asked for your PGP passphrase only when you unlock an entry on the new device.
Protocol v2 uses three secrets, none of which the server ever sees:
- the pairing code you choose (typed on both devices);
- a random link secret carried in the link's URL fragment (
#/transfer?β¦&k=β¦; browsers never send fragments to servers). It is mixed into the key derivation, so the pairing code cannot be brute-forced offline from the ciphertext the server holds; - an approval secret that stays in the old device's tab. Only its SHA-256 is uploaded, and approve/deny must present it, so another logged-in session cannot approve a pending request.
The already passphrase-protected private key is wrapped with PBKDF2-SHA256 (600k) β HKDF-SHA256 into separate AES-256-GCM and HMAC keys. The server keeps the ciphertext in memory only for 15 minutes (single-use, fingerprint-bound); it is never written to disk and a server restart invalidates active transfers. Treat the link as sensitive: it contains the one-time token and the link secret.
Compatibility: v2 is not compatible with v1 links/envelopes. Update both the server and every client (including a Cloudflare Pages frontend), then create a new link.
# Build image
docker build -t webpass:latest .
# Run container
docker run -d \
--name webpass \
-p 127.0.0.1:8080:8080 \
-v webpass-data:/data \
-e JWT_SECRET="$(openssl rand -hex 32)" \
--read-only \
--security-opt no-new-privileges:true \
webpass:latest# Configure environment
cp .env.example .env
# Edit .env and set JWT_SECRET
# Start
docker compose up -dThe compose file publishes the port on 127.0.0.1 only: put a TLS reverse
proxy in front of it and set TRUSTED_PROXIES to the proxy's address. For a
quick LAN test set BIND_ADDRESS=0.0.0.0 (and optionally HOST_PORT) in .env
β the app itself speaks plain HTTP, so do not expose it that way on the
internet.
frontend/public/_headers is copied into the build and gives a Pages
deployment the same CSP and security headers as the Go server (the only
difference is connect-src, which allows https: because the server URL is
chosen at runtime). Build with npm run build (never with VITE_E2E, see
Testing).
WebPass cross-compiles to a static openbsd/amd64 (or arm64) binary with all
dependencies (pure-Go SQLite, go-git, embedded SPA) β no CGO, no runtime deps.
CGO_ENABLED=0 GOOS=openbsd GOARCH=amd64 \
go build -ldflags="-s -w" -o webpass-server ./cmd/srvSee DEPLOY-OPENBSD.md for the rc.d service, dedicated
user setup, and filesystem paths.
Migrations are applied automatically on startup via embedded SQL files in db/migrations/.
They are numbered (NNN-name.sql) and tracked in a migrations table β each runs exactly once.
Forward upgrade β
β Fully supported. All migrations only add columns/tables,
never remove or rename. Upgrading from older versions (e.g. v0.4.6) to latest is safe.
Rollback β β Not supported. Because sqlc generates SELECT * queries, the old
binary will fail to scan rows if new columns were added. To downgrade, restore both
the binary and the database from backup.
Server and frontend are upgraded together (the embedded SPA always matches the binary; keep a separate Cloudflare Pages frontend on the same release). Data, accounts, entries, passwords, 2FA and Git sync configuration are untouched, and there is no new database migration. Things to check:
| Change | Who is affected | What to do |
|---|---|---|
| Device transfer protocol v2 | Active transfers / old links | Create a new link; v1 links are rejected (they only live 15 minutes anyway) |
X-Forwarded-Proto only trusted from TRUSTED_PROXIES |
REQUIRE_HTTPS or cookie-auth behind a proxy without TRUSTED_PROXIES |
Set TRUSTED_PROXIES to the proxy address (a startup warning tells you) |
docker-compose.yml binds 127.0.0.1 |
Direct LAN access to the published port | Use a reverse proxy, or set BIND_ADDRESS=0.0.0.0 |
| Git clones are shallow and size-limited | Remotes larger than 512 MiB | Raise GIT_MAX_REPO_MB |
| Push/pull budget (20 / 10 min / account) | Scripted sync | Raise GIT_SYNC_RATE_LIMIT |
| Audit log pruning (90 days / 5000 rows per account) | Anyone keeping older audit rows | Raise AUDIT_RETENTION_DAYS / AUDIT_MAX_ROWS_PER_ACCOUNT |
| Registration code lock-out | Many failed guesses (30/hour, all clients) | Wait, or raise REGISTRATION_MAX_FAILURES |
| Entry signing, strict signing, Argon2id | Nobody unless enabled | Opt-in under Settings |
Rollback to v0.10.x needs no database restore for this release, but v2 transfers and signed entries created meanwhile are not understood by the old client (signed entries still decrypt with it; the signature is just ignored). A key switched to Argon2id cannot be unlocked by the old client (its CSP blocks WebAssembly): switch it back to iterated S2K before rolling back.
The container runs with:
- Non-root user (UID/GID 8080)
- Read-only filesystem (
--read-only) - No privilege escalation (
--security-opt no-new-privileges:true) - Writable path only
/data(SQLite + git repos)
# Backend tests
go test ./...
# Frontend unit tests
cd frontend && npm test88 browser-based integration tests across 5 phases:
# Run comprehensive test suite
./frontend/playwright-e2e-test.sh
# Or use npx directly
cd frontend && npx playwright test
# Run with interactive UI
npx playwright test --ui
# Run with visible browser
npx playwright test --headed
# View HTML report
npx playwright show-reportTest Coverage:
- Phase 1: Rate limit tests (3 tests)
- Phase 2: All other tests in Protected mode (69 tests)
- Phase 3: Registration tests in Open mode (6 tests)
- Phase 4: Registration tests in Protected mode (8 tests)
- Phase 5: Registration tests in Disabled mode (2 tests)
A few specs reach into the app through window.__webpass. That hook only
exists in builds made with VITE_E2E=true, which playwright-e2e-test.sh and
the Integration Tests workflow set. Release, Docker and Cloudflare Pages
builds never set it, and CI fails if __webpass appears in the production
bundle. When running npx playwright test by hand, build first with
cd frontend && VITE_E2E=true npm run build.
./playwright-e2e-test.sh creates a temporary local bare repository
(file:///tmp/webpass-git-sync-test.git) automatically, so git-sync tests run
without an external server or PAT. CI uses the same approach.
To run against a real remote instead, override the defaults:
export WEBPASS_REPO_URL="https://gitea.example.com/user/password-store.git"
export WEBPASS_REPO_PAT="your-personal-access-token"If the configured remote is unreachable or returns 5xx, git-sync tests are skipped rather than failing the whole suite.
All endpoints require JWT authentication except where noted.
| Method | Path | Auth | Description |
|---|---|---|---|
| POST | /api |
No | Create user (first-time setup) |
| GET | /api/{fingerprint} |
JWT | Get user info |
| POST | /api/{fingerprint}/login |
No | Login β returns JWT or 2FA challenge |
| POST | /api/{fingerprint}/login/2fa |
No | Complete 2FA login |
| POST | /api/{fingerprint}/login/recovery |
No | Login with a one-time 2FA recovery code |
| DELETE | /api/{fingerprint}/account |
JWT | Delete account permanently |
| POST | /api/{fingerprint}/password |
JWT | Change password (revokes other sessions) |
| POST | /api/{fingerprint}/sessions/revoke |
JWT | Revoke all sessions (log out everywhere) |
| GET | /api/{fingerprint}/audit |
JWT | Recent security events for the account |
| Method | Path | Auth | Description |
|---|---|---|---|
| POST | /api/{fingerprint}/key-transfer |
JWT | Create a 15-minute transfer (envelope, approval_hash) |
| POST | /api/{fingerprint}/key-transfer/envelope |
JWT | Fetch ciphertext (body: one-time link token) |
| POST | /api/{fingerprint}/key-transfer/request |
JWT | Send the pairing-code proof and request approval |
| POST | /api/{fingerprint}/key-transfer/approve |
JWT | Approve the requesting device (approval_secret) |
| POST | /api/{fingerprint}/key-transfer/deny |
JWT | Deny the requesting device (approval_secret) |
| POST | /api/{fingerprint}/key-transfer/redeem |
JWT | Redeem after approval (single-use) |
| DELETE | /api/{fingerprint}/key-transfer |
JWT | Revoke the active transfer |
| GET | /api/{fingerprint}/key-transfer/status |
JWT | Status, requesting IP/User-Agent and proof |
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /api/registration/mode |
No | Get registration mode (open/protected/disabled) |
| POST | /api/registration/validate |
No | Validate registration TOTP code |
| Method | Path | Auth | Description |
|---|---|---|---|
| POST | /api/{fingerprint}/totp/setup |
JWT | Begin TOTP 2FA setup |
| POST | /api/{fingerprint}/totp/confirm |
JWT | Confirm TOTP 2FA setup |
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /api/{fingerprint}/entries |
JWT | List all entry paths |
| GET | /api/{fingerprint}/entries/* |
JWT | Download encrypted blob |
| PUT | /api/{fingerprint}/entries/* |
JWT | Upload encrypted blob |
| DELETE | /api/{fingerprint}/entries/* |
JWT | Delete entry |
| POST | /api/{fingerprint}/entries/move |
JWT | Rename/move entry |
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /api/{fingerprint}/export |
JWT | Export all entries as .tar.gz |
| POST | /api/{fingerprint}/import |
JWT | Import password store (JSON or .tar.gz) |
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /api/{fingerprint}/git/status |
JWT | Get git sync status |
| GET | /api/{fingerprint}/git/config |
JWT | Get git configuration |
| POST | /api/{fingerprint}/git/config |
JWT | Configure git sync |
| POST | /api/{fingerprint}/git/push |
JWT | Manual push to remote (token in request body) |
| POST | /api/{fingerprint}/git/pull |
JWT | Manual pull from remote (token in request body) |
| GET | /api/{fingerprint}/git/log |
JWT | Get sync operation history (last 50) |
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /api/health |
No | Health check |
| GET | /api/version |
No | Get server version |
- Private keys never leave the browser β Stored AES-wrapped in IndexedDB
- Server stores only PGP-encrypted blobs β Database leak reveals nothing
- Password validates locally first β Wrong password fails before network call
- 5-minute sessions β JWT expiry enforced server-side
- PGP key auto-lock β Private key automatically locked after
PGP_KEY_TIMEOUT_SECONDSseconds of inactivity (default 30;0disables caching entirely); the decrypted key is only kept in memory - CORS deny-by-default β cross-origin access only for origins listed in
CORS_ORIGINS - Request limits β 8 MiB body cap, bounded imports, and HTTP server timeouts
- Git remote validation β blocks
file://and private/loopback targets unless explicitly opted in (GIT_ALLOW_*) - Session revocation β password/2FA changes bump a session version;
POST /api/{fp}/sessions/revokelogs out everywhere - Security audit log β login/2FA/password/session/git events with IP and user agent (
GET /api/{fp}/audit); account deletion purges prior entries - 2FA recovery codes β 10 one-time codes generated when 2FA is enabled; hashes stored, reusable codes consumed atomically
- Passkeys / WebAuthn β Face ID, Touch ID and security keys as a second factor; password is still required first, TOTP and recovery codes remain as fallback
- PGP passphrase rotation β client-side re-wrap of the same key; fingerprint/entries/server unchanged; other devices and exported backups must be updated
- Encrypted device transfer (v2) β pairing code + random link secret (URL fragment) derive the keys client-side (PBKDF2 β HKDF); the ciphertext is held in server memory only for 15 minutes (never written to disk) and is only released to the holder of the one-time link token; single-use link/QR; the target device proves the code with an HMAC proof; approve/deny need a secret only the source device holds; the source device shows the requesting IP/User-Agent before enabling Approve; the server never sees the pairing code, link secret or PGP passphrase
- Optional entry signing β OpenPGP signatures (sign-then-encrypt) let the client detect entries forged or swapped by the server or Git remote; an invalid signature blocks the entry; optional strict mode also blocks unsigned entries (downgrade protection, per device)
- Trusted proxy model β
X-Forwarded-For/X-Real-IPandX-Forwarded-Protoare honoured only fromTRUSTED_PROXIES;REQUIRE_HTTPSwithout it logs a warning - Bounded growth β audit log retention/pruning (
AUDIT_RETENTION_DAYS,AUDIT_MAX_ROWS_PER_ACCOUNT), shallow size-limited git clones (GIT_MAX_REPO_MB), per-account push/pull budget (GIT_SYNC_RATE_LIMIT) - Registration code lock-out β a global failed-guess budget (
REGISTRATION_MAX_FAILURES/hour) stops distributed enumeration of the 6-digit code - No test hooks in production β
window.__webpassonly exists inVITE_E2Ebuilds; CI fails if it appears in the production bundle - TOTP secrets encrypted at rest β AES-256-GCM via
DATA_ENCRYPTION_KEY(or an auto-generated key file), with atomic replay protection and a 16-byte minimum secret - Password policy β minimum 12 characters, max 72 bytes (bcrypt limit), enforced server-side
- Local key derivation β PBKDF2-HMAC-SHA256 with 600k iterations; legacy 100k records are transparently upgraded on login
- Security headers β HSTS on HTTPS,
Cache-Control: no-storefor API responses, COOP/CORP, strict CSP - All traffic over HTTPS required in production
- Rate limiting on authentication endpoints (sliding window, 5 attempts / 15 min default)
- Registration protection with TOTP-based codes (optional, configurable)
- JWT_SECRET: rotating it invalidates every existing session immediately (users re-login). Generate a new value with
openssl rand -hex 32. - DATA_ENCRYPTION_KEY: encrypts TOTP secrets at rest. Rotating it requires re-encrypting existing
totp_secretvalues; there is no automatic rotation tool yet, so back up the key file (data_encryption.key) with the database. - PGP keys: users can export their private key from Settings and re-import it on a new account if needed.
Please do not open public issues for security vulnerabilities.
- Email: Send details to the maintainers privately
- GitHub: Use private vulnerability reporting
Response Timeline:
- Acknowledgment: Within 48 hours
- Initial Assessment: Within 1 week
- Fix Timeline: Depends on severity (Critical: 24-72h, High: 1-2 weeks, Medium: 2-4 weeks)
See .env.example for all available options with detailed comments.
| Variable | Required | Description |
|---|---|---|
JWT_SECRET |
Yes | At least 32 random bytes for JWT signing (openssl rand -hex 32); placeholders rejected |
DB_PATH |
No | Path to SQLite database (default: /data/db/db.sqlite3) |
STATIC_DIR |
No | Serve frontend from this dir instead of embedded assets (dev only) |
CORS_ORIGINS |
No | Comma-separated allowed origins (unset = same-origin only) |
TRUSTED_PROXIES |
No | Proxy IPs/CIDRs allowed to supply X-Forwarded-For / X-Real-IP / X-Forwarded-Proto |
MAX_REQUEST_BODY_BYTES |
No | Max request body size (default: 8 MiB) |
GIT_ALLOW_PRIVATE_NETWORKS |
No | Allow git sync to private/LAN remotes (default: false) |
GIT_ALLOWED_HOSTS |
No | Comma-separated git host allowlist (subdomains included) |
GIT_MAX_REPO_MB |
No | Max size of a cloned remote in MiB (default: 512, range 16-8192; clones are also capped at 100,000 files) |
GIT_SYNC_RATE_LIMIT |
No | Push/pull operations per account per 10 minutes (default: 20, range 1-1000) |
AUDIT_RETENTION_DAYS |
No | Keep audit rows this long (default: 90, range 1-3650) |
AUDIT_MAX_ROWS_PER_ACCOUNT |
No | Newest audit rows kept per account (default: 5000, range 100-1000000) |
REQUIRE_HTTPS |
No | Reject plain-HTTP API calls and redirect pages to HTTPS (localhost exempt) |
OPENBSD_PLEDGE_PROMISES |
No | OpenBSD only: override pledge promises (default stdio rpath wpath cpath inet dns unix flock fattr) |
OPENBSD_UNVEIL_EXTRA_PATHS |
No | OpenBSD only: extra unveil paths (path[:rwc], comma-separated) |
DISABLE_SANDBOX |
No | OpenBSD only: disable unveil/pledge (debug only) |
WEBAUTHN_RP_ID |
No | Enable passkeys; relying-party ID (registrable domain, no scheme/port) |
WEBAUTHN_RP_NAME |
No | Passkey display name (default: WebPass) |
WEBAUTHN_RP_ORIGINS |
No | Comma-separated allowed origins (default: https://<RP_ID>) |
DATA_ENCRYPTION_KEY |
No | Encrypts TOTP secrets at rest; auto-generated key file if unset |
PORT |
No | HTTP listen port (default: 8080) |
GIT_REPO_ROOT |
No | Git repos directory (default: /data/git-repos) |
SESSION_HARDLIMIT_MINUTES |
No | JWT hard limit (max session time) in minutes (default: 30, range: 5-480) |
SESSION_SOFTLIMIT_MINUTES |
No | JWT soft limit (browser close detection) in minutes (default: 5, range: 1-60) |
PGP_KEY_TIMEOUT_SECONDS |
No | Browser PGP key auto-lock after inactivity in seconds (default: 30; 0 disables caching, otherwise range 5-3600) |
DISABLE_FRONTEND |
No | Disable frontend (1 or true) |
BCRYPT_COST |
No | Password hashing cost factor (default: 12, range: 10-15) |
RATE_LIMIT_ATTEMPTS |
No | Max requests per window (default: 5) |
RATE_LIMIT_WINDOW_MINUTES |
No | Time window in minutes (default: 15) |
| Variable | Default | Description |
|---|---|---|
REGISTRATION_ENABLED |
false |
Enable registration (1 or true) |
REGISTRATION_TOTP_SECRET |
(empty) | Base32 TOTP secret (required for protected mode) |
REGISTRATION_TOTP_PERIOD |
3600 |
Code validity period in seconds (15-86400) |
REGISTRATION_TOTP_ALGO |
SHA1 |
Hash algorithm (SHA1/SHA256/SHA512) |
REGISTRATION_CODE_FILE |
/data/registration_code.txt |
Path to write current code |
REGISTRATION_MAX_FAILURES |
30 |
Failed code guesses allowed per hour across all clients before registration answers 429 (1-1000) |
Registration Modes:
REGISTRATION_ENABLED |
REGISTRATION_TOTP_SECRET |
Mode |
|---|---|---|
false |
(any) | Disabled β No registration allowed |
true |
(not set) | Open β No code required |
true |
(set) | Protected β 6-digit TOTP code required |
One-way overwrite sync with fresh clone/export:
- Pull: Remote β Local (clone remote, replace local DB)
- Push: Local β Remote (export local DB, force-push to remote)
- No merge conflicts β Last write wins
- Fresh operations β Local git repo is temporary, cleaned before/after each operation
- Bounded β clones are shallow (
depth 1, single branch, no tags), cancelled once they exceedGIT_MAX_REPO_MB/ 100,000 files, and push/pull share a per-account budget (GIT_SYNC_RATE_LIMIT); the remote's history is still extended, never rewritten, by a push - Per-user configuration β Each user has their own repo URL
- Two authentication methods:
- HTTPS β PGP-encrypted Personal Access Token
- SSH β PGP-encrypted SSH private key with TOFU host key verification
repo-root/
βββ .git/
βββ email.gpg
βββ work/
β βββ database.gpg
βββ social/
βββ twitter.gpg
- All files are
.gpgencrypted blobs (client-side PGP encryption) - Files at repo root (no
.password-store/subdirectory) - Compatible with standard
passCLI after cloning
Default branch auto-detection (branch = "HEAD"):
- Read remote HEAD symbolic reference
- If HEAD not found β try
main - If
mainnot found β trymaster
Entries can store a TOTP secret alongside their password using the standard
pass-otp otpauth:// URI format.
When creating or editing an entry, fill in the 2FA / TOTP (optional) field:
otpauth://totp/AWS:user@aws.com?secret=JBSWY3DP&issuer=AWS
After unlocking the entry, WebPass displays the live code:
- The URI is stored as a line in the entry content and PGP-encrypted with the password β the server only ever sees ciphertext.
- After unlocking/decrypting the entry, WebPass shows a live 6-digit code with a countdown and copy button.
- Compatible with
pass otp, Google Authenticator exports, import/export, and Git sync. No database schema change is required. - Only TOTP is supported (not HOTP). Invalid URIs show a validation hint.
- Existing entries that already have an
otpauth://line in Notes are detected automatically; the URI moves into the dedicated field when the entry is edited.
Auto-switching theme system with manual override:
| Theme | Description |
|---|---|
| Ocean | Dark blue professional theme (default for night) |
| Daylight | Clean white/blue light theme (default for day) |
Auto mode (default):
- 8:00 AM - 10:00 PM β Daylight theme
- 10:00 PM - 8:00 AM β Ocean theme
Manual override: Click theme toggle button to cycle: π Auto β π Ocean β βοΈ Daylight β Auto
Preference saved to localStorage and persists across sessions.
.
βββ .github/workflows/ # CI/CD pipelines
βββ cmd/srv/ # Main binary entrypoint
ββ srv/ # HTTP server + handlers
βββ db/ # Database migrations + sqlc queries
βββ frontend/ # Preact + TypeScript SPA
β βββ src/
β βββ index.html
β βββ package.json
ββ Dockerfile
βββ docker-compose.yml
βββ .github/ # GitHub Actions workflows
Contributions are welcome! Please read CONTRIBUTING.md for guidelines and AGENTS.md for the development guide.
# Clone repository
git clone https://github.com/johnwmail/webpass.git
cd webpass
# Backend
go mod download
go test ./...
# Frontend
cd frontend
npm install
npm run dev- Backend:
go test ./...must pass - Frontend unit:
npm testmust pass - E2E tests:
./frontend/playwright-e2e-test.shmust pass (81 tests) - Type check:
npm run typecheckmust pass
Go:
- Follow Effective Go
- Use
gofmtorgoimports - Add tests for new packages
TypeScript:
- Use TypeScript for all new code
- Follow existing code style
- Add types for function signatures
General:
- Write self-documenting code
- Keep PRs under 400 lines when possible
- Update tests with code changes
Never commit:
- Passwords or secrets
- API keys or tokens
- Private encryption keys
- Production database files
MIT License β see LICENSE for details.
- Inspired by pass
- Built with OpenPGP.js
- Backend powered by Go and SQLite
- Git operations via go-git

