Skip to content

Commit a0eeb75

Browse files
michaelhodgesMichael Hcrypt0rr
authored
Rustdesk Server (New Service) (#256)
* compose.yml and .env added to paperless service. * Include paperless service README * Error paperless service README * Add PUID, GUID to environment. Align environment variables with template format * Remove volumes and incorporate the local storage principle as outlined in templates. * Restored comments. * Place TZ in .env * Add TZ variable to environment. * Revert "Restored comments." This reverts commit 216de08. * Restore Comments * Revert * Revert changes made to template files. * Set SERVICEPORT to 80 in .env configuration * Update to include paperless-ngx * Update README with Tailscale service configuration Added information about Tailscale integration for secure networking. * Add audiobooks, podcasts and metadata volumes. * Fix indentation. * New service Rustdesk server * Update README to include Rustdesk Server * Cleanup markdown * Cleanup markdown * Cleanup list markdown * Delete services/audiobookshelf/compose.yaml * Update compose.yml * Add files via upload * Update .env * Change time zone from Dublin to Amsterdam --------- Co-authored-by: Michael H <michael@hplaptop.local> Co-authored-by: Bart <57799908+crypt0rr@users.noreply.github.com>
1 parent c607952 commit a0eeb75

File tree

4 files changed

+132
-0
lines changed

4 files changed

+132
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ A huge thank you to all our contributors! ScaleTail wouldn’t be what it is tod
8787
| 🗃️ **Netbox** | NetBox is the leading solution for modeling and documenting modern networks. | [Details](services/netbox) |
8888
| 🧩 **Pi-hole** | A network-level ad blocker that acts as a DNS sinkhole. | [Details](services/pihole) |
8989
| 🆔 **Pocket ID** | A self-hosted decentralized identity (OIDC) solution for secure authentication. | [Details](services/pocket-id) |
90+
| 🌐 **Rustdesk Server** | RustDesk is an open source remote control alternative for self-hosting and security. | [Details](services/rustdesk-server)|
9091
| 🔒 **Technitium DNS** | An open-source DNS server that can be used for self-hosted DNS services. | [Details](services/technitium) |
9192
| 🌐 **Traefik** | A modern reverse proxy and load balancer for microservices. | [Details](services/traefik) |
9293
| 🚀 **Tailscale Exit Node** | Configure a device to act as an exit node for your Tailscale network. | [Details](services/tailscale-exit-node) |

services/rustdesk-server/.env

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#version=1.1
2+
#URL=https://github.com/tailscale-dev/ScaleTail
3+
#COMPOSE_PROJECT_NAME= # Optional: only use when running multiple deployments on the same infrastructure.
4+
5+
# Service Configuration
6+
SERVICE=rustdesk-server # Service name (e.g., adguard). Used as hostname in Tailscale and for container naming (app-${SERVICE}).
7+
IMAGE_URL=rustdesk/rustdesk-server:latest # Docker image URL from container registry (e.g., adguard/adguard-home).
8+
9+
# Network Configuration
10+
SERVICEPORT=80 # Port to expose to local network. Uncomment the "ports:" section in compose.yaml to enable.
11+
DNS_SERVER=9.9.9.9 # Preferred DNS server for Tailscale. Uncomment the "dns:" section in compose.yaml to enable.
12+
13+
# Tailscale Configuration
14+
TS_AUTHKEY= # Auth key from https://tailscale.com/admin/authkeys. See: https://tailscale.com/kb/1085/auth-keys#generate-an-auth-key for instructions.
15+
16+
# Optional Service variables
17+
# PUID=1000
18+
19+
# Time zone
20+
TZ=Europe/Amsterdam
21+
22+
# Always use the relay. As this is run in tailnet and relays aren't needed, this setting in most cases should remain off.
23+
ALWAYS_USE_RELAY=N

services/rustdesk-server/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Rustdesk Server with Tailscale Sidecar Configuration
2+
3+
This Docker Compose configuration sets up [Rustdesk Server](https://rustdesk.com/docs/en/) with Tailscale as a sidecar container to keep the app reachable over your Tailnet.
4+
5+
## Rustdesk Server
6+
7+
[Rustdesk Server](https://rustdesk.com/docs/en/) information about the service. Explain what the app does in 2-3 sentences and why someone would pair it with Tailscale.
8+
9+
## Configuration Overview
10+
11+
In this setup, the `tailscale-rustdesk-server` service runs Tailscale, which manages secure networking for Rustdesk Server. The `Rustdesk Server` service utilizes the Tailscale network stack via Docker's `network_mode: service:` configuration. This keeps the app Tailnet-only unless you intentionally expose ports.
12+
13+
## Client setup
14+
15+
- Service Configuration: The Rustdesk client public Key credentials are generated at first run and stored in the **id_ed25519.pub** file. This is found in the compose directory **./rustdesk-server-data/hbbs/** Clients can be setup using the --config switch. e.g. **rustdesk.exe --config "host=rustdesk.your-tailnet.ts,key=thetextfromkey"** or in the client Setting -> Network -> ID/Relay Server. There is no need to configure the relay or API server.
16+
17+
Links:
18+
19+
- [Client setup](https://github.com/rustdesk/rustdesk/discussions/7118)
20+
- [Rustdesk](https://rustdesk.com/)
21+
- [Client Configuration](https://rustdesk.com/docs/en/self-host/client-configuration/)
22+
23+
## Files to check
24+
25+
Please check the following contents for validity as some variables need to be defined upfront.
26+
27+
- `.env` // Main variable `TS_AUTHKEY`
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
configs:
2+
ts-serve:
3+
content: |
4+
{"TCP":{"443":{"HTTPS":true}},
5+
"Web":{"$${TS_CERT_DOMAIN}:443":
6+
{"Handlers":{"/":
7+
{"Proxy":"http://127.0.0.1:80"}}}},
8+
"AllowFunnel":{"$${TS_CERT_DOMAIN}:443":false}}
9+
10+
services:
11+
# Make sure you have updated/checked the .env file with the correct variables.
12+
# All the ${ xx } need to be defined there.
13+
# Tailscale Sidecar Configuration
14+
tailscale:
15+
image: tailscale/tailscale:latest # Image to be used
16+
container_name: tailscale-${SERVICE} # Name for local container management
17+
hostname: ${SERVICE} # Name used within your Tailscale environment
18+
environment:
19+
- TS_AUTHKEY=${TS_AUTHKEY}
20+
- TS_STATE_DIR=/var/lib/tailscale
21+
- TS_SERVE_CONFIG=/config/serve.json # Tailscale Serve configuration to expose the web interface on your local Tailnet - remove this line if not required
22+
- TS_USERSPACE=false
23+
- TS_ENABLE_HEALTH_CHECK=true # Enable healthcheck endpoint: "/healthz"
24+
- TS_LOCAL_ADDR_PORT=127.0.0.1:41234 # The <addr>:<port> for the healthz endpoint
25+
#- TS_ACCEPT_DNS=true # Uncomment when using MagicDNS
26+
- TS_AUTH_ONCE=true
27+
configs:
28+
- source: ts-serve
29+
target: /config/serve.json
30+
volumes:
31+
- ./config:/config # Config folder used to store Tailscale files - you may need to change the path
32+
- ./ts/state:/var/lib/tailscale # Tailscale requirement - you may need to change the path
33+
devices:
34+
- /dev/net/tun:/dev/net/tun # Network configuration for Tailscale to work
35+
cap_add:
36+
- net_admin # Tailscale requirement
37+
#ports:
38+
# - 0.0.0.0:${SERVICEPORT}:${SERVICEPORT} # Binding port ${SERVICE}PORT to the local network - may be removed if only exposure to your Tailnet is required
39+
# If any DNS issues arise, use your preferred DNS provider by uncommenting the config below
40+
#dns:
41+
# - ${DNS_SERVER}
42+
healthcheck:
43+
test: ["CMD", "wget", "--spider", "-q", "http://127.0.0.1:41234/healthz"] # Check Tailscale has a Tailnet IP and is operational
44+
interval: 1m # How often to perform the check
45+
timeout: 10s # Time to wait for the check to succeed
46+
retries: 3 # Number of retries before marking as unhealthy
47+
start_period: 10s # Time to wait before starting health checks
48+
restart: always
49+
50+
# ${SERVICE}
51+
application:
52+
image: ${IMAGE_URL}
53+
container_name: app-${SERVICE}-hbbs # Name for local container management
54+
network_mode: service:tailscale # Sidecar configuration to route ${SERVICE} through Tailscale
55+
command: hbbs
56+
volumes:
57+
- ./${SERVICE}-data/hbbs:/root
58+
environment:
59+
- PUID=1000
60+
- PGID=1000
61+
- TZ=${TZ}
62+
- ALWAYS_USE_RELAY=${ALWAYS_USE_RELAY}
63+
depends_on:
64+
tailscale:
65+
condition: service_healthy
66+
hbbr:
67+
condition: service_started
68+
restart: always
69+
70+
hbbr:
71+
image: ${IMAGE_URL}
72+
container_name: app-${SERVICE}-hbbr # Name for local container management
73+
command: hbbr
74+
volumes:
75+
- ./${SERVICE}-data/hbbr:/root
76+
environment:
77+
- PUID=1000
78+
- PGID=1000
79+
- TZ=${TZ}
80+
network_mode: service:tailscale # Sidecar configuration to route ${SERVICE} through Tailscale
81+
restart: always

0 commit comments

Comments
 (0)