ScaleTag
A small local app. Security you can follow.
Ask a neighbourhood question, publish a task with a reward, or trade locally. ScaleTag combines anonymous polls, task replies, local sale listings and a location-aware list and map in an installable web app.
- Ask, offer or sellPoll, task or sale listing with photo uploads.
- Add a placeConsent to an approximate map position.
- Share & respondOpen a link, scan a QR code, vote or send offers.
- Keep it currentVoting closes in 7 days. Posts expire in 30.
Arrangements and transactions happen directly between people; ScaleTag does not process payments or escrow. Private task contact details are available through authenticated task management. New task and giveaway management passwords are stored as Argon2id verifiers.
One controlled way in. Dual domains.
Cloudflare Tunnel reaches a local Nginx ingress on OCI Host. Both risinfo.cn and www.risinfo.cn resolve securely; the origin needs no public web ports, firewall rules restrict inbound traffic, and administration uses pinned SSH keys.
- Browserrisinfo.cn & www HTTPS
- CloudflarecanetAPI Tunnel to OCI Host
- Local NginxFailover proxy (app1 preferred)
- Dual SlotsNode app1 / app2 with sharp checks
- SQLiteTransactional SQLCipher storage
Readable in use. Encrypted on disk.
SQLCipher AES-256 encryption covers the SQLite pages, including schema, poll records and photo payloads. Two application instances share the same database; transactions protect counts, offers and deduplication.
- Accepted writeValidated post, vote, offer or photo
- TransactionAtomic commit across shared storage
- SQLite cipherEncrypt database pages in memory
- Disk fileEncrypted SQLite storage on OCI Host
- Encrypted pagesRead from the disk file
- Correct keyOpen and decrypt in memory
- ApplicationBuild the permitted response
- BrowserReceive public content over HTTPS
The database engine manages page IVs and salts. Non-root containers and private file permissions add access control around the encrypted file.
Task contact encryption: from browser to browser
Task reply phone numbers and email addresses are encrypted in the sender’s browser before submission. The task creator decrypts them in their own browser using the task management password. The reply name and message remain public, so do not put contact details in public fields or images.
- 1. PublishThe creator’s browser generates a password and task key pair, then encrypts the private key.
- 2. StoreThe server receives the public key, encrypted private key and separate authentication credential.
- 3. ReplyThe sender’s browser uses the public key to encrypt phone and email before sending.
- 4. ViewThe creator enters the password; their browser unlocks the private key and decrypts the contact.
Step 1: Publishing a task
In the creator’s browser, Web Crypto generates a random 256-bit management password and a task-specific ECDH P-256 public and private key pair. The browser derives an AES-256-GCM wrapping key from the password using HKDF-SHA-256 and a random salt, then encrypts the private key with a random nonce. It separately derives an authentication credential. The server receives the task public key, encrypted private key and authentication credential, not the management password or unwrapped private key. It stores an Argon2id verifier for the credential. Save the management link and password; the password is not embedded in the link.
Step 2: Sending a reply
The reply author’s browser obtains the task public key and generates a fresh temporary ECDH P-256 key pair for that reply. It combines the task public key with the temporary private key to derive a shared secret, then uses HKDF-SHA-256 to derive an AES-256-GCM key. The browser encrypts the phone and/or email before submission. It sends the ciphertext, temporary public key and random nonce to the server. The task ID and both public keys are bound to the encryption context; changing authenticated data causes verification to fail.
Step 3: Viewing a reply
The creator enters the management password in their browser. The browser derives the separate authentication credential and sends it over HTTPS; after verifying it, the server returns the encrypted task private key and encrypted reply data. The browser uses the password to unlock the task private key, combines it with each reply’s temporary public key to derive the matching reply key, and decrypts the contact locally. The creator can then save or share the plaintext.
Authentication, storage and recovery
The authentication credential grants management access; decrypting contacts also requires the password-protected private key. SQLCipher database encryption and authenticated encrypted backups provide separate storage protection. Access to database records or storage keys alone does not reveal the browser-encrypted contacts. If the task password is lost, ScaleTag cannot reset it or recover the encrypted contacts, even from a backup. HTTPS protects the credential in transit.
Management passwords with Argon2id
Each new task and giveaway gets its own random 256-bit management password. For tasks, the browser generates the password and sends a separately derived authentication key to the server; for giveaways, the server generates and returns the password. One button copies the management address and password together. The address does not contain the password.
What ScaleTag stores
The SQLite post contains a salted Argon2id v1.3 verifier in PHC format. ScaleTag uses 19 MiB of memory, two passes and one lane. Each verifier has its own 16-byte random salt and a 32-byte derived hash. ScaleTag cannot recover the password from the verifier. Argon2id protects management credentials, while SQLCipher encrypts the database pages at rest.
How the server checks access
For tasks, the server verifies the derived authentication key; for giveaways, it verifies the password. It does so before taking the SQLite write lock and rechecks the post and its verifier inside the transaction. Each app process allows up to two Argon2 operations at a time. Public responses omit the verifier. Older management links keep working with their original SHA-256 verifiers because both app instances learned to read both formats before new passwords were enabled.
Read the hashing parameters and verification details on GitHub.
The key travels with deployment.
A random 256-bit key starts in a secure repository secret. It is delivered at runtime via root-protected configuration, keeping it out of source code and container images.
- Secret Store
SCALETAG_ENCRYPTION_KEY - Deployment jobPass key securely on standard input
- Root-owned helperValidate; save a root-only host environment file
- Runtime environmentSystemd and Docker provide the same keyNode app1Node app2
Where is the key visible?
The host environment file is root-only. The running containers receive the key as an environment variable, so host root and Docker administrators can inspect it. This deliberately simple deployment protects against file-only disclosure, not full server control.
Backups stay encrypted across three tiers.
Daily exports use AES-256-GCM with fresh IVs and authentication tags. Backups are decoupled from the host and replicated across independent environments via write-only restricted channels.
- OCI Host · 03:00AES-256-GCM export & integrity verify
- OCI Data · 04:00Write-only rrsync -wo replication
- Service VM · DailyCross-cloud offsite sync to internal storage
- Unified 90-dayIndependent lifecycle cleanup on all tiers
- Encrypted archiveSupply the original key
- AuthenticateReject wrong keys or altered ciphertext
- New staging databaseRestore in a transaction; check integrity
- Controlled swapValidate offline, then stop both instances to replace active storage
Tested with real data: the encryption migration preserved existing records. A real encrypted backup restored into an isolated database and passed integrity checks. Opening the database without a key was rejected.
Test first. Build once. Deploy the image.
ScaleTag uses its own GitHub Actions delivery pipeline. Functional and security checks run on GitHub-hosted runners before an image can be published. The chriscn.cn website itself is deployed separately through srvAuto.
- ScaleTag changeChanges enter the application repository.
- Hosted testsFunctional, browser, security, container and HA checks must pass.
- Build and publishA GitHub-hosted runner builds and uploads the container tagged with its commit.
- Server runnerThe target server's self-hosted runner pulls the published image.
- Rolling deployBack up, update app2 then app1, and verify readiness.
Know the protection boundary.
Files obtained without the key
The database and backups stay encrypted across Host, Data and Service nodes. Wrong keys cannot open the database; backup authentication detects altered ciphertext.
Control of the running server
Privileged administrators can reach the runtime key and plaintext in memory. Public posts, reply names and messages remain public; task reply phone numbers and email addresses are encrypted in the browser before submission.
Active posts expire after 30 days; backups have their own 90-day window on all three tiers. Browser cookies are not identities. File deletion is not forensic erasure, and provider snapshots require a separate policy.