Skip to content

Self-hosting and security

The hub's public entrance

Open one narrow public entrance on your own hub for visitor links, webhook triggers, and your own devices away from home, through Tailscale Funnel or a front you run, with no service run by Octant.

  • 18 min read
  • 10 sections

The hub's public entrance ​

Your hub can open one narrow door to the internet. Through it, someone with no Octant and no tailnet can follow a thread you share. An outside service such as GitHub can start a routine, and your own paired devices can reach your computers away from home. Octant runs no service for any of it: the door is on your hub, and you choose what sits in front of it.

Not in a release yet

The entrance, visitor links, webhook triggers, failover and the hub's side of the device relay are on main (#2930 to #2936). Stripe webhooks, a front on another machine, visitor links for Work threads, the window screens and the phone and desktop apps using the relay are in #2960 to #2962, not yet in a release either. Whole visitor links and the Public entrance Settings page come with #2965, also not released.

The private listener, pairing, and everything between your computers stay private. The entrance is a separate listener with its own short list of routes, and every other path answers 404.

What is on the entrance ​

RouteWhat it is for
A visitor link (/v/<link>)The page a visitor opens, its live stream, and comments where the link allows them
A webhook URL (/hooks/<endpoint>)A signed POST from an outside service that starts one routine
The device relay (/relay/v1)Your own paired devices reaching your computers as ciphertext the hub cannot read
/healthzSays the entrance is there, and nothing else

Everything is off until you turn it on ​

Three things must all be on before anything answers:

  1. The hub's switch. Settings › Public entrance › Public entrance, or octant hub public on. Off by default.
  2. Each computer's own hub grant. Tick Public on the computer whose threads or routines you want to reach (octant hub grant --items with public added), and Relay for the device relay. Both are off by default, so the hub carries nothing for a computer that did not tick them.
  3. Each link, endpoint or device. You share each thread, make each endpoint, and allow each device on its own.

The relay has one more switch, on the device that connects: see Reach your own computers away from home.

The window screens below are in a desktop window on the computer itself, on their own page, Settings › Public entrance. It holds Public entrance, Tailscale Funnel and Serve the public entrance, then Visitor links, Webhook endpoints and Device relay. Settings search finds each by name. A control the computer cannot use yet stays listed and says why: for example it is in no hub, or the entrance is off.

Pause remote access on the hub closes the entrance at once and turns its Tailscale Funnel off. If Tailscale refuses, the entrance stays closed anyway, Octant asks Tailscale again every minute, and resuming does not reopen the entrance until Funnel is off. Resuming reopens the entrance but leaves Funnel off; turn it on again yourself. Pausing on another computer refuses that computer's links and relayed devices; the hub keeps its webhook deliveries for up to a day and hands them over when you resume.

Choose a front ​

Something you run carries public traffic to the entrance. It listens on 127.0.0.1 on the hub, unless you list a front on another machine.

Tailscale Funnel. Turn on Tailscale Funnel under the entrance's switch (Settings › Public entrance), or run octant hub public on (port 443) or octant hub public on --port 10000. Octant runs tailscale funnel for you only when you turn the switch on, and turns Funnel off when you turn it off, pause, or stop being the hub. TLS ends on your hub, so Tailscale's relays cannot read the traffic. Funnel needs HTTPS certificates, MagicDNS, and the funnel node attribute in your tailnet policy; if Tailscale refuses, Settings says so and lists what Funnel needs. Port 8443 is not offered, because the private listener usually serves there.

When you turn the switch off and Tailscale refuses to turn Funnel off, the switch stays on and Settings keeps showing Funnel as on, with its port. Turn it off yourself with tailscale funnel --https=<port> off, using the port octant hub public status shows: 443 unless you chose 10000. If another program takes the entrance's port while Octant is stopped, Octant turns Funnel off rather than leave it pointing at that program; turn Funnel on again for the new port.

Your own front on the hub. Run a tunnel or proxy on the hub itself and point it at the entrance's loopback address, for example cloudflared for a Cloudflare Tunnel on your own account, or Caddy. Run octant hub public on --own-front, and octant hub public status shows the address to point it at.

With your own front, here or on another machine, its operator can read the traffic it carries, except the device relay, which stays encrypted end to end.

A front on another machine ​

