From f7f8aa309f3bb98f297aec143876cb20b0a7c2e5 Mon Sep 17 00:00:00 2001 From: Elton Renda Date: Thu, 12 Aug 2021 19:45:27 +0200 Subject: [PATCH 1/3] fix: npm verion updates --- lxc/nginx-proxy-manager/install/alpine.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lxc/nginx-proxy-manager/install/alpine.sh b/lxc/nginx-proxy-manager/install/alpine.sh index 5711b2b..588dd7e 100644 --- a/lxc/nginx-proxy-manager/install/alpine.sh +++ b/lxc/nginx-proxy-manager/install/alpine.sh @@ -118,8 +118,8 @@ ln -sf /usr/local/openresty/nginx/sbin/nginx /usr/sbin/nginx ln -sf /usr/local/openresty/nginx/ /etc/nginx # Update NPM version in package.json files -sed -i "s+0.0.0+#$_latest_version+g" backend/package.json -sed -i "s+0.0.0+#$_latest_version+g" frontend/package.json +sed -i "s+0.0.0+$_latest_version+g" backend/package.json +sed -i "s+0.0.0+$_latest_version+g" frontend/package.json # Fix nginx config files for use with openresty defaults sed -i 's+^daemon+#daemon+g' docker/rootfs/etc/nginx/nginx.conf From 74551f240165924d5f47ef4986f98e8e784181fc Mon Sep 17 00:00:00 2001 From: Elton Renda Date: Thu, 12 Aug 2021 19:46:46 +0200 Subject: [PATCH 2/3] fix: ubuntu - npm version updates, pip, certbot --- lxc/nginx-proxy-manager/install/ubuntu.sh | 36 +++++++++++------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/lxc/nginx-proxy-manager/install/ubuntu.sh b/lxc/nginx-proxy-manager/install/ubuntu.sh index d8f8bda..b9e828c 100644 --- a/lxc/nginx-proxy-manager/install/ubuntu.sh +++ b/lxc/nginx-proxy-manager/install/ubuntu.sh @@ -7,7 +7,7 @@ TEMPLOG="$TEMPDIR/tmplog" TEMPERR="$TEMPDIR/tmperr" LASTCMD="" WGETOPT="-t 1 -T 15 -q" -DEVDEPS="build-essential python3-dev git" +DEVDEPS="git build-essential libffi-dev libssl-dev python3-dev" NPMURL="https://github.com/jc21/nginx-proxy-manager" cd $TEMPDIR @@ -64,28 +64,28 @@ if [ -f /lib/systemd/system/npm.service ]; then /var/cache/nginx &>/dev/null fi -# Update container OS -log "Updating container OS" -echo "fs.file-max = 65535" > /etc/sysctl.conf -runcmd apt-get update -runcmd apt-get upgrade -y - # Install dependencies log "Installing dependencies" -runcmd 'apt-get -y install --no-install-recommends wget gnupg openssl ca-certificates apache2-utils logrotate $DEVDEPS' +runcmd apt-get update +export DEBIAN_FRONTEND=noninteractive +runcmd 'apt-get install -y --no-install-recommends $DEVDEPS gnupg openssl ca-certificates apache2-utils logrotate' # Install Python log "Installing python" -runcmd apt-get install -y -q --no-install-recommends python3 python3-pip python3-venv +runcmd apt-get install -y -q --no-install-recommends python3 python3-distutils python3-venv python3 -m venv /opt/certbot/ +export PATH=/opt/certbot/bin:$PATH +grep -qo "/opt/certbot" /etc/environment || echo "$PATH" > /etc/environment # Install certbot and python dependancies -runcmd pip3 install --upgrade setuptools -runcmd pip3 install --no-cache-dir -U cryptography==3.3.2 -runcmd pip3 install --no-cache-dir cffi certbot +runcmd wget -qO - https://bootstrap.pypa.io/get-pip.py | python - +if [ "$(getconf LONG_BIT)" = "32" ]; then + runcmd pip install --no-cache-dir -U cryptography==3.3.2 +fi +runcmd pip install --no-cache-dir cffi certbot # Install openresty log "Installing openresty" -wget -O - https://openresty.org/package/pubkey.gpg | apt-key add - +wget -qO - https://openresty.org/package/pubkey.gpg | apt-key add - _distro_release=$(lsb_release -sc) _distro_release=$(wget $WGETOPT "http://openresty.org/package/ubuntu/dists/" -O - | grep -o "$_distro_release" | head -n1 || true) echo "deb [trusted=yes] http://openresty.org/package/ubuntu ${_distro_release:-focal} main" | tee /etc/apt/sources.list.d/openresty.list @@ -93,7 +93,7 @@ runcmd apt-get update && apt-get install -y -q --no-install-recommends openresty # Install nodejs log "Installing nodejs" -runcmd wget -O - https://deb.nodesource.com/setup_14.x | bash - +runcmd wget -qO - https://deb.nodesource.com/setup_14.x | bash - runcmd apt-get install -y -q --no-install-recommends nodejs runcmd npm install --global yarn @@ -110,14 +110,14 @@ cd ./nginx-proxy-manager-$_latest_version log "Setting up enviroment" # Crate required symbolic links ln -sf /usr/bin/python3 /usr/bin/python -ln -sf /usr/bin/pip3 /usr/bin/pip -ln -sf /usr/bin/certbot /opt/certbot/bin/certbot +ln -sf /opt/certbot/bin/pip /usr/bin/pip +ln -sf /opt/certbot/bin/certbot /usr/bin/certbot ln -sf /usr/local/openresty/nginx/sbin/nginx /usr/sbin/nginx ln -sf /usr/local/openresty/nginx/ /etc/nginx # Update NPM version in package.json files -sed -i "s+0.0.0+#$_latest_version+g" backend/package.json -sed -i "s+0.0.0+#$_latest_version+g" frontend/package.json +sed -i "s+0.0.0+$_latest_version+g" backend/package.json +sed -i "s+0.0.0+$_latest_version+g" frontend/package.json # Fix nginx config files for use with openresty defaults sed -i 's+^daemon+#daemon+g' docker/rootfs/etc/nginx/nginx.conf From f5c5176470cc6aa129ab0a6d1f8cddd13074b3eb Mon Sep 17 00:00:00 2001 From: Elton Renda Date: Thu, 12 Aug 2021 19:51:00 +0200 Subject: [PATCH 3/3] fix: run install as sudo on ubuntu --- lxc/nginx-proxy-manager/setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lxc/nginx-proxy-manager/setup.sh b/lxc/nginx-proxy-manager/setup.sh index 7e0a06f..16f7d10 100644 --- a/lxc/nginx-proxy-manager/setup.sh +++ b/lxc/nginx-proxy-manager/setup.sh @@ -19,7 +19,7 @@ wget -O "$TMP" "$URL/$DISTRO.sh" chmod +x "$TMP" if [ "$(command -v bash)" ]; then - bash "$TMP" + sudo bash "$TMP" else sh "$TMP" fi