postguard-website
GitHub · SvelteKit · Web Application
The PostGuard web frontend for encrypting and sending files. Users pick files, choose recipients by email address, authenticate with Yivi, and the files are encrypted and uploaded to Cryptify for delivery. Built with SvelteKit using the static adapter.
Integration
The website uses @e4a/pg-js with two Vite plugins for WASM support (vite-plugin-wasm and vite-plugin-top-level-await). It also uses @e4a/pg-components for shared UI elements like file pickers and Yivi authentication dialogs.
The website contains two submodules: Cryptify (the file sharing backend, embedded in an iframe) and the Thunderbird addon (the .xpi file can be downloaded from the website). To update the submodules:
git submodule update --init --recursiveFor a step-by-step example of building a web application with PostGuard, see the pg-sveltekit example, which follows the same patterns as this website.
Development
Quick Start with Docker Compose (recommended)
Docker Compose sets up everything: the PostGuard website, Cryptify file share server, IRMA server, PKG server, and a Mailcrab mail testing UI.
# Initialize submodules (Cryptify, etc.)
git submodule update --init --recursive
# Start all services with hot reload
docker-compose up
# Website: http://localhost:8080
# Mail UI: http://localhost:1080Your code changes reload automatically since the source is mounted as a volume.
Production Environment
docker-compose -f docker-compose.prod.yml up
# Access at http://localhostStopping Services
# Development
docker-compose down
# Production
docker-compose -f docker-compose.prod.yml downBuilding
Building is done automatically through GitHub Actions. You can also build manually:
docker-compose build # Build via Docker
npm run build # Build only the PostGuard websiteManual (without Docker)
npm install
npm run dev # dev server
npm run build # build SPA
npm run preview # preview production buildTesting
npm run check # Svelte type checking
npm run lint # Prettier + ESLint
npm run format # auto-format
npm run test # Playwright testsMobile Debugging
To test on a physical Android device, connect the phone with USB debugging enabled and make sure Yivi is in developer mode:
adb reverse tcp:8088 tcp:8088 # Yivi / IRMA server (for scanning QR codes)
adb reverse tcp:8080 tcp:8080 # PostGuard websiteEnvironment Variables
| Variable | Default | Description |
|---|---|---|
VITE_FILEHOST_URL | http://localhost:8000 | Cryptify file hosting service URL |
VITE_PKG_URL | http://localhost:8087 | PKG service URL |
VITE_MAX_UPLOAD_SIZE | — | Maximum file upload size in bytes |
VITE_UPLOAD_CHUNK_SIZE | — | Upload chunk size in bytes |
VITE_FILEREAD_CHUNK_SIZE | — | File read chunk size in bytes |
Releasing
This repository uses Release-please for automated versioning. Merging a release PR triggers a multi-architecture Docker image build pushed to GHCR.
CI/CD
| Workflow | Trigger | What it does |
|---|---|---|
ci.yml | Push/PR | Svelte type checks, release-please, multi-arch Docker build |
pr-title.yml | PR | Validates PR title format |