Giter Site home page Giter Site logo

Comments (3)

pm-melo avatar pm-melo commented on May 18, 2024

Hey,

I just did this setup for my own deployment. As a disclaimer, I did not follow everything as is because my setup is a bit different but hopefully I can help a bit.

So, instead of using PiHole I'm using Adguard Home on my server. Because my network is not configured (yet) to use this DNS server I had to manually make the server use it. Also, my laptop is also configured to use this DNS server.

Now, for my setup, as I don't have Proxmox, I setup Home Assistant (again) to be able to reach it externally. To do that I setup a DNS entry (on cloudflare on my case) that points to my public IP address. I also added a CNAME record to the same A record. Then, on the Traefik's config file I added the router with my host and the service that acts as a load balancer.
The router determines the host name that the proxy answers to while the service redirects the client to the correct IP and Port in your network. For this to work you need to add the service to the router entry.

Here's an example:

http:

 #region routers 
  routers:
    home-assistant:
      entryPoints:
        - "https"
      rule: "Host(`homeassistant.mydomain.com`)"
      tls: {}
      service: home-assistant-service
#endregion
#region services
  services:
    home-assistant-service:
      loadBalancer:
        servers:
          - url: "http://192.168.0.10:8123"
        passHostHeader: true
#endregion

Don't forget to port forward external connections directly to your Traefik instance in your router!

This makes it possible to be outside, hit whatever URL you set and the following happens:

  1. Cloudflare (or your DNS provider) redirects the request to your house (your external IP)
  2. Your router redirects external connections to your Traefik instance (watchout for the correct ports!)
  3. Traefik analyses the incoming connections and redirects them to the correct service (defined in your config file)
  4. The service forwards the request to the final component!

Hope it helps!

from techno-tim.github.io.

Qpernicus avatar Qpernicus commented on May 18, 2024

Hey,

I just did this setup for my own deployment. As a disclaimer, I did not follow everything as is because my setup is a bit different but hopefully I can help a bit.

So, instead of using PiHole I'm using Adguard Home on my server. Because my network is not configured (yet) to use this DNS server I had to manually make the server use it. Also, my laptop is also configured to use this DNS server.

Now, for my setup, as I don't have Proxmox, I setup Home Assistant (again) to be able to reach it externally. To do that I setup a DNS entry (on cloudflare on my case) that points to my public IP address. I also added a CNAME record to the same A record. Then, on the Traefik's config file I added the router with my host and the service that acts as a load balancer.

The router determines the host name that the proxy answers to while the service redirects the client to the correct IP and Port in your network. For this to work you need to add the service to the router entry.

Here's an example:


http:



 #region routers 

  routers:

    home-assistant:

      entryPoints:

        - "https"

      rule: "Host(`homeassistant.mydomain.com`)"

      tls: {}

      service: home-assistant-service

#endregion

#region services

  services:

    home-assistant-service:

      loadBalancer:

        servers:

          - url: "http://192.168.0.10:8123"

        passHostHeader: true

#endregion

Don't forget to port forward external connections directly to your Traefik instance in your router!

This makes it possible to be outside, hit whatever URL you set and the following happens:

  1. Cloudflare (or your DNS provider) redirects the request to your house (your external IP)

  2. Your router redirects external connections to your Traefik instance (watchout for the correct ports!)

  3. Traefik analyses the incoming connections and redirects them to the correct service (defined in your config file)

  4. The service forwards the request to the final component!

Hope it helps!

Hey thx for you reply! Although it is useful info (using Home Assistant as well) I am referring to the part of the video where Tim mentioned he is using pihole for internal DNS as well as external through traefik.. I got the external part working but when internal is activated it stops working/blocks external or something. I assumed he put homeassistant.mydomain.com in pihole and point it to... well. Which IP?

from techno-tim.github.io.

pm-melo avatar pm-melo commented on May 18, 2024

The IP of the proxy. All records on the DNS (both external and internal) go to the proxy

from techno-tim.github.io.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.