Skip to content

Commit a442660

Browse files
authored
Merge branch '2Tiny2Scale:main' into main
2 parents dd664fa + d072177 commit a442660

File tree

5 files changed

+107
-0
lines changed

5 files changed

+107
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ If you would like to add your own config, you can use the [service-template](tem
2929
| 🎥 **Bazarr** | A companion tool to Radarr and Sonarr for managing subtitles. | [Details](services/bazarr) |
3030
| 📊 **Tautulli** | A monitoring and tracking tool for Plex Media Server. | [Details](services/tautulli) |
3131
| 📥 **qBittorrent** | An open-source BitTorrent client. | [Details](services/qbittorrent) |
32+
| 🔗 **Slink** | A fast, self-hosted alternative to ShareDrop for secure local file sharing. | [Details](services/slink) |
3233

3334
### Productivity and Collaboration
3435

services/slink/.env

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#version=1.0
2+
#url=https://github.com/2Tiny2Scale/tailscale-docker-sidecar-configs
3+
#COMPOSE_PROJECT_NAME= // only use in multiple deployments on the same infra
4+
SERVICE=slink
5+
IMAGE_URL=anirdev/slink
6+
SERVICEPORT=3000
7+
TS_AUTHKEY= //Insert Tailscale key here from the Admin Portal
8+
DNS_SERVER=1.1.1.1

services/slink/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Slink with Tailscale Sidecar Configuration
2+
3+
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.

services/slink/config/serve.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"TCP": {
3+
"443": {
4+
"HTTPS": true
5+
}
6+
},
7+
"Web": {
8+
"${TS_CERT_DOMAIN}:443": {
9+
"Handlers": {
10+
"/": {
11+
"Proxy": "http://127.0.0.1:3000"
12+
}
13+
}
14+
}
15+
}
16+
}

services/slink/docker-compose.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
services:
2+
# 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
71+
restart: always

0 commit comments

Comments
 (0)