May 27, 20251 yr GitHubGitHub - almeidapaulopt/tsdproxy: Tailscale Docker ProxyTailscale Docker Proxy. Contribute to almeidapaulopt/tsdproxy development by creating an account on GitHub.https://almeidapaulopt.github.io/tsdproxy/docs/getting-started/##############I focused on using the tailscale Funnel feature...https://tailscale.com/kb/1223/funnelThis will focus on using the tailscale docker in conjunction with the tsdproxy dockerStandalone Compose file runs tailscale, tsdproxy and npm(Optional)#version: "3.8"services:tailscale:image: tailscale/tailscalecontainer_name: tailscalenetwork_mode: "host"privileged: truecap_add:- NET_ADMINenvironment:- TS_AUTHKEY=${TS_AUTHKEY}#Get your auth key here: https://login.tailscale.com/admin/settings/keysvolumes:- /dev/net/tun:/dev/net/tun- /mnt/user/appdata/reverseproxy/tailscale/var-lib:/var/lib/tailscale- /var/run/tailscale:/var/run/tailscalerestart: unless-stoppedtsdproxy:image: ghcr.io/almeidapaulopt/tsdproxy:latestcontainer_name: tsdproxyports:- "8080:8080"volumes:- /var/run/docker.sock:/var/run/docker.sock:ro- /var/run/tailscale:/var/run/tailscale- /mnt/user/appdata/reverseproxy/tsdproxy/data:/data- /mnt/user/appdata/reverseproxy/config:/configrestart: unless-stopped#Optional Revers Proxy for other setups...# npm:# image: jc21/nginx-proxy-manager:latest# container_name: npm# hostname: proxy# networks:# netproxy:# ipv4_address: 172.22.0.4# ports:# - "127.0.0.1:8180:80"# - "127.0.0.1:8443:443"# - "8181:81"# environment:# - DISABLE_IPV6=true# volumes:# - /mnt/user/appdata/reverseproxy/npm/data:/data# - /mnt/user/appdata/reverseproxy/npm/letsencrypt:/etc/letsencrypt# restart: unless-stoppednetworks:netproxy:driver: bridgeipam:config:- subnet: 172.22.0.0/24docker-compose.ymlOther example tsdproxy config:example config I used... (Unraid at ip 192.168.2.254)Example tsdproxy.yaml placed in the compose config folderdefaultProxyProvider: defaultdocker:local:host: unix:///var/run/docker.socktargetHostname: 192.168.2.254defaultProxyProvider: defaultfiles: {}tailscale:providers:default:authKey: "tskey-auth-########" # Use the Same TS Auth KEY in the Compose! This is handled by the Tailscale containercontrolUrl: https://controlplane.tailscale.comdataDir: /data/http:hostname: 0.0.0.0port: 8080log:level: infojson: falseproxyAccessLog: truetsdproxy.yamlso how does this work?...(I've found it works better if the docker you want to share is in a docker bridge network...)So how do i add a docker to tsdproxy?the docker you want forward facing, you add this labelexample for immich:compose optons for other dockerslabels:- tsdproxy.enable=true- tsdproxy.name=immich- tsdproxy.funnel=trueThis will enable tsdproxy to forward the docker port, this will create a machine called immich.<yourtailscale>.ts.net and will enable the funnel featurehttps://almeidapaulopt.github.io/tsdproxy/docs/docker/AS example As, I also did one for plex example:add lable to plex for tsdproxy to make a tailscalenet examplelabels:- tsdproxy.enable=true- tsdproxy.name=plex- tsdproxy.funnel=truewhat does it look like then?OMV being the Unraid host name that the tailscale docker added...so now if i go to immich.<tailscalname>.ts.netI hit my web UIdocker-compose.yml tsdproxy.yaml Edited May 27, 20251 yr by bmartino1 Data-Typo
May 28, 20251 yr Author Solution Small docker compose update... The above compose will work, but if docker compose down, and docker compose up. This may make duplicates machines in the tailscale admin interface, This is due to the tailscald not having a state file and keeping machine identity... A simple command file to the tailscale sidecar docker method... as the machine identity is not saved and is removed at compose down removal...Simple fix though.. Add the tailscal state file: command: tailscaled --state=/var/lib/tailscale/tailscaled.state*add this under tailscale docker compose section...With this options added. I had to remove the machines form the tails scale admin interface and when I composed up I only had immich and plex no omv (the urnaid host)Updated example Fix tailscale state file#version: "3.8"services:tailscale:image: tailscale/tailscalepull_policy: always# Watch Tower Compose Update Docker# labels:# - "com.centurylinklabs.watchtower.enable=true"container_name: tailscalenetwork_mode: "host"privileged: truecap_add:- NET_ADMINenvironment:- TS_AUTHKEY=${TS_AUTHKEY}#Get your auth key here: https://login.tailscale.com/admin/settings/keysvolumes:- /dev/net/tun:/dev/net/tun- /mnt/user/appdata/reverseproxy/tailscale/var-lib:/var/lib/tailscale- /var/run/tailscale:/var/run/tailscalecommand: tailscaled --state=/var/lib/tailscale/tailscaled.staterestart: unless-stoppedtsdproxy:image: ghcr.io/almeidapaulopt/tsdproxy:latestpull_policy: always# Watch Tower Compose Update Docker# labels:# - "com.centurylinklabs.watchtower.enable=true"container_name: tsdproxyports:- "8080:8080"#If you have something else using port 8080 change to 60080:8080volumes:- /var/run/docker.sock:/var/run/docker.sock:ro- /var/run/tailscale:/var/run/tailscale- /mnt/user/appdata/reverseproxy/tsdproxy/data:/data- /mnt/user/appdata/reverseproxy/config:/configrestart: unless-stopped#Optional Reverse Proxy# npm:# image: jc21/nginx-proxy-manager:latest# pull_policy: always# Watch Tower Compose Update Docker# labels:# - "com.centurylinklabs.watchtower.enable=true"# container_name: npm# hostname: proxy# networks:# netproxy:# ipv4_address: 172.42.0.4# ports:# - "127.0.0.1:8180:80"# - "127.0.0.1:8443:443"# - "8181:81"# environment:# - DISABLE_IPV6=true# volumes:# - /mnt/user/appdata/reverseproxy/npm/data:/data# - /mnt/user/appdata/reverseproxy/npm/letsencrypt:/etc/letsencrypt# restart: unless-stopped#Network for npm docker bridge and tsdproxynetworks:netproxy:driver: bridgeipam:config:- subnet: 172.42.0.0/24Recommend fixing to not cause tail scale device duplication:*I also recommend running watch tower as host setting labels to update compose dockers on unraid...What the admin interface will look like after comand added:docekr-compose.ymlWatchtower docker in compose#version: "3.8"services:watchtower:image: containrrr/watchtowercontainer_name: watchtowerrestart: unless-stoppednetwork_mode: hostvolumes:- /var/run/docker.sock:/var/run/docker.sockcommand: >--schedule "0 1 10 * *"--cleanup--include-stopped--label-enablelabels:- "com.centurylinklabs.watchtower.enable=false" Edited May 28, 20251 yr by bmartino1 Data - typo
February 18Feb 18 Author This is known as a side car method -l tsdproxy.enable=true -l tsdproxy.name=plex -l tsdproxy.funnel=trueor --label tsdproxy.enable=true --label tsdproxy.name=plex --label tsdproxy.funnel=true \and can be added to urnaid ca via extra parm: Edited February 18Feb 18 by bmartino1
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.