You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This Docker Compose configuration sets up [Slink](https://github.com/andrii-kryvoviaz/slink) with Tailscale as a sidecar container to securely manage and access your local file-sharing system over a private Tailscale network. By integrating Tailscale in a sidecar configuration, you can ensure that your Slink instance is both secure and private, accessible only within your Tailscale network.
4
+
5
+
## Slink
6
+
7
+
[Slink](https://github.com/andrii-kryvoviaz/slink) is a fast, self-hosted alternative to ShareDrop, enabling secure, real-time file sharing over local networks. It allows you to easily share files between devices without relying on third-party servers, ensuring complete control and privacy. By combining Slink with Tailscale, this configuration provides a secure way to connect and share files exclusively within your private network.
8
+
9
+
## Configuration Overview
10
+
11
+
In this setup, the `tailscale-slink` service runs Tailscale, which manages secure networking for the Slink service. The `slink` service uses the Tailscale network stack via Docker's `network_mode: service:` configuration. This ensures that Slink's file-sharing interface is only accessible through the Tailscale network, adding an extra layer of security and privacy for your self-hosted file-sharing system.
# Make sure you have updated/checked the .env file with the correct variables.
3
+
# All the ${ xx } need to be defined there.
4
+
# Tailscale Sidecar Configuration
5
+
tailscale:
6
+
image: tailscale/tailscale:latest # Image to be used
7
+
container_name: ${SERVICE} # Name for local container management
8
+
hostname: ${SERVICE} # Name used within your Tailscale environment
9
+
environment:
10
+
- TS_AUTHKEY=${TS_AUTHKEY}
11
+
- TS_STATE_DIR=/var/lib/tailscale
12
+
- TS_SERVE_CONFIG=/config/serve.json # Tailsacale Serve configuration to expose the web interface on your local Tailnet - remove this line if not required
13
+
- TS_USERSPACE=false
14
+
volumes:
15
+
- ${PWD}/${SERVICE}/ts/config:/config # Config folder used to store Tailscale files - you may need to change the path
16
+
- ${PWD}/${SERVICE}/ts/state:/var/lib/tailscale # Tailscale requirement - you may need to change the path
17
+
- /dev/net/tun:/dev/net/tun # Network configuration for Tailscale to work
18
+
cap_add:
19
+
- net_admin # Tailscale requirement
20
+
- sys_module # Tailscale requirement
21
+
ports:
22
+
- 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
23
+
# If any DNS issues arise, use your preferred DNS provider by uncommenting the config below
24
+
# dns:
25
+
# - ${DNS_SERVER}
26
+
healthcheck:
27
+
test: ["CMD", "tailscale", "status"] # Check if Tailscale is running
28
+
interval: 1m# How often to perform the check
29
+
timeout: 10s# Time to wait for the check to succeed
30
+
retries: 3# Number of retries before marking as unhealthy
31
+
start_period: 10s# Time to wait before starting health checks
32
+
restart: always
33
+
34
+
# ${SERVICE}
35
+
application:
36
+
image: ${IMAGE_URL} # Image to be used
37
+
network_mode: service:tailscale # Sidecar configuration to route ${SERVICE} through Tailscale
38
+
container_name: app-${SERVICE} # Name for local container management
39
+
environment:
40
+
- PUID=1000
41
+
- PGID=1000
42
+
- TZ=Europe/Amsterdam
43
+
44
+
# Your application hostname
45
+
- ORIGIN=https://your-domain.com
46
+
47
+
# Require user approval before they can upload images
48
+
- USER_APPROVAL_REQUIRED=true
49
+
50
+
# User password requirements
51
+
- USER_PASSWORD_MIN_LENGTH=8
52
+
- USER_PASSWORD_REQUIREMENTS=15 # bitmask of requirements
53
+
54
+
# Maximum image size allowed to be uploaded (no more than 50M)
55
+
- IMAGE_MAX_SIZE=15M
56
+
57
+
# Storage provider to use.
58
+
# Available options are local and smb
59
+
- STORAGE_PROVIDER=local
60
+
volumes:
61
+
- ${PWD}/${SERVICE}/var/data:/app/var/data
62
+
- ${PWD}/${SERVICE}/images:/app/slink/images
63
+
depends_on:
64
+
- tailscale
65
+
healthcheck:
66
+
test: ["CMD", "pgrep", "-f", "${SERVICE}"] # Check if ${SERVICE} process is running
67
+
interval: 1m# How often to perform the check
68
+
timeout: 10s# Time to wait for the check to succeed
69
+
retries: 3# Number of retries before marking as unhealthy
70
+
start_period: 30s# Time to wait before starting health checks
0 commit comments