Connecting with existing tunnel issue
How do I use an existing tunnel deployed from docker as this keeps creating a new tunnel instead
version: '2.3'
services:
trilium:
container_name: trilium
image: zadam/trilium:latest
restart: unless-stopped
ports:
- "8090:8080"
volumes:
- /home/user/trilium_data:/home/node/trilium-data
networks:
- achllys_nw
cloudflare_tunnel:
container_name: cloudflare_tunnel
image: cloudflare/cloudflared:latest
restart: unless-stopped
command: tunnel run
network_mode: host
environment:
- TUNNEL_TOKEN=
networks:
achllys_nw:
driver: bridge
15 Replies
As long as they share the same token then it will run the same tunnel
is that mean another tunnel was made?
What are the logs for the container?
2024-01-06T01:18:08Z INF Starting tunnel tunnelID=a8a753f4-e3eb-4802-ac95-7bf21877cda9
2024-01-06T01:18:08Z INF Version 2023.10.0
2024-01-06T01:18:08Z INF GOOS: linux, GOVersion: go1.20.6, GoArch: amd64
2024-01-06T01:18:08Z INF Settings: map[no-autoupdate:true]
2024-01-06T01:18:08Z INF Environmental variables map[TUNNEL_TOKEN:*]
2024-01-06T01:18:08Z INF Generated Connector ID:
2024-01-06T01:18:08Z INF Initial protocol quic
2024-01-06T01:18:08Z INF ICMP proxy will use ipv4 as source for IPv4
2024-01-06T01:18:08Z INF ICMP proxy will use mac adress in zone eth0 as source for IPv6
2024-01-06T01:18:08Z INF Starting metrics server on 127.0.0.1:port/metrics
2024/01/06 01:18:08 failed to sufficiently increase receive buffer size (was: 208 kiB, wanted: 2048 kiB, got: 416 kiB). See https://github.com/quic-go/quic-go/wiki/UDP-Receive-Buffer-Size for details.
2024-01-06T01:18:08Z INF Registered tunnel connection connIndex=0 connection=0ade3085-be61-44c8-a672-f8e128228409 event=0 ip=ipv4 location=yyz03 protocol=quic
2024-01-06T01:18:09Z INF Registered tunnel connection connIndex=1 connection=f5ea9ecd-1669-42ef-b5d6-6c0c7fa6d77b event=0 ip=ipv4 location=ord02 protocol=quic
2024-01-06T01:18:09Z INF Updated to new configuration config="{"ingress":[{"hostname":"secure.achllys.net","originRequest":{},"service":""},{"hostname":"moniter.achllys.net","originRequest":{},"service":"http://ipv4\"},{\"hostname\":\" notes.achllys.net","originRequest":{},"service":"https://ipv4\"},{\"service\":\"http_status:404\"}],\"warp-routing\":{\"enabled\":false}}" version=8
2024-01-06T01:18:10Z INF Registered tunnel connection connIndex=2 connection=605ec42a-d506-49f5-8b49-4492bebc0fe2 event=0 ip=ipv4 location=yyz01 protocol=quic
2024-01-06T01:18:11Z INF Registered tunnel connection connIndex=3 connection=fbc89a76-1026-437d-a95a-600746842245 event=0 ip=ipv4 location=ord12 protocol=quic
2024-01-06T01:20:21Z INF Updated to new configuration config="{"ingress":[{"hostname":"secure.achllys.net","originRequest":{},"service":"http://ipv4\"},{\"hostname\":\"moniter.achllys.net\",\"originRequest\":{},\"service\":\"http://ipv4\"},{\"hostname\":\" notes.achllys.net","originRequest":{},"service":"http://ipv4\"},{\"service\":\"http_status:404\"}],\"warp-routing\":{\"enabled\":false}}" version=9
root@localhost:~/notes#
GitHub
UDP Receive Buffer Size
A QUIC implementation in pure go. Contribute to quic-go/quic-go development by creating an account on GitHub.
That looks like it is using the tunnel token correctly. It that the config you're expecting? If so, what behavior are you seeing
'
there is two tunnels for some reason I think?
The
serence_buck
seems like a docker run one as it has a random name, unless it means something to you.Just noticed that and fixed it now it's giving me this
Error response from daemon: Conflict. The container name "/serene_buck" is already in use by container "7a03a8d35b618ccf1d082a6a2a58330f6001972e75c351abef3db3815c3b8004". You have to remove (or rename) that container to be able to reuse that name.
I want to connect the container to it, thought for some reason it won't let me?
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/London
ports:
- "80:8086"
- "443:4432"
restart: unless-stopped
networks:
- custom_bridge_network # Connect to a user-defined bridge network
cloudflare_tunnel:
container_name: serene_buck
image: cloudflare/cloudflared:2021.2.1
restart: unless-stopped
command: tunnel run --name serene_buck
environment:
- TUNNEL_TOKEN=
networks:
- custom_bridge_network # Connect to the same user-defined bridge network
networks:
custom_bridge_network:
driver: bridge
I've also tried this same issue. version: '3.2'
services:
heimdall:
container_name: heimdall
image: linuxserver/heimdall
volumes:
- /home/user/appdata/heimdall:/config
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/London
ports:
- "80:8086"
- "443:4432"
restart: unless-stopped
networks:
- cloudflare_tunnel_network # Connect to the existing network
cloudflare_tunnel:
container_name: serene_buck
image: cloudflare/cloudflared:2021.2.1
restart: unless-stopped
command: tunnel run --name serene_buck
environment:
- TUNNEL_TOKEN=
networks:
- cloudflare_tunnel_network
networks:
cloudflare_tunnel_network:
driver: bridge
Oh those are two seperate tunnels for two separate projects, so they should have different tokens.
do you need to make need tunnels for each compose?
Only one file can define the network and the other one has to mark it as external. You might be better combining the heimdall and trilium to a single compose file with the tunnel container
I have one compose file that has like 10 containers from it all sharing one tunnel. It is easier to have seperate tunnels if using compose files
Is that bad practice?
Tunnel per compose project make it easier to manage the tunnel and the networking. It is what I use but have multiple containers in the tunnel