From 69be40955295d49ff2ec65e072f176c310149f96 Mon Sep 17 00:00:00 2001 From: thelamer Date: Sat, 24 Feb 2024 15:46:39 -0800 Subject: [PATCH] add new port settings for webapp and asset server --- README.md | 7 +++++++ readme-vars.yml | 3 +++ root/defaults/default | 2 +- root/etc/s6-overlay/s6-rc.d/init-nginx-config/run | 4 ++++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3f8ebc2..76020a9 100644 --- a/README.md +++ b/README.md @@ -172,6 +172,8 @@ services: - MENU_VERSION=1.9.9 #optional - PORT_RANGE=30000:30010 #optional - SUBFOLDER=/ #optional + - NGINX_PORT=80 #optional + - WEB_APP_PORT=3000 #optional volumes: - /path/to/config:/config - /path/to/assets:/assets #optional @@ -193,6 +195,8 @@ docker run -d \ -e MENU_VERSION=1.9.9 `#optional` \ -e PORT_RANGE=30000:30010 `#optional` \ -e SUBFOLDER=/ `#optional` \ + -e NGINX_PORT=80 `#optional` \ + -e WEB_APP_PORT=3000 `#optional` \ -p 3000:3000 \ -p 69:69/udp \ -p 8080:80 `#optional` \ @@ -217,6 +221,8 @@ Containers are configured using parameters passed at runtime (such as those abov | `-e MENU_VERSION=1.9.9` | Specify a specific version of boot files you want to use from NETBOOT.XYZ (unset pulls latest) | | `-e PORT_RANGE=30000:30010` | Specify the port range tftp will use for data transfers [(see Wikipedia)](https://en.wikipedia.org/wiki/Trivial_File_Transfer_Protocol#Details) | | `-e SUBFOLDER=/` | Specify a sobfolder if running this behind a reverse proxy (IE /proxy/) | +| `-e NGINX_PORT=80` | Specify a different internal port for the asset server | +| `-e WEB_APP_PORT=3000` | Specify a different internal port for the configuration UI | | `-v /config` | Storage for boot menu files and web application config | | `-v /assets` | Storage for NETBOOT.XYZ bootable assets (live CDs and other files) | @@ -381,6 +387,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **24.02.24:** - Add new port settings for the webserver and app. * **08.12.23:** - Rebase to Alpine 3.19. * **17.11.23:** - Rebase to Alpine 3.18. * **01.07.23:** - Deprecate armhf. As announced [here](https://www.linuxserver.io/blog/a-farewell-to-arm-hf) diff --git a/readme-vars.yml b/readme-vars.yml index 2a72219..484a47b 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -32,6 +32,8 @@ opt_param_env_vars: - {env_var: "MENU_VERSION", env_value: "1.9.9", desc: "Specify a specific version of boot files you want to use from NETBOOT.XYZ (unset pulls latest)"} - {env_var: "PORT_RANGE", env_value: "30000:30010", desc: "Specify the port range tftp will use for data transfers [(see Wikipedia)](https://en.wikipedia.org/wiki/Trivial_File_Transfer_Protocol#Details)"} - {env_var: "SUBFOLDER", env_value: "/", desc: "Specify a sobfolder if running this behind a reverse proxy (IE /proxy/)"} + - {env_var: "NGINX_PORT", env_value: "80", desc: "Specify a different internal port for the asset server"} + - {env_var: "WEB_APP_PORT", env_value: "3000", desc: "Specify a different internal port for the configuration UI"} opt_param_usage_include_ports: true opt_param_ports: - {external_port: "8080", internal_port: "80", port_desc: "NGINX server for hosting assets."} @@ -128,6 +130,7 @@ app_setup_block: | # changelog changelogs: + - {date: "24.02.24:", desc: "Add new port settings for the webserver and app."} - {date: "08.12.23:", desc: "Rebase to Alpine 3.19."} - {date: "17.11.23:", desc: "Rebase to Alpine 3.18."} - {date: "01.07.23:", desc: "Deprecate armhf. As announced [here](https://www.linuxserver.io/blog/a-farewell-to-arm-hf)"} diff --git a/root/defaults/default b/root/defaults/default index a5a0a08..b1bb605 100644 --- a/root/defaults/default +++ b/root/defaults/default @@ -1,5 +1,5 @@ server { - listen 80; + listen REPLACE_PORT; location / { root /assets; autoindex on; diff --git a/root/etc/s6-overlay/s6-rc.d/init-nginx-config/run b/root/etc/s6-overlay/s6-rc.d/init-nginx-config/run index f28f487..6e704f3 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-nginx-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-nginx-config/run @@ -15,6 +15,10 @@ if [[ ! -f /config/nginx/nginx.conf ]]; then fi if [[ ! -f /config/nginx/site-confs/default ]]; then + if [ -z ${NGINX_PORT+x} ]; then + NGINX_PORT=80 + fi + sed -i "s/REPLACE_PORT/$NGINX_PORT/g" /defaults/default cp /defaults/default /config/nginx/site-confs/default fi