Your proxy can also run elsewhere in your tailnet, for example Caddy on a rented server. The entrance then listens on the hub's Tailscale address, over TLS, and answers only the addresses you list.

  1. Turn on the hub's Tailscale certificate for the private listener: Settings → Remote access → Tailscale certificate, or octant hub certificate --enable --acknowledge-transparency. The entrance uses the same certificate.

  2. Turn Funnel off if it is on. Funnel and fronts exclude each other: each is refused while the other is set.

  3. Turn the entrance on with octant hub public on --own-front.

  4. List your proxy's Tailscale addresses, at most eight:

    sh
    octant hub public fronts <tailscale-address>...
  5. Run octant hub public status and point the proxy at the https://<hub-name>.<tailnet>.ts.net:<port> address it shows: the hub's tailnet name, which the certificate covers, on the entrance's port.

  6. If devices will use the relay, tell the hub the public address your proxy answers on (see Tell the hub its public address).

  • Only Tailscale addresses. Give addresses, not names. A LAN, public or wildcard address is refused.
  • Same address family. The entrance listens on the hub's IPv4 Tailscale address when it has one, otherwise its IPv6 one. A list with no address of that family is refused, so a list of only IPv6 addresses is refused on a hub with IPv4.
  • No fallback. Any other address is disconnected before TLS starts. Without a Tailscale address or certificate the entrance stays closed.
  • Back to the hub only. octant hub public fronts --clear returns the entrance to 127.0.0.1.

Tell the hub its public address ​

With your own front, the hub cannot know where the internet reaches it. Type it on the hub:

sh
octant hub public address https://hub.example.com
octant hub public address clear

It must be an https:// address with a domain name and no path. The hub passes it to your computers, so that paired devices learn where the relay is and a new visitor link is a whole link. With Funnel you do not need this: the hub uses its own tailnet name and Funnel port. A typed address always wins, so if you move from your own front to Funnel, run octant hub public address clear, or devices keep trying the old front.

Share a thread with a visitor ​

Turn visitor links on at the hub: the Visitor links switch under Settings › Public entrance › Visitor links, or octant hub visitor on. Then share a thread on the computer that owns it, with Public ticked in its hub grant.

In the window, open the thread's Environment, choose Share with visitor… on the Computer card, set Visitor may (Read only or Read and send requests) and Link ends after (1 hour, 1 day or 7 days), and choose Make link. The button appears only for a thread on this computer, in a desktop window.

From the command line:

sh
octant hub visitor share code <thread-id>             # read-only, 24 hours
octant hub visitor share work <thread-id> --comment   # visitors may comment
octant hub visitor share chat <thread-id> --hours 72  # up to 168 hours

Either way you get the link once. When your computer knows the hub's public address, you get the whole link, https://<hub address>/v/<link>#k=<secret>: send it as it is (Copy link in the window). The hub tells your computers that address while visitor links and its entrance are on and it knows it: the address you typed for your own front, or its tailnet name and Funnel port.

Otherwise you get the path alone, /v/<link>#k=<secret> (Copy path). Put your hub's public address in front of it and send the whole link. Either way the secret is in the part after #, which browsers never send, so no front or log sees it.

  • One browser. The first browser that opens the link with its secret keeps it. Another browser is refused, even with the full link.
  • Opening waits out a busy moment. If the first open meets a busy hub, a rate limit, or no answer, the page tries again on its own, after 3 seconds and then twice as long each time, up to a minute. Each try waits at most 30 seconds, including the answer's body when the page needs it (the link's scope on success, or the reason it was refused).
  • The secret leaves the address bar only on a final answer: once the link opens, has ended, or is open in another browser. If the page says to check your clock, or that the link does not exist yet, the secret stays, so a reload can still open it.
  • Live and read-only. The visitor sees the thread's messages as they arrive, redacted, with no files, diffs, tool output or approvals. A visitor can never answer an approval, change the model, or act on the thread.
  • Comments wait for you. On a comment link, a visitor's message is a request that waits on your computer until you choose Send or Dismiss…, in the thread's Share with visitor dialog or under Settings › Public entrance › Visitor links (octant hub visitor send|dismiss <comment-id>). Send marks the thread as carrying outside content and gives you the comment, framed as the visitor's, to send there as your next message (Copy comment in the window); it is never an instruction. Dismiss throws it away without telling the visitor. At most 20 comments wait on a link, 4,000 characters each.
  • Stopping. Stop sharing in either place, or octant hub visitor stop <link-id>, ends a link at once. A link also ends when it expires (24 hours by default, 7 days at most) or when its thread is archived. Your computer checks every request itself, so a stopped link stops on the hub and on any standby alike.

