Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pihole (on a remote host) #168

Closed
fabricesemti80 opened this issue May 11, 2021 · 2 comments
Closed

Pihole (on a remote host) #168

fabricesemti80 opened this issue May 11, 2021 · 2 comments

Comments

@fabricesemti80
Copy link

fabricesemti80 commented May 11, 2021

Hi There!

Great guide, thanks for the effort!

I have one problem though.

I try to forward some services (for starters I am trying to do this with PiHole) to another (k8s) server on my network, but I am struggling to make this work.

My Docker server runs on 192.168.0.21, the k8s hosts are on 192.168.0.11 - .13, and the loadbalancer range for k8s is 192.168.0.240 - .250. PiHole is on 192.168.0.242, and it is accessible within my network.

I have this configuration in the the docker compose:

`...

Cloudflare-Companion - Automatic CNAME DNS Creation

cf-companion:
container_name: cf-companion
image: tiredofit/traefik-cloudflare-companion:latest
# security_opt:
# - no-new-privileges:true
restart: unless-stopped
networks:
- socket_proxy
#depends_on:
# - socket-proxy
environment:
- TIMEZONE=$TZ
- TRAEFIK_VERSION=2
#- CF_EMAIL=$CLOUDFLARE_EMAIL
- CF_TOKEN=$CLOUDFLARE_API_TOKEN
- TARGET_DOMAIN=$DOMAINNAME0
- DOMAIN1=$DOMAINNAME0
- DOMAIN1_ZONE_ID=$CLOUDFLARE_ZONEID # Copy from Cloudflare Overview page
- DOMAIN1_PROXIED=TRUE
- DOCKER_HOST=tcp://socket-proxy:2375
secrets: # not working
- cloudflare_api_token
labels:
# Add hosts specified in rules here to force cf-companion to create the CNAMEs
# Since cf-companion creates CNAMEs based on host rules, this a workaround for non-docker/external apps
# - "traefik.http.routers.cf-companion-rtr.rule=Host(mox.$DOMAINNAME0) || Host(pwt.$DOMAINNAME0) || Host(webmin.$DOMAINNAME0) || Host(shell.$DOMAINNAME0)"
- "traefik.http.routers.cf-companion-rtr.rule=Host(plex.$DOMAINNAME0) || Host(pihole.$DOMAINNAME0)" `

 (plex router does not work either, but for now I am focusing on PiHole)
 
 the app-pihole.toml rule is set as this:

[http.routers] [http.routers.pihole-rtr] entryPoints = ["https"] middlewares = ["chain-authelia", "pihole-add-admin"] rule = "HostHeader(pihole.<mydomain.com>`)"
service = "pihole-svc"
[http.routers.pihole-rtr.tls]
certresolver = "dns-cloudflare"

[http.middlewares]
[http.middlewares.pihole-add-admin.addPrefix]
prefix = "/admin"

[http.services]
[http.services.pihole-svc]
[http.services.pihole-svc.loadBalancer]
passHostHeader = true
[[http.services.pihole-svc.loadBalancer.servers]]
url = "http://192.168.0.242:80" # or whatever your external host's IP:port is`

I can confirm the pihole.<mydomain.com> DNS entry gets created, but when I would browse to that address, I get HTTP error 500...

Any chance you can advise what am I missing?

Thanks,
Fabrice

@techie2000
Copy link

Hi @fabricesemti80 I don't think your issue report is actually an 'issue' with the software. See #277 and perhaps consider closing this (none) issue?

@fabricesemti80
Copy link
Author

Hi. Sorry this has been a while. Long non-relevant. Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants