I’ve got some funny business going on here which is just doing my head in!
I got stuff working once but I had loads of crap hanging around from before I started trying to follow these recipes, so I very stupidly rebuilt my server using Ubuntu to start afresh (I tried Atomic but that was just a total mind-bending experience lol)
I’ve got Portainer, Duplicity etc. all working nicely so I know that Traefik is setup properly. However, when it comes to AutoPirate, there seems to be some breakdown between Traefik, OAuth2 and the other services 
If I go to any of my service URLs, I get taken through the GitHub OAuth2 process and a shiny token is spat out the end. However, I never get routed back to the actual container. I just get a blank screen and the oauth proxy logs state:
oauthproxy.go:535: 10.1.0.17:54908 ("xxx.xxx.xxx.xxx") Cookie "_oauth2_proxy" not present
github.go:222: got 200 from "https://api.github.com/user/emails?access_token=3b839c99ca337d1152ab2482a59256exxxxxxxxx" [{"email":"[email protected]","primary":true,"verified":true,"visibility":"private"}]
oauthproxy.go:490: 10.1.0.17:54908 ("xxx.xxx.xxx.xxx") authentication complete Session{[email protected] token:true}
reverseproxy.go:275: http: proxy error: dial tcp xxx.xxx.xxx.xxx:6789: i/o timeout
reverseproxy.go:275: http: proxy error: dial tcp xxx.xxx.xxx.xxx:6789: i/o timeout
reverseproxy.go:275: http: proxy error: dial tcp xxx.xxx.xxx.xxx:6789: i/o timeout
reverseproxy.go:275: http: proxy error: dial tcp xxx.xxx.xxx.xxx:6789: i/o timeout
xxx.xxx.xxx.xxx is the external IP for my domain, I’m guessing that is where the problem lies? At this point I’ve gone over the files so much that Im on the verge of starting again lol
In this example, I’m trying to access my NZBGet URL and the port 6789
is definitely correct and taken straight from the recipe. Its the same for all my AutoPirate URLs though. Anything involving the OAuth proxy just goes nowhere
Here is the NZBGet service taken from my autopirate.yml file:
nzbget:
image: linuxserver/nzbget
env_file: /var/data/config/autopirate/nzbget.env
volumes:
- /var/data/autopirate/nzbget:/config
- /mnt/media:/data
networks:
- traefik_public
nzbget_proxy:
image: zappi/oauth2_proxy
env_file: /var/data/config/autopirate/nzbget.env
networks:
- internal
- traefik_public
deploy:
labels:
- traefik.frontend.rule=Host:nzbget.my.domain.co.uk
- traefik.docker.network=traefik_public
- traefik.port=4180
volumes:
- /var/data/config/autopirate/authenticated-emails.txt:/authenticated-emails.txt
command: |
-cookie-secure=false
-upstream=http://nzbget:6789
-redirect-url=https://nzbget.my.domain.co.uk
-http-address=http://0.0.0.0:4180
-email-domain=my.domain.co.uk
-provider=github
-authenticated-emails-file=/authenticated-emails.txt
And here is the env file:
OAUTH2_PROXY_CLIENT_ID=4935081605exxxxxxxxx
OAUTH2_PROXY_CLIENT_SECRET=bcfcc005ca61d63c51d2f2xxxxxxxxxxxxxxxxxx
OAUTH2_PROXY_COOKIE_SECRET=xxxxxxxxx
PUID=4242
PGID=4242
Any ideas?? I’m going round and round in circles. I’m thinking about starting again but focusing just on Traefik and AutoPirate before worrying about NextCloud etc.