hoarder-app / hoarder

A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search
https://hoarder.app
GNU Affero General Public License v3.0
6.63k stars 240 forks source link

Doc Update: Running behind a reverse proxy #501

Open anselor opened 1 month ago

anselor commented 1 month ago

I tried to set up hoarder behind traefik handling cert renewal and TLS. Here are the changes needed that probably should be captured somehow in the docs. Consider just adding the hoarder_net to the example compose file.

I needed to add the hoarder web container to the traefik docker network and then define a new network to connect all of the hoard containers. Added this to the compose file:

networks:
  traefik_net:
    external: true
  hoarder_net:
    driver: bridge
``
and for each container add:
networks:
  - hoarder_net``

Except the hoarder web container add both:

    networks:
      - hoarder_net
      - traefik_net

Also, for the for the hoader web container to register with traefik:

    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.hoarder.rule=Host(`hoarder.home.lan`)"
      - "traefik.http.routers.hoarder.entrypoints=websecure"
      - "traefik.http.routers.hoarder.tls=true"
      - "traefik.http.routers.hoarder.tls.certresolver=myresolver"
      - "traefik.http.services.hoarder.loadbalancer.server.port=3000"
liquidmetal-Hg commented 1 month ago

Thank you for your comment. I was actually wondering how I could put Hoarder behind Traefik. Traefik is accepting routers without a problem with your help but I am getting an error "application error: a server-side exception has occurred" when I am entering my website in to the browser. I think the problem is around .env variable. Could you please share your .env file or snippet of environment variable? Or whole YAML-file? I am not sure what variables should be in the .env file and what should be in the environment field. Some of them are overlapping.