From 2531884ae95d2197d47e287c3ade03ed0da650fe Mon Sep 17 00:00:00 2001 From: Andris Reinman Date: Thu, 16 Jul 2020 17:08:04 +0300 Subject: [PATCH] do not install otpional deps --- setup/00_install_global_functions_variables.sh | 2 +- setup/07_install_wildduck.sh | 2 +- setup/08_install_haraka.sh | 10 +++++----- setup/09_install_zone_mta.sh | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/setup/00_install_global_functions_variables.sh b/setup/00_install_global_functions_variables.sh index cc1c31fe..74a9546a 100755 --- a/setup/00_install_global_functions_variables.sh +++ b/setup/00_install_global_functions_variables.sh @@ -236,7 +236,7 @@ function hook_script { git --git-dir=/var/opt/$1.git --work-tree=\"/opt/$1\" checkout "\$3" -f cd \"/opt/$1\" rm -rf package-lock.json -npm install --production --progress=false +npm install --production --no-optional --no-package-lock --no-audit --ignore-scripts --no-shrinkwrap --progress=false sudo $SYSTEMCTL_PATH restart $1 || echo \"Failed restarting service\"" > "/var/opt/$1.git/hooks/update" chmod +x "/var/opt/$1.git/hooks/update" } diff --git a/setup/07_install_wildduck.sh b/setup/07_install_wildduck.sh index a92a466a..072df9f9 100755 --- a/setup/07_install_wildduck.sh +++ b/setup/07_install_wildduck.sh @@ -55,7 +55,7 @@ emailDomain=\"$MAILDOMAIN\"" | cat - /etc/wildduck/wildduck.toml > temp && mv te sed -i -e "s/localhost:3000/$HOSTNAME/g;s/localhost/$HOSTNAME/g;s/2587/587/g" /etc/wildduck/wildduck.toml cd /opt/wildduck -npm install --unsafe-perm --production +npm install --production --unsafe-perm --no-optional --no-package-lock --no-audit --ignore-scripts --no-shrinkwrap chown -R deploy:deploy /var/opt/wildduck.git chown -R deploy:deploy /opt/wildduck diff --git a/setup/08_install_haraka.sh b/setup/08_install_haraka.sh index d03a7954..1036a471 100755 --- a/setup/08_install_haraka.sh +++ b/setup/08_install_haraka.sh @@ -25,7 +25,7 @@ echo "#!/bin/bash git --git-dir=/var/opt/haraka-plugin-wildduck.git --work-tree=/opt/haraka/plugins/wildduck checkout "\$3" -f cd /opt/haraka/plugins/wildduck rm -rf package-lock.json -npm install --production --progress=false +npm install --production --no-optional --no-package-lock --no-audit --ignore-scripts --no-shrinkwrap --progress=false sudo $SYSTEMCTL_PATH restart haraka || echo \"Failed restarting service\"" > "/var/opt/haraka-plugin-wildduck.git/hooks/update" chmod +x "/var/opt/haraka-plugin-wildduck.git/hooks/update" @@ -33,17 +33,17 @@ chmod +x "/var/opt/haraka-plugin-wildduck.git/hooks/update" echo "deploy ALL = (root) NOPASSWD: $SYSTEMCTL_PATH restart haraka" >> /etc/sudoers.d/wildduck cd -npm install --unsafe-perm -g Haraka@$HARAKA_VERSION +npm install --production --no-optional --no-package-lock --no-audit --ignore-scripts --no-shrinkwrap --unsafe-perm -g Haraka@$HARAKA_VERSION haraka -i /opt/haraka cd /opt/haraka -npm install --unsafe-perm --save haraka-plugin-rspamd Haraka@$HARAKA_VERSION +npm install --production --no-optional --no-package-lock --no-audit --ignore-scripts --no-shrinkwrap --unsafe-perm --save haraka-plugin-rspamd Haraka@$HARAKA_VERSION -# Haraka WIldDuck plugin. Install as separate repo as it can be edited more easily later +# Haraka WildDuck plugin. Install as separate repo as it can be edited more easily later mkdir -p plugins/wildduck git --git-dir=/var/opt/haraka-plugin-wildduck.git --work-tree=/opt/haraka/plugins/wildduck checkout "$WILDDUCK_HARAKA_COMMIT" cd plugins/wildduck -npm install --unsafe-perm --production --progress=false +npm install --production --no-optional --no-package-lock --no-audit --ignore-scripts --no-shrinkwrap --unsafe-perm --progress=false cd /opt/haraka mv config/plugins config/plugins.bak diff --git a/setup/09_install_zone_mta.sh b/setup/09_install_zone_mta.sh index d73b2a22..3bba8d8f 100755 --- a/setup/09_install_zone_mta.sh +++ b/setup/09_install_zone_mta.sh @@ -30,7 +30,7 @@ echo "#!/bin/bash git --git-dir=/var/opt/zonemta-wildduck.git --work-tree=/opt/zone-mta/plugins/wildduck checkout "\$3" -f cd /opt/zone-mta/plugins/wildduck rm -rf package-lock.json -npm install --production --progress=false +npm install --production --no-optional --no-package-lock --no-audit --ignore-scripts --no-shrinkwrap --progress=false sudo $SYSTEMCTL_PATH restart zone-mta || echo \"Failed restarting service\"" > "/var/opt/zonemta-wildduck.git/hooks/update" chmod +x "/var/opt/zonemta-wildduck.git/hooks/update" @@ -103,10 +103,10 @@ DKIM_JSON=`DOMAIN="$MAILDOMAIN" SELECTOR="$DKIM_SELECTOR" node -e 'console.log(J }))'` cd /opt/zone-mta -npm install --unsafe-perm --production +npm install --production --no-optional --no-package-lock --no-audit --ignore-scripts --no-shrinkwrap --unsafe-perm cd /opt/zone-mta/plugins/wildduck -npm install --unsafe-perm --production +npm install --production --no-optional --no-package-lock --no-audit --ignore-scripts --no-shrinkwrap --unsafe-perm chown -R deploy:deploy /var/opt/zone-mta.git chown -R deploy:deploy /var/opt/zonemta-wildduck.git