Exposing your workspace securely
Make `spl serve` reachable from other machines without leaving an open server on the public internet. Covers Tailscale, a reverse proxy with TLS, browser access (CORS), and what never to do.
This page is for people running their own workspace or using the API. If you use a workspace created at syncropel.com, start with Your hosted workspace.
By default spl serve listens on 127.0.0.1, so nothing else on your network can reach it. You'll want to change that when:
- You're connecting a phone on the same home network.
- You're running another workspace that needs to sync with this one.
- You want to use the command line from a second computer.
- You're hosting a workspace for your team.
There are three safe ways, and one you should never use.
Preferred: Tailscale (or any WireGuard-based private network)
Tailscale gives each machine an address that starts with 100.. Those addresses only work between machines you've added to your Tailscale network. Nothing is open to the public internet.
Install Tailscale on the computer running the workspace and on every device that needs to reach it. Then:
# Find the host's tailnet address
tailscale ip -4
# Make the workspace listen on that address
spl stop
spl serve --host 100.x.y.zDevices on your Tailscale network reach the workspace at http://100.x.y.z:9100. Use that as the --url for spl pair.
Tailscale's access rules let you limit which devices can connect. Allowing all your own devices is fine for personal use; tighten it for shared machines.
Alternative: reverse proxy with TLS
A reverse proxy (Caddy, nginx, or Traefik) handles the secure (TLS) connection on a public hostname and passes requests on to your workspace. Use this when you need a public URL (say, https://syncropel.your-domain.com) for another workspace or a web page hosted elsewhere.
Keep the workspace listening on your own computer only:
spl serve # stays on 127.0.0.1:9100Caddy example
syncropel.your-domain.com {
reverse_proxy 127.0.0.1:9100
}Caddy handles certificate issuance via Let's Encrypt automatically.
nginx example
server {
listen 443 ssl;
server_name syncropel.your-domain.com;
ssl_certificate /etc/letsencrypt/live/syncropel.your-domain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/syncropel.your-domain.com/privkey.pem;
location / {
proxy_pass http://127.0.0.1:9100;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Server-Sent Events for /v1/sync/subscribe
proxy_buffering off;
proxy_read_timeout 3600s;
}
}Extra protection behind a proxy
Behind a proxy, every request appears to come from 127.0.0.1. Two settings protect against forged identity headers:
# strict impersonation checks have their own command:
spl config impersonation-strict-enablestrict_actor_header has no command of its own. Turn it on by writing a
strict_actor_header configuration record (a LEARN record on the
th_engine_config thread, with enabled: true). Both take effect on the next request, with no restart.
strict_actor_headerrejects requests that claim an identity in a header without a matching token.strict_impersonation_enforcementstops admin tokens from acting as any actor, unless you list the allowed actors.
Alternative: an outbound tunnel
Like a reverse proxy, but without opening a port on your firewall. The workspace stays on your computer; a tunnel program makes an outgoing connection to a tunnel service, which serves a public hostname over TLS and sends traffic back to http://127.0.0.1:9100.
Several tunnel services offer this. Follow your provider's setup, point the tunnel's ingress at http://127.0.0.1:9100, and the same protection settings apply (strict_actor_header, strict_impersonation_enforcement).
Never: the public internet without TLS
# NEVER
spl serve --host 0.0.0.0On a cloud server, --host 0.0.0.0 opens port 9100 to the whole internet. Even with sign-in on, one mistake could leak a token and expose all your records, and every bot on the internet will probe it.
If you find yourself wanting --host 0.0.0.0, use one of the three safer ways above. 0.0.0.0 is only reasonable on a computer that is itself behind a firewall, reverse proxy or tunnel, and then --host 127.0.0.1 would also work and is simpler.
CORS: letting a web page call your workspace
Your workspace's HTTP API refuses requests from web pages on other sites by default (CORS). To let a page at https://syncropel.com (or any other site) call your workspace, add that site to the allowed list:
spl config auth-set-cors-origins https://syncropel.comMultiple origins:
spl config auth-set-cors-origins https://syncropel.com,https://app.example.comThe setting takes effect immediately and is kept when you restart.
Typical setups:
syncropel.comcalling your workspace. Addhttps://syncropel.com.- A private web app calling a shared team workspace. Add the app's origin.
- A page on your own computer (rare). Add
http://localhost:<port>.
Verifying CORS
From the browser's devtools network tab, the workspace's responses should include Access-Control-Allow-Origin matching the request's Origin. If they don't, the request is from a site that is not on the allowed list, or you haven't set the list. spl config show lists current settings.
Pairing with another workspace
Once your workspace has a stable URL, another workspace can pair with it. Pairing sets up matching accounts on both sides and swaps keys. See the workspace pairing guide for the spl federation pair add <peer-url> steps and the Discovery guide for finding workspaces automatically.
Decision matrix
| Use case | Recommended path |
|---|---|
| Phone on same home Wi-Fi | Use your computer's network address, or Tailscale |
| CLI from a second personal machine | Tailscale |
Browser on syncropel.com | Keep it on your computer and add the site to the CORS list |
| Another workspace on a cloud server | Reverse proxy with TLS or an outbound tunnel |
| Workspace shared by a team | Reverse proxy with TLS on a private network |
| Single developer laptop | Keep it on your computer only |
See also
- Authentication and service accounts: scopes, token lifetimes, emergency recovery
- Workspace pairing guide: connect two workspaces so they sync both ways with
spl federation pair - Operator runbook: backups, recovery, upgrades
- Troubleshooting: when a reachable workspace can't be reached or CORS is blocking
Starting your workspace
The three ways to run `spl serve` (development, secure local, and exposed), and how to start, stop, restart, check and read the logs of your workspace.
Service accounts and tokens
Give browsers, phones, AI clients, other computers and other workspaces their own access to your workspace, each with the scopes you choose. You don't need a service account for a first run on Linux or macOS.