Nandling

Reach the database

Nothing is published on the public internet. A database joins a network you already run, and listens on TCP port 5432 there. Pick Tailscale, Headscale, or OpenVPN. The database connection itself is TCP. The quick start walks the Tailscale path from the beginning.

Tailscale

Create the key in your tailnet, then paste it into Nandling. One key enrolls every database on the account.

  • Reusable, so the next database can join.
  • Tagged tag:nandling.
  • Not ephemeral. An ephemeral node is deleted when it stops, and the address goes with it.
  • Pre-approved, so a database can come back on its own.

How Tailscale auth keys work

Headscale

Use this when the coordination server is yours. Nandling stores the server address and a provisioning key. It does not use Nandling's own coordination server, and it does not use Nandling's STUN. Those exist for Nandling's machines.

  • The server address is the Headscale URL, including https://.
  • The provisioning key is a pre-auth key from that server.
  • Reusable and not ephemeral, for the same reason as a Tailscale key.

OpenVPN

Paste a client profile for that one database. Nandling asks for TCP. The profile should not send a default route.

A profile that only listens for UDP will not come up, because the connection is made as tcp-client.

The ACL

This is the policy that lets your devices open port 5432 and does not let the database reach the rest of the tailnet. A broader allow-all rule you already have will still apply, so check that one too. Headscale uses the same shape.

{
  "tagOwners": {
    "tag:nandling": ["autogroup:admin"]
  },
  "grants": [
    {
      "src": ["autogroup:member"],
      "dst": ["tag:nandling"],
      "ip": ["tcp:5432"]
    }
  ]
}

Tailscale ACL reference

The client

Install the client that matches the network you picked, then:

psql "host=NAME port=5432 user=nandling dbname=nandling sslmode=require"

On Tailscale, turn on MagicDNS and HTTPS certificates once. That publishes the machine name so a certificate can exist for it. Nandling renews that certificate with the node's identity. It does not use a separate certificate account. Headscale does not issue a certificate, so Nandling signs one for that database and renews it. The database page can import a certificate, its private key, and its chain instead. The database page has the exact name, password, and TLS setting. require encrypts and does not check the name. verify-full also checks the name. Moving data is pg_dump into and out of this database.