alexbelgium / hassio-addons

My homeassistant addons
MIT License
1.56k stars 223 forks source link

🐛 [Webtrees] Reverse proxy appends port to the hostname #1641

Open matthewturk opened 4 days ago

matthewturk commented 4 days ago

Description

Hi there! I'm trying to use Webtrees from behind an nginx reverse proxy that manages the SSL for me. Specifically, I have a subdomain, SOMETHING.ANOTHER.ORG that points to my nginx proxy manager instance, where I'm adding SSL and pointing at the internal 9999 port.

The base_url I have set in my webtrees config is https://SOMETHING.ANOTHER.ORG/ . (It seems to be the same with or without the trailing slash, for what it's worth.)

When I visit, it tries to load a bunch of assets from the URL scheme https://SOMETHING.ANOTHER.ORG/:9999/ -- which don't exist.

Is there a way to specify also that Webtrees should not be modifying the port based on the externally-open port? It looks like it knows the port number and is trying to expose that, when really leaving it alone should be OK. (I think?)

Reproduction step

Addon Logs

-----------------------------------------------------------
 Add-on: Webtrees
 web's leading on-line collaborative genealogy application
-----------------------------------------------------------
 Add-on version: 2.1.20
 You are running the latest version of this add-on.
 System: Home Assistant OS 13.2  (aarch64 / raspberrypi4-64)
 Home Assistant Core: 2024.11.2
 Home Assistant Supervisor: 2024.11.2
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums
-----------------------------------------------------------
 Provided by: https://github.com/alexbelgium/hassio-addons 
-----------------------------------------------------------
/etc/cont-init.d/00-global_var.sh: executing
BASE_URL='https://BASEURL/'
CONFIG_LOCATION='/config/addons_config/webtrees/config.yaml'
DB_TYPE='sqlite'
certfile='fullchain.pem'
keyfile='privkey.pem'
ssl='false'
Timezone set from Etc/UTC to America/Chicago
/etc/cont-init.d/00-local_mounts.sh: executing
/etc/cont-init.d/00-smb_mounts.sh: executing
/etc/cont-init.d/01-config_yaml.sh: executing
Setting permissions for the config.yaml directory
Load environment variables from /config/addons_config/webtrees/config.yaml if existing
If accessing the file with filebrowser it should be mapped to /homeassistant/addons_config/webtrees/config.yaml
---------------------------------------------------------
Wiki here on how to use : github.com/alexbelgium/hassio-addons/wiki/Add‐ons-feature-:-add-env-variables
... no env variables found, exiting
/etc/cont-init.d/01-custom_script.sh: executing
Execute /homeassistant/addons_config/webtrees/webtrees.sh if existing
Wiki here : github.com/alexbelgium/hassio-addons/wiki/Add-ons-feature-:-customisation
/etc/cont-init.d/99-run.sh: executing
[15:43:41] INFO: Defining database
[15:43:41] INFO: Using a local sqlite database /data/webtrees/webtrees
... update data with image
[15:43:42] INFO: Launching app, please wait
... update permissions
... make links with data in /share
... linking data
... linking modules_v4
... align base url with latest addon value
Aligning base_url addon config
[15:43:43] INFO: Aligning trusted_headers addon config with cf-connecting-ip
[15:43:43] INFO: Data is stored in /share/webtrees
[15:43:43] INFO: Webui can be accessed at : http://BASEURL/:9999
[15:43:43] INFO: If it is your first boot, the start-up wizard will open
python3 /docker-entrypoint.py
[NV_INIT] PRETTY_URLS found in environment variables
[NV_INIT] HTTPS found in environment variables
[NV_INIT] HTTPS_REDIRECT found in environment variables
[NV_INIT] SSL_CERT_FILE NOT found in environment variables, using default: /certs/webtrees.crt
[NV_INIT] SSL_CERT_KEY_FILE NOT found in environment variables, using default: /certs/webtrees.key
[NV_INIT] BASE_URL found in environment variables
[NV_INIT] LANG found in environment variables
[NV_INIT] DB_TYPE found in environment variables
[NV_INIT] DB_HOST found in environment variables
[NV_INIT] DB_PORT found in environment variables
[NV_INIT] DB_USER found in environment variables
[NV_INIT] DB_PASS found in environment variables
[NV_INIT] DB_NAME found in environment variables
[NV_INIT] DB_PREFIX found in environment variables
[NV_INIT] WT_USER found in environment variables
[NV_INIT] WT_NAME found in environment variables
[NV_INIT] WT_PASS found in environment variables
[NV_INIT] WT_EMAIL found in environment variables
[NV_INIT] DB_KEY NOT found in environment variables, using default: None
[NV_INIT] DB_CERT NOT found in environment variables, using default: None
[NV_INIT] DB_CA NOT found in environment variables, using default: None
[NV_INIT] DB_VERIFY NOT found in environment variables, using default: None
[NV_INIT] PHP_MEMORY_LIMIT NOT found in environment variables, using default: 1024M
[NV_INIT] PHP_MAX_EXECUTION_TIME NOT found in environment variables, using default: 90
[NV_INIT] PHP_POST_MAX_SIZE NOT found in environment variables, using default: 50M
[NV_INIT] PHP_UPLOAD_MAX_FILE_SIZE NOT found in environment variables, using default: 50M
[NV_INIT] PUID NOT found in environment variables, using default: 33
[NV_INIT] PGID NOT found in environment variables, using default: 33
[NV_INIT] Setting up folder permissions for uploads
usermod: no changes
[NV_INIT] Updating php.ini
[NV_INIT] Creating php.ini
[NV_INIT] Setting value for memory_limit in php.ini
[NV_INIT] Setting value for max_execution_time in php.ini
[NV_INIT] Setting value for post_max_size in php.ini
[NV_INIT] Setting value for upload_max_filesize in php.ini
[NV_INIT] Updating config file
[NV_INIT] Setting value for rewrite_urls in config
[NV_INIT] Setting value for base_url in config
[NV_INIT] Setting value for dbtype in config
[NV_INIT] Setting value for dbhost in config
[NV_INIT] Setting value for dbport in config
[NV_INIT] Setting value for dbuser in config
[NV_INIT] Setting value for dbpass in config
[NV_INIT] Setting value for dbname in config
[NV_INIT] Setting value for tblpfx in config
[NV_INIT] Configuring HTTPS
[NV_INIT] Removing HTTPS
[NV_INIT] Disabling site webtrees-redir
Site webtrees-redir already disabled
[NV_INIT] Disabling site webtrees-ssl
Site webtrees-ssl already disabled
[NV_INIT] Enabling site webtrees
Enabling site webtrees.
To activate the new configuration, you need to run:
  service apache2 reload
[NV_INIT] Setting up folder permissions for uploads
usermod: no changes
[NV_INIT] Starting Apache
[Sun Nov 17 15:43:44.344817 2024] [mpm_prefork:notice] [pid 385] AH00163: Apache/2.4.57 (Debian) PHP/8.1.27 OpenSSL/3.0.11 configured -- resuming normal operations
[Sun Nov 17 15:43:44.344941 2024] [core:notice] [pid 385] AH00094: Command line: 'apache2 -D FOREGROUND'
webtrees:80 127.0.0.1 - - [17/Nov/2024:15:44:06 -0600] "GET / HTTP/1.1" 302 658 "-" "curl/7.88.1"
webtrees:80 127.0.0.1 - - [17/Nov/2024:15:44:37 -0600] "GET / HTTP/1.1" 302 658 "-" "curl/7.88.1"
webtrees:80 172.30.32.1 - - [17/Nov/2024:15:45:05 -0600] "GET / HTTP/1.1" 302 525 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36"
webtrees:80 172.30.32.1 - - [17/Nov/2024:15:45:06 -0600] "GET / HTTP/1.1" 302 525 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36"
webtrees:80 127.0.0.1 - - [17/Nov/2024:15:45:07 -0600] "GET / HTTP/1.1" 302 658 "-" "curl/7.88.1"
webtrees:80 127.0.0.1 - - [17/Nov/2024:15:45:38 -0600] "GET / HTTP/1.1" 302 658 "-" "curl/7.88.1"
webtrees:80 127.0.0.1 - - [17/Nov/2024:15:46:09 -0600] "GET / HTTP/1.1" 302 658 "-" "curl/7.88.1"
webtrees:80 127.0.0.1 - - [17/Nov/2024:15:46:39 -0600] "GET / HTTP/1.1" 302 658 "-" "curl/7.88.1"
webtrees:80 127.0.0.1 - - [17/Nov/2024:15:47:10 -0600] "GET / HTTP/1.1" 302 658 "-" "curl/7.88.1"
webtrees:80 127.0.0.1 - - [17/Nov/2024:15:47:40 -0600] "GET / HTTP/1.1" 302 658 "-" "curl/7.88.1"
webtrees:80 127.0.0.1 - - [17/Nov/2024:15:48:11 -0600] "GET / HTTP/1.1" 302 658 "-" "curl/7.88.1"
webtrees:80 127.0.0.1 - - [17/Nov/2024:15:48:41 -0600] "GET / HTTP/1.1" 302 658 "-" "curl/7.88.1"
webtrees:80 127.0.0.1 - - [17/Nov/2024:15:49:12 -0600] "GET / HTTP/1.1" 302 658 "-" "curl/7.88.1"
webtrees:80 127.0.0.1 - - [17/Nov/2024:15:49:42 -0600] "GET / HTTP/1.1" 302 658 "-" "curl/7.88.1"
webtrees:80 127.0.0.1 - - [17/Nov/2024:15:50:13 -0600] "GET / HTTP/1.1" 302 658 "-" "curl/7.88.1"
webtrees:80 127.0.0.1 - - [17/Nov/2024:15:50:43 -0600] "GET / HTTP/1.1" 302 658 "-" "curl/7.88.1"
webtrees:80 127.0.0.1 - - [17/Nov/2024:15:51:14 -0600] "GET / HTTP/1.1" 302 658 "-" "curl/7.88.1"
webtrees:80 127.0.0.1 - - [17/Nov/2024:15:51:45 -0600] "GET / HTTP/1.1" 302 658 "-" "curl/7.88.1"
 Live

Architecture

armv7

OS

HAos