Skip to content

Accessing the Hydrus API with Tailscale Serve

Paul Friederichsen edited this page Oct 9, 2024 · 6 revisions

This guide will show you how to setup the Hydrus API to be served through Tailscale with valid HTTPS and remote access for use with Hydrus Web.

Set up the Hydrus API

Enable the Client API service in "manage services", it should look like this:

client_liucKBnBOp

Ensure "run the client api?" and "support CORS headers" are checked while "use https" is unchecked. Note the port selected here for later.

Next go to client API tab in "review services" and create an access key with "permits everything" checked. Record the access key for later.

Install Tailscale

Sign up for a Tailscale account if you don't already have one. Download the client, install it, and sign in to Tailscale. Your machine will now have a special Tailscale IP (of the format 100.x.y.z) that you will be able to see in the web dashboard or in Tailscale on your machine.

You will also want to install Tailscale on the other devices you want to access Hydrus with.

Setup Tailscale Magic DNS and HTTPS

Magic DNS should already be enabled but if not enable it.

Then, follow steps 1-4 here to enable HTTPS support.

Serve the Hydrus API with Tailscale

In a terminal, run

tailscale serve --bg http://localhost:45869

Alternatively if you want to serve the Hydrus API on a subpath so you can run serve other things through Tailscale, you can provide a path for example:

tailscale serve --bg --set-path /hydrus-api/ http://localhost:45869

Documentation for tailscale serve can be found here.

After running one of those commands you it will tell you the address your Hydrus API is being served at. You should be able to open this address in a browser and see the Hydrus API splash screen.

For example the response may look like:

https://example-pc.taile7fb.ts.net (tailnet only)
|-- /hydrus-api/ proxy http://127.0.0.1:45869

In this example my Hydrus API will be served at https://example-pc.taile7fb.ts.net/hydrus-api/. Remember this address for the next step. You can see this information again by running tailscale status.

Setting up Hydrus Web

Finally open https://hydrus.app/, https://dev.hydrus.app/, or your self-hosted Hydrus Web on the device you want to connect to and in the settings enter the address from the last step and the access key from the beginning. Hit the "Test API" button and if everything is working you should see something like this:

chrome_OiuweKA0Aj