Git Product home page Git Product logo

Comments (4)

NathanVaughn avatar NathanVaughn commented on July 22, 2024 1

Interesting, I'll add the note about setting SERVER_URL to the database. Webtrees is definitely a little finnicky about running behind a reverse proxy.

from webtrees-docker.

NathanVaughn avatar NathanVaughn commented on July 22, 2024
  1. I'm not sure if it's necessary anymore, I had this issue a long time ago setting up webtrees so I added that comment in case anyone else ran into it. The http was intentional, yes. At the time, it didn't like it when I set that to https. In my own installation of webtrees behind a reverse proxy, I have both LOGIN_URL and SERVER_URL set to the external address with https and it works fine
  2. I'm not sure, I haven't had any issues with Cloudflare needing to trust proxies
  3. That's only if you want the Apache server inside the container to serve the site via HTTPS. Really, I don't recommend this. I personally use Traefik as a reverse proxy in front of all my web apps to manage the SSL certificates with Let's Encrypt. If you really want to generate these, this answer on stackoverflow show be what you need, along with some file re-naming. Though, you're going to get self-signed certificate errors
  4. PRETTY_URLS doesn't do anything other make the URLs look nicer. HTTPS_REDIRECT isn't necessary, but if you have HTTPS enabled, it redirects from HTTP to HTTPS automatically. You issue here likely is BASE_URL. That absolutely must be the domain/hostname you're accessing webtrees by. For example with my own installation, while you could access it via http://localdockerip:80 I access it as https://webtrees.nathanv.app, so I set BASE_URL to that.
  5. I'm not familiar with nginx, sorry.
  6. Anything that starts with DB is used every time you start the container to generate a config file for webtrees to connect to the database, so that's fine. It's anything that starts with WT is used exactly once to initialize the database with the first user account. There's no changes needed there to externalize it. The only two things you might need to change are LOGIN_URL and SERVER_URL in the table wt_site_setting as discussed above. I'm not positive is webtrees changes this automatically from the config file.

My own docker-compose.yml for reference:

version: '3'

services:
  app:
    env_file:
      - ./.env
    image: ghcr.io/nathanvaughn/webtrees:latest
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.webtrees.rule=Host(`webtrees.nathanv.app`)"
      - "traefik.http.routers.webtrees.service=webtrees"
      - "traefik.http.services.webtrees.loadbalancer.server.port=80"
      - "traefik.http.routers.webtrees.entrypoints=secure"
      - "traefik.http.routers.webtrees.tls=true"
      - "traefik.http.routers.webtrees.tls.certresolver=le"
      - "traefik.http.routers.webtrees.tls.domains[0].sans=*.nathanv.app"
    networks:
      - db_net
      - proxy_net
    restart: unless-stopped
    volumes:
      - app_data:/var/www/webtrees/data/
      - app_media:/var/www/webtrees/media/
      - app_modules:/var/www/webtrees/modules_v4/
      - /etc/localtime:/etc/localtime
      - /etc/timezone:/etc/timezone

volumes:
  app_data:
    driver: local
  app_media:
    driver: local
  app_modules:
    driver: local

networks:
  db_net:
    external: true
  proxy_net:
    external: true

And .env

PRETTY_URLS=1
LANG=en-US
BASE_URL=https://webtrees.nathanv.app
DB_TYPE=mysql
DB_HOST=mariadb
DB_PORT=3306
DB_USER=webtrees
DB_PASS=<databasepassword>
DB_NAME=webtrees
DB_PREFIX=wt_
WT_USER=nathan
WT_NAME="Nathan Vaughn"
WT_PASS=<userpassword>
WT_EMAIL=<useremail>

from webtrees-docker.

NathanVaughn avatar NathanVaughn commented on July 22, 2024

Closing due to several months with no response

from webtrees-docker.

AlexKalopsia avatar AlexKalopsia commented on July 22, 2024

Hi Nathan,

I somehow missed all the replies. Just wanted to let you know that I eventually managed to make this work. The only thing I did were:

  1. Manually add LOGIN_URL to the database, and make it point to https://tree.mydomain.com
  2. Manually add SERVER_URL to the database, and make it point to https://tree.mydomain.com
  3. Set BASE_URL to https://tree.mydomain.com
  4. Set PRETTY_URLS to 1

Thanks again for the support

from webtrees-docker.

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.