Skip to main content

Run a Datasette instance on a Tailscale network

Project description

datasette-tailscale

PyPI Changelog Tests License

Run a Datasette instance on a Tailscale network

[!WARNING] This is an experimental alpha plugin. The underlying library it uses (tailscale-rs) is also experimental and carries no security guarantees.

This plugin adds a datasette tailscale command that serves Datasette as its own node on your Tailscale tailnet. Datasette itself binds only to 127.0.0.1 — a userspace Tailscale node is the sole way in, so the instance is reachable only by other devices on your tailnet and never from the public internet or your local network.

It uses the tailscale-py package (Python bindings for tailscale-rs), so there's no tailscaled daemon to run and no root privileges required.

Installation

Install this plugin in the same environment as Datasette.

datasette install datasette-tailscale

Usage

Generate a Tailscale auth key (an ephemeral, reusable key is a good choice) and serve a database:

datasette tailscale mydata.db --ts-authkey tskey-auth-xxxx

You can also supply the key via the TS_AUTHKEY environment variable:

export TS_AUTHKEY=tskey-auth-xxxx
datasette tailscale mydata.db

If you omit the auth key entirely, an interactive login URL is printed on first run for you to click.

Once it connects you'll see:

Connected. Tailnet IPv4: 100.x.y.z
Serving Datasette at http://datasette (reachable only on your tailnet)

Any other device on your tailnet can now reach it at http://datasette/ (via MagicDNS) or by its tailnet IP.

Options

The command accepts all the options that datasette serve accepts — -m/--metadata, --setting, --root, --immutable, --cors, etc. — because they are inherited dynamically from datasette serve at runtime. (The --host, --port, --reload, --uds, --get, --open and --ssl-* options are suppressed, since they don't apply when serving over a tailnet.)

In addition it adds these tailscale-specific options:

  • --ts-hostname — the hostname this node registers as on your tailnet (default: datasette).
  • --ts-authkey — your Tailscale auth key (or set TS_AUTHKEY). If omitted, an interactive login URL is printed on first run.
  • --ts-state-dir — directory for persisting the tailnet node identity across restarts (default: $XDG_STATE_HOME/datasette-tailscale). A persistent state directory gives the node a stable identity; an ephemeral auth key lets the node disappear from your tailnet when the process exits.
  • --ts-port — the port to listen on over the tailnet (default: 80).

HTTPS and security notes

Traffic between tailnet devices is end-to-end encrypted by WireGuard, so this plugin serves plain HTTP over the tailnet rather than terminating TLS. The URL is http://, but the wire is still encrypted.

tailscale-rs is early-stage, experimental software with unvalidated cryptography. The plugin sets the TS_RS_EXPERIMENT=this_is_unstable_software acknowledgement on your behalf and prints a warning. Use it only on a tailnet you trust.

Development

To set up this plugin locally, first checkout the code. You can confirm it is available like this:

cd datasette-tailscale
# Confirm the plugin is visible
uv run datasette plugins

To run the tests:

uv run pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

datasette_tailscale-0.1a0.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

datasette_tailscale-0.1a0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file datasette_tailscale-0.1a0.tar.gz.

File metadata

  • Download URL: datasette_tailscale-0.1a0.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for datasette_tailscale-0.1a0.tar.gz
Algorithm Hash digest
SHA256 c4e464ad3fb9422a67294c49a8a770e9576c4b05257bcb32668a4e5f9b5fd901
MD5 36db1d01d7513e95164d692e94a97d01
BLAKE2b-256 9e2e3eb0ccd0bdb570ae50418c4960e56f4f47fe2de82c84abcced6e5f81d25d

See more details on using hashes here.

Provenance

The following attestation bundles were made for datasette_tailscale-0.1a0.tar.gz:

Publisher: publish.yml on datasette/datasette-tailscale

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file datasette_tailscale-0.1a0-py3-none-any.whl.

File metadata

File hashes

Hashes for datasette_tailscale-0.1a0-py3-none-any.whl
Algorithm Hash digest
SHA256 fe8fec202927a2c302cc0274c2aaab19f82476818d674afab4b487d0a3ebe951
MD5 a0c084a10c02420d8892f56ea0b6e4f0
BLAKE2b-256 139ff2006a31572b94818dbb227dc58977de25289931919d940493b491f233f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for datasette_tailscale-0.1a0-py3-none-any.whl:

Publisher: publish.yml on datasette/datasette-tailscale

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page