Skip to content

Instantly share code, notes, and snippets.

View theprojectsomething's full-sized avatar

theprojectsomething

View GitHub Profile
@theprojectsomething
theprojectsomething / An Ubuntu WiFi Secure Captive Portal.md
Last active June 21, 2026 09:49
Guide: An Ubuntu WiFi Secure Captive Portal: Network Manager / DNSMasq / HA Proxy / Let's Encrypt

An Ubuntu WiFi Secure Captive Portal

Improvements, suggestions & fixes are welcome!

Captive portals can be a pain. Here's an opinionated and no-doubt entirely imperfect guide to setting one up for a WiFi access point on Ubuntu (tested on 20+), utilising Network Manager, DNSMasq, HA Proxy and (optionally) Let's Encrypt for a secure, locally hosted landing page.

_Note: This setup was originally designed for an offline WLAN, providing access to a small number of locally hosted domains ... think the WiFi media portal on a flight or boat. If you are looking to provide internet access behind a captive portal then this guide won't get you all the way there. That said, many routers have this capability built in, as do any number of open source router firmware solutions. So you probably don't need to roll your own. If you'd like to try anyway, Ha Proxy Stick Tables would probably come in handy. Very happy to update the guide with any p

@theprojectsomething
theprojectsomething / Passphrase-Encryption-for-the-Web.md
Last active September 6, 2022 06:24
Simple Passphrase-based Encryption Example for the Web

Simple Passphrase-based Encryption Example for the Web

A straightforward form of encryption using a passphrase (or a shared secret) that can be useful in web-based environments - especially in storage and transport. Consider e.g. securing sensitive user data in localStorage, or sending data via a third-party server (such as a serverless endpoint).

This method uses a passphrase to encrypt and decrypt any string, number, array, or other JSON-compatible object using AES in GCM mode and is ideal for cases where one party is both encrypting and decrypting. For cases where you are sending encrypted data to other parties you might consider alternative methods, such as public-key cryptography. For a comprehensive rundown of encryption me

@theprojectsomething
theprojectsomething / Cloudflare Wrangler Pretty Console.js
Last active October 21, 2022 13:42
Cloudflare Wrangler Pretty Console
/***
* Cloudflare Wrangler Pretty Console 🌈
* ===
*
* Console.log with rainbow-like ease, with allowances for circular references,
* maps, sets and proxies ... none of which log very well otherwise.
*
* - use console.log and console.error, knowing it will be prettier (than nothing)
* - adds a nice little timestamp and reference to the calling function
* - designed specifically for @cloudflare/wrangler but will probably work with node too