Each browser on a link gets 120 requests and 10 comments a minute, and at most 4 open streams. Visitor links work for Code, Work and Chat threads. octant hub visitor list shows your links and the requests waiting on them.

Start a routine from a webhook ​

On the computer that owns the routine, with Public ticked in its hub grant, make an endpoint. Under Settings › Public entrance › Webhook endpoints, give it a Name, pick its Signing (Standard Webhooks, GitHub or Stripe) and choose Make endpoint. Or from the command line:

sh
octant hub webhook create --scheme github --label "Repository pushes"
octant hub webhook create --scheme standard-webhooks --label "Billing events"

For GitHub and Standard Webhooks, Octant shows the URL path and the secret once. Give the sender the secret and the path on your hub's public address. For Stripe, see below. Then, in Automation Center, give a Work or Code routine the Webhook source under When an integration event arrives, and pick the endpoint. See Routines.

  • Signed or nothing. The hub checks each delivery's signature on its exact bytes before it keeps it, and your computer checks it again with its own copy of the secret. Unsigned or forged deliveries start nothing. Standard Webhooks and Stripe deliveries more than five minutes old are refused. GitHub signs no time, so a GitHub delivery is remembered by its id and by its body for seven days, and a repeat inside that time starts nothing.
  • Once. A delivery your computer already took starts no second run, even after a failover.
  • While your computer sleeps. The hub holds deliveries for up to 24 hours and, if the wake service is on, wakes the computer. The routine runs when it is back.
  • Never more access. A webhook routine runs at Ask first at most in Code, and at its default level in Work. It can never be set to follow its Project's level or run at Full access. The payload reaches the run as outside content.
  • Limits. Each endpoint takes 60 requests a minute and bodies up to 256 KiB, and the hub holds at most 500 deliveries or 32 MiB for it.
  • Rotate and remove. Rotate… or octant hub webhook rotate <endpoint-id> makes a new URL and secret and ends the old pair at once; routines that used the old endpoint keep working with the new one. Deliveries to the old URL that your computer has not run yet are dropped, on your computer and on the hub, so rotate when none are waiting. Remove… or octant hub webhook remove <endpoint-id> ends it. octant hub webhook list shows your endpoints and how many deliveries each has taken, and the window also lists recent deliveries and why any were refused.

Stripe ​

Stripe makes the signing secret itself, after you give it the URL.

  1. Make the endpoint: pick Stripe in the window, or run octant hub webhook create --scheme stripe --label "Payments". You get its path and no secret.

  2. In Stripe, add a webhook endpoint with that path on your hub's public address, and copy the signing secret Stripe shows. It starts with whsec_.

  3. Paste it into Signing secret from Stripe and choose Save secret (if you closed that step, choose Paste secret on the endpoint). Or run the command below, which reads the secret from standard input, so it is not part of the command line:

    sh
    octant hub webhook secret <endpoint-id>

Until then the endpoint is marked as waiting for its secret and takes no delivery. To roll the secret, first check that Octant will take a new one: it keeps at most two replaced secrets, each for two days, so a third paste within two days of the oldest is refused. If it would be, wait or rotate instead, because a refused paste after Stripe has already stopped signing with the old secret leaves the endpoint unable to take deliveries. Then roll the secret in Stripe, keeping the old one valid for a while if Stripe offers it, and paste the new one the same way (New secret in the window). Octant keeps accepting new deliveries signed with the old one for 24 hours, and keeps it a day longer for deliveries the hub was already holding. Rotating the endpoint is different: it retires the old URL, drops deliveries your computer has not run yet, makes a new URL, which you give to Stripe, and waits for the secret Stripe shows for it.

A delivery with the same Stripe event id starts nothing twice within seven days; your computer forgets event ids after that, so a resend later than that runs the routine again.

Reach your own computers away from home ​

The device relay lets your own paired phone or computer reach the computers it paired with through the hub, without Tailscale on the device. The device runs its usual TLS to the computer inside the relay, checked against the certificate pin from pairing, so the hub and the front see only ciphertext.

Four things turn it on:

  1. On the hub, the Device relay switch under Settings › Public entrance › Device relay, or octant hub relay on.
  2. On each computer you want to reach, tick Relay in its hub grant.
  3. On that computer, allow each device: its switch under Settings › Public entrance › Device relay, or octant hub relay allow <device-id>.
  4. On the device, turn on reaching that computer through the hub. It is off by default and set per computer:
    • desktop app: Settings → Remote access → Other computers, the switch Reach computer name through the hub when away on that computer's row, which reads "Away: private network only" while it is off;
    • phone: Settings, in the list of computers, Reach this computer through the hub when away.

The device learns the hub's address from the computer while it is on your private network, so connect once at home after turning this on. With your own front, first tell the hub its public address. It then uses the relay only when the direct private connection fails before anything was sent. After the relay answers, it uses the relay for a minute, then tries the direct connection again. It never retries through the hub when the computer's key did not match. A plain browser cannot check the certificate pin, so it never uses the relay.

  • A device still pairs on your private network or by QR. Through the relay it can never pair a new device, change your device list, pause remote access, or reach hub or window routes.
  • Forgetting a device or turning its relay off ends the device's open connection at once, not only the next one; unticking Relay or pausing ends it within seconds.

Only the hub itself carries relays: a standby that stands in does not. Anything that needs a WebSocket connection to the computer does not work through the relay yet.

When the hub is down ​

A standby can stand in for the entrance as well as for the hub's other work, but only if the standby's own person turned it on: the Serve the public entrance switch in the standby's Settings › Public entrance, or octant hub public standby on. It is off by default, and the switch works on a standby the hub has named. A computer that ticked Standby in its hub grant hands that standby the same endpoints and links it hands the hub.

While the standby stands in, it receives webhooks and serves visitor links. When the hub is back, the standby hands back every delivery it still holds, the hub checks each one again with its own copy of the secret, and none runs twice. Octant runs no Tailscale command when a stand-in starts or ends: a Funnel the standby's person turned on stays on.

Your computer takes a delivery or a visitor's request from a standby only while it stands in for that computer: the computer ticked Standby, and it cannot reach the hub itself. It checks Standby again after looking for the hub, so unticking it meanwhile still refuses. If the network splits so that only the standby loses the hub, your computer refuses the standby's deliveries because it can still reach the hub. They wait in the standby's queue and reach the routine once the standby hands them back.

With Tailscale Funnel alone, the address follows the machine's name, so a sender needs the standby's address as a fallback. octant hub public status lists it, with the standby's own Funnel port when you run it on the standby. A visitor link opened at the hub's address stays with that address, so with Funnel alone visitors wait for the hub to come back, while webhooks fail over. A front that runs only on the hub stops when the hub's machine does, so for webhooks to fail over with your own front, run a connector on each machine: for example cloudflared for the same Cloudflare Tunnel on the hub and on the standby, each pointed at its own entrance's loopback address. The tunnel's address then does not change, and whichever machine is acting as the hub takes the deliveries. A proxy on another machine can have both behind it: set up the front on the hub and on the standby, each with its own certificate, and give the proxy both tailnet names. Upgrade the hub before, or with, its standbys.

A computer that is not acting as the hub only passes requests on. Its entrance forwards webhooks to the hub, but it does not pass visitor links on: the page tells the visitor to ask for the hub's address. A standby is in this position whenever it is not standing in. So point a front for visitor links at the hub's entrance alone. A front connected to both the hub and the standby may send a visitor to the standby while the hub is up, and the visitor then sees that page instead of the thread.

Not built yet ​

  • Share with visitor in the thread list's menu, and a visitor's request as a card inside the transcript. Share from the Computer card, and answer requests there or in Settings.
  • Step titles in what a visitor sees.
  • Posting a comment you send straight into the thread.
  • Relays through a standby, and WebSocket connections inside a relay.

What each party can see ​

  • Anyone on the internet reaches only the routes above, rate-limited, and without a link's secret, an endpoint's secret, or a listed device key they get nothing.
  • Someone holding a visitor link can read that one thread until it expires or you stop it, from one browser, and cannot act on it.
  • Someone holding a webhook secret can start that one routine with outside content, within the routine's own allowance.
  • The front's operator sees which routes are used and when. With your own front, it also sees visitor pages and webhook bodies, but never the relay's contents.
  • A compromised hub could forge a webhook delivery into a routine you defined, as outside content, and read shared threads in transit. It cannot read or change relayed traffic.

Next steps ​

Octant documentation · local-first by design