# Tailscale

[Tailscale](https://tailscale.com) Mesh VPN service can be used as an sidecar container to access the Speedtest Tracker within your Tailnet on its own MagicDNS name.

## Tailscale Auth key

Generate an auth key for tailscale so the docker container can access your tailnet.

1. Open the [**Keys**](https://login.tailscale.com/admin/settings/keys) page of the admin console.
2. Select **Generate auth key**.
3. Fill out the form fields to specify characteristics about the auth key, such as the description, whether its reusable, when it expires, and device settings.
4. Select **Generate key**.

Save this Auth Key. We will need this later on.

## Docker Configuration

Docker-Compose:

```yaml
services:
  tailscale-speedtest:
    image: tailscale/tailscale
    container_name: tailscale_speedtest-tracker
    hostname: speedtest
    environment:
      - TS_AUTHKEY=
      - TS_STATE_DIR=/var/lib/tailscale
      - TS_USERSPACE=false
    volumes:
      - ./tailscale-traefik/state:/var/lib/tailscale
      - /dev/net/tun:/dev/net/tun
    cap_add:
      - net_admin
      - sys_module
    restart: unless-stopped

  speedtest-tracker:
    container_name: speedtest-tracker-tailscale
    depends_on:
      - tailscale-speedtest
    network_mode: service:tailscale-speedtest
    environment:
        - PUID=1000
        - PGID=1000
        - APP_KEY=
        - DB_CONNECTION=sqlite
        - SPEEDTEST_SCHEDULE=
        - SPEEDTEST_SERVERS=
        - PRUNE_RESULTS_OLDER_THAN=
        - CHART_DATETIME_FORMAT= 
        - DATETIME_FORMAT=
        - APP_TIMEZONE=
        - APP_URL=https://speedtest.yourtailnet.ts.net # Change this to your MagicDNS name
        - ASSET_URL=https://speedtest.yourtailnet.ts.net # Change this to your MagicDNS name
    volumes:
        - /path/to/data:/config
        - /path/to-custom-ssl-keys:/config/keys
    image: lscr.io/linuxserver/speedtest-tracker:latest
    restart: unless-stopped
```

| Added compose part | Description                                                                             |
| ------------------ | --------------------------------------------------------------------------------------- |
| `APP_URL`          | URL you want to access the WebGui on. This will need to be the Tailscale Magic DNS name |
| `ASSET_URL`        | URL used for loading all the needed assets. Need to be the same as the `APP_URL`.       |
| `TS_AUTHKEY`       | Auth key for Tailscale                                                                  |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.speedtest-tracker.dev/other/proxies/tailscale.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
