Password Protect Static Sites with PageCrypt
PageCrypt password-protects static sites without a backend by encrypting an HTML page at build time with the Web Crypto API. The page ships with a password prompt, and the encrypted content sits in a hidden <pre> element that is decrypted client-side once the correct password is entered. It encrypts only a single HTML file and supports one shared password, so CSS, JavaScript and images must be inlined (for example as data URIs) to be protected. The walkthrough runs the PageCrypt CLI in a package.json build step with the password supplied through a $PASSWORD environment variable. It also covers "magic links" that pass the password in a URI fragment, which is not sent over the network but persists in browser history.
Related posts
- SQLite Doesn't Come With Encryption. Here's What Developers Actually Use.
Turso mediumAdeptSQLite ships without encryption, and since SQLite 3.32.0 removed the undocumented SQLITE_HAS_CODEC hook in 2020, the options are SQLCipher (mature but painful across major versions, AES-256-CBC+HMAC only), the proprietary $2,000 SEE from the SQLite team, and SQLite3MultipleCiphers (community successor that can read SQLCipher formats). All of them use page-level AEAD encryption: each 4 KiB page is encrypted independently with a unique nonce, the 100-byte header stays plaintext, and the nonce and auth tag (roughly 28–48 bytes, about 1% of the page) live in SQLite's reserved page space. The cipher guidance is AES-GCM for compliance, AEGIS for speed on AES-NI hardware (not yet NIST-approved), and ChaCha20-Poly1305 for hardware without AES instructions. Teams with a working SQLCipher deployment should stay on it, while new cloud-native or multi-tenant projects needing BYOK should evaluate newer engines such as Turso.
- Front-End Web Deep Dive: Runtime Config
Heroku Engineering mediumAdeptHeroku's Front-End Web Cloud Native Buildpack provides runtime configuration for static web apps by writing PUBLIC_WEB_-prefixed environment variables into the HTML <head> as data-* attributes each time the bundled static server starts. JavaScript reads them via document.head.dataset, so values like API URLs can change between staging and production without a rebuild. Unlike the older create-react-app-buildpack, which rewrote the JS bundle, this approach is framework-agnostic and does not conflict with CSP or Subresource Integrity. Existing apps may need refactoring so config values are read at runtime rather than captured at build time.
- How we built it: incident.io Status Pages
incident.io mediumAdeptincident.io built its Status Pages product in three months on Vercel and Next.js, using Incremental Static Regeneration with per-fetch revalidate times (e.g. 30s) so the backend serves only a couple of requests per minute regardless of traffic spikes. Pages are pre-built via generateStaticParams, added on demand when created, and refreshed with stale-while-revalidate, while the client uses the SWR library with a 10s refreshInterval, revalidateOnFocus and server-rendered fallbackData for live updates. Server rendering is pinned to Vercel's Dublin region next to the API, and live-reload requests are proxied through Next rewrites. The main pain point was hydration mismatches from relative times and locale/time-zone formatting, handled with explicit luxon zones/locales and lint rules against unguarded "now".
- Bun v0.6.8
Bun mediumAdept
Bun v0.6.8 adds a built-in Bun.password API for argon2 (default) and bcrypt password hashing. It is built on Zig's std.crypto.pwhash and encodes the algorithm and parameters into PHC or Modular Crypt Format strings, so verify needs no extra metadata. bun:test gains mock(), spyOn, a jest.fn/jest.spyOn polyfill and toMatchObject, with mock creation benchmarked at roughly 80x faster than Jest. Other changes include a breaking bun:sqlite .values() change to return [] instead of null, an experimental WebSocket inspector speaking the WebKit debugger protocol, and fixes for CJS/ESM interop detection in lodash-es, the RegExp v flag and workspace lifecycle scripts.
- Supercharging Directus on Railway with a Static Frontend
Railway mediumAdeptA custom Python static site generator replaces per-request GraphQL fetching from a Directus CMS, which was slow and loaded the server, for a school newspaper site. A single GraphQL query pulls all published articles and issues. Jinja2 templates render pages into per-path index.html files and collect URLs for a sitemap. Deployment runs through GitHub Actions to GitHub Pages, and a Directus flow fires a repository_dispatch webhook so content edits trigger rebuilds. HTMX handles 'Read More' expansion by fetching the prebuilt article page and swapping in just the article element.