fix(romm): resolve 403 Forbidden error on nginx mod_zip installation (#15134)

* Update Nginx installation and mod_zip configuration

Replaced nginx with nginx-extras and modified Nginx mod_zip installation to use the native Debian module.

* Update source URL for build functions in romm.sh

* Update install script URL in build.func

* Update romm-install.sh for Nginx and mod_zip installation

Updated the installation script to include Nginx and libpcre2-dev, and modified the process for installing the Nginx mod_zip module.

* Install Nginx mod_zip module and create symlinks

Add installation steps for Nginx mod_zip module.

* Modify Nginx installation to use custom modules path

Updated installation script to use a custom modules directory for Nginx.

* Install Nginx mod_zip without HTTP rewrite module

Removed unnecessary HTTP rewrite module from Nginx configuration.

* Simplify Nginx mod_zip installation script

Removed redundant installation of libpcre3-dev for Nginx mod_zip.

* Update romm-install.sh

* Remove temporary files after Nginx module installation

Clean up temporary files after installing the Nginx mod_zip module.

* Update source URL in romm.sh script

* Update install script URL to community repository

* fix(romm): replace getpagespeed repo with source compilation for mod_zip

The `getpagespeed` repository now requires a paid subscription, causing the RomM installation to fail with a 403 Forbidden error. Additionally, Debian 13 (Trixie) introduced an APT conflict between `libpcre3-dev` and `libpcre2-dev`.

This commit fixes the installation by:
- Removing the proprietary `getpagespeed` repository dependency.
- Replacing `libpcre3-dev` with `libpcre2-dev` to resolve APT conflicts on Debian 13.
- Downloading the `mod_zip` tarball directly from GitHub (avoiding `git clone`).
- Downloading the exact Nginx source code matching the installed APT version.
- Compiling the dynamic module (`ngx_http_zip_module.so`) using `--with-compat`.
- Placing the compiled module in a custom directory (`/etc/nginx/custom-modules/`) to bypass Debian's default symlink quirks.
- Cleaning up compilation files in `/tmp` to keep the container footprint small.

* migrate from nginx to angie

so dont need to then install nginx from tarball just to compile the zip module

---------

Co-authored-by: Sam Heinz <54530346+asylumexp@users.noreply.github.com>
This commit is contained in:
hugo
2026-06-22 21:10:14 +02:00
committed by GitHub
parent a5f21f63e8
commit bf815a847b
2 changed files with 22 additions and 20 deletions
+7 -2
View File
@@ -59,8 +59,13 @@ function update_script() {
ROMM_BASE=${ROMM_BASE:-/var/lib/romm}
ln -sfn "$ROMM_BASE"/resources /opt/romm/frontend/dist/assets/romm/resources
ln -sfn "$ROMM_BASE"/assets /opt/romm/frontend/dist/assets/romm/assets
sed -i "s|alias .*/library/;|alias ${ROMM_BASE}/library/;|" /etc/nginx/sites-available/romm
systemctl reload nginx
if [[ -f /etc/angie/http.d/romm.conf ]]; then
sed -i "s|alias .*/library/;|alias ${ROMM_BASE}/library/;|" /etc/angie/http.d/romm.conf
systemctl reload angie
elif [[ -f /etc/nginx/sites-available/romm ]]; then
sed -i "s|alias .*/library/;|alias ${ROMM_BASE}/library/;|" /etc/nginx/sites-available/romm
systemctl reload nginx
fi
msg_ok "Updated ROMM"
msg_info "Starting Services"
+15 -18
View File
@@ -37,20 +37,19 @@ $STD apt install -y \
redis-server \
redis-tools \
p7zip-full \
tzdata \
nginx
tzdata
msg_ok "Installed Dependencies"
msg_info "Installing Nginx mod_zip module"
msg_info "Installing Angie with mod_zip module"
setup_deb822_repo \
"getpagespeed-extras" \
"https://extras.getpagespeed.com/deb-archive-keyring.gpg" \
"https://extras.getpagespeed.com/debian" \
"angie" \
"https://angie.software/keys/angie-signing.gpg" \
"https://download.angie.software/angie/debian/$(get_os_info version_id)" \
"$(get_os_info codename)" \
"main"
$STD apt-get install -y nginx nginx-module-zip
msg_ok "Installed Nginx mod_zip module"
$STD apt-get install -y angie angie-module-zip
sed -i '1i load_module modules/ngx_http_zip_module.so;' /etc/angie/angie.conf
msg_ok "Installed Angie with mod_zip module"
PYTHON_VERSION="3.13" setup_uv
NODE_VERSION="24" setup_nodejs
setup_mariadb
@@ -196,8 +195,8 @@ ln -sfn "$ROMM_BASE"/resources /opt/romm/frontend/dist/assets/romm/resources
ln -sfn "$ROMM_BASE"/assets /opt/romm/frontend/dist/assets/romm/assets
msg_ok "Set up RomM Frontend"
msg_info "Configuring Nginx"
cat <<'EOF' >/etc/nginx/sites-available/romm
msg_info "Configuring Angie"
cat <<'EOF' >/etc/angie/http.d/romm.conf
upstream romm_backend {
server 127.0.0.1:5000;
}
@@ -267,13 +266,11 @@ server {
}
EOF
sed -i "s|alias /var/lib/romm/library/;|alias ${ROMM_BASE}/library/;|" /etc/nginx/sites-available/romm
rm -f /etc/nginx/sites-enabled/default
rm -f /etc/nginx/conf.d/default.conf
ln -sf /etc/nginx/sites-available/romm /etc/nginx/sites-enabled/romm
systemctl restart nginx
systemctl enable -q --now nginx
msg_ok "Configured Nginx"
sed -i "s|alias /var/lib/romm/library/;|alias ${ROMM_BASE}/library/;|" /etc/angie/http.d/romm.conf
rm -f /etc/angie/http.d/default.conf
systemctl restart angie
systemctl enable -q --now angie
msg_ok "Configured Angie"
msg_info "Creating Services"
cat <<EOF >/etc/systemd/system/romm-backend.service