mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-10 18:01:03 +01:00
Ingress try
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
- Addition of ingress, first try
|
||||
|
||||
## v2.1.0 (02-11-2024)
|
||||
- Update to latest version from hay-kot/mealie (changelog : https://github.com/hay-kot/mealie/releases)
|
||||
|
||||
## v2.0-beta5 (15-10-2024)
|
||||
- Applied new homeassistant config logic, which will allow in the future all Mealie data to be backuped with the addon. All data (+ config) is moved to /addon_configs/db21ed7f_mealie ; the initial data currently in /homeassistant/addons_config/mealie_data and config in /homeassistant/addons_config/mealie will not be moved but a "migrated" file will be added to those folders to show that migration occured. From now on, only data in /addon_configs/db21ed7f_mealie will be used.
|
||||
- If it doesn't load, there was perhaps an issue with the migration with a previous version. The solution : go in the Filebrowser addon, open the path /config/db21ed7f_mealie, move everything there in a new folder named old. Go then in the path /homeassistant/addons_config/mealie_data and remove the file named migrated. Restart the addon, and the migration will occur again
|
||||
@@ -8,7 +10,7 @@
|
||||
- Logic change in terms of files :
|
||||
|
||||
Previous logic :
|
||||
- Paths within container :
|
||||
- Paths within container :
|
||||
- Data: /config/addons_config/mealie_data
|
||||
- Injector script: /config/addons_autoscripts/mealie.sh
|
||||
- Env file : /config/addons_autoscripts/mealie/config.yaml
|
||||
@@ -18,8 +20,8 @@
|
||||
- Env file : /homeassistant/addons_autoscripts/mealie/config.yaml
|
||||
- Addon option : DATA_DIR="/config/addons_config/mealie_data"
|
||||
|
||||
New logic :
|
||||
- Paths within container :
|
||||
New logic :
|
||||
- Paths within container :
|
||||
- Data: /config
|
||||
- Injector script: /config/mealie.sh
|
||||
- Env file : /config/config.yaml
|
||||
@@ -36,8 +38,6 @@
|
||||
## v2.0-beta (10-10-2024)
|
||||
- Switched to v2.0 beta, should hopefully solve everyone's issues!
|
||||
|
||||
## v1.12.0-4 (22-09-2024)
|
||||
- Minor bugs fixed
|
||||
## v1.12.0-3 (22-09-2024)
|
||||
- Another version with 1.12 to try to solve issues with config not recognized
|
||||
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
"/dev/nvme2"
|
||||
],
|
||||
"environment": {
|
||||
"BASE_SUBPATH": "/mealie/",
|
||||
"DATA_DIR": "/config",
|
||||
"DB_ENGINE": "sqlite",
|
||||
"MAX_WORKERS": "1",
|
||||
@@ -73,6 +74,7 @@
|
||||
"WORKERS_PER_CORE": "0.5"
|
||||
},
|
||||
"image": "ghcr.io/alexbelgium/mealie-{arch}",
|
||||
"ingress": true,
|
||||
"map": [
|
||||
"addon_config:rw",
|
||||
"homeassistant_config:rw",
|
||||
@@ -110,6 +112,5 @@
|
||||
"slug": "mealie",
|
||||
"udev": true,
|
||||
"url": "https://github.com/alexbelgium/hassio-addons",
|
||||
"version": "v2.1.0",
|
||||
"webui": "[PROTO:ssl]://[HOST]:[PORT:9001]"
|
||||
"version": "v2.1.0-ingress"
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ set -e
|
||||
|
||||
if bashio::config.true 'ssl'; then
|
||||
|
||||
bashio::log.info "Add ssl"
|
||||
|
||||
# Validate ssl
|
||||
bashio::config.require.ssl
|
||||
|
||||
@@ -19,3 +21,15 @@ else
|
||||
sed -i "/ssl/d" /etc/nginx/servers/ssl.conf
|
||||
|
||||
fi
|
||||
|
||||
bashio::log.info "Adapting for ingress"
|
||||
|
||||
ingress_port=$(bashio::addon.ingress_port)
|
||||
ingress_interface=$(bashio::addon.ip_address)
|
||||
ingress_entry=$(bashio::addon.ingress_entry)
|
||||
base_path="/mealie/"
|
||||
sed -i "s|%%port%%|${ingress_port}|g" /etc/nginx/servers/ingress.conf
|
||||
sed -i "s|%%interface%%|${ingress_interface}|g" /etc/nginx/servers/ingress.conf
|
||||
sed -i "s|%%ingress_entry%%|${ingress_entry}|g" /etc/nginx/servers/ingress.conf
|
||||
sed -i "s|%%base_subpath%%|${base_path}|g" /etc/nginx/servers/ingress.conf
|
||||
sed -i "s|%%base_subpath%%|${base_path}|g" /etc/nginx/servers/ssl.conf
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
proxy_http_version 1.1;
|
||||
proxy_ignore_client_abort off;
|
||||
proxy_read_timeout 86400s;
|
||||
proxy_redirect off;
|
||||
#proxy_redirect off;
|
||||
proxy_send_timeout 86400s;
|
||||
proxy_max_temp_file_size 0;
|
||||
|
||||
|
||||
40
mealie/rootfs/etc/nginx/servers/ingress.conf
Normal file
40
mealie/rootfs/etc/nginx/servers/ingress.conf
Normal file
@@ -0,0 +1,40 @@
|
||||
server {
|
||||
listen %%interface%%:%%port%% default_server;
|
||||
include /etc/nginx/includes/server_params.conf;
|
||||
include /etc/nginx/includes/proxy_params.conf;
|
||||
|
||||
# https://emby.media/community/index.php?/topic/104238-playback-error-no-compatible-streams-are-currently-available/&do=findComment&comment=1097946
|
||||
proxy_buffering off;
|
||||
gzip_static off;
|
||||
client_max_body_size 0;
|
||||
|
||||
location / {
|
||||
# Proxy pass
|
||||
proxy_pass http://localhost:9000;
|
||||
|
||||
# Next three lines allow websockets
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
|
||||
# Improve ip handling
|
||||
proxy_hide_header X-Powered-By;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header Accept-Encoding "";
|
||||
proxy_read_timeout 90;
|
||||
add_header X-Frame-Options "SAMEORIGIN";
|
||||
add_header 'Referrer-Policy' 'no-referrer';
|
||||
|
||||
# Correct base_url
|
||||
absolute_redirect off;
|
||||
proxy_redirect / %%ingress_entry%%/;
|
||||
sub_filter_once off;
|
||||
sub_filter_types *;
|
||||
sub_filter %%base_subpath%% %%ingress_entry%%/;
|
||||
sub_filter 'href="/"' 'href="%%ingress_entry%%/"';
|
||||
sub_filter '"\/"' '"%%ingress_entry%%\/"';
|
||||
}
|
||||
|
||||
}
|
||||
@@ -23,6 +23,12 @@
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header Accept-Encoding "";
|
||||
proxy_read_timeout 90;
|
||||
|
||||
# Correct base_url
|
||||
sub_filter_once off;
|
||||
sub_filter_types *;
|
||||
sub_filter %%base_subpath%% /;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user