From c0a8a356c25f44b03eaa158f34d1775523ae4c8d Mon Sep 17 00:00:00 2001 From: bunkerity Date: Mon, 27 Jun 2022 16:58:53 +0200 Subject: [PATCH] linux - include bwcli in /usr/local/bin --- CHANGELOG.md | 2 +- core/jobs/jobs/download-plugins.py | 3 ++- docs/plugins.md | 4 ++-- linux/Dockerfile-centos | 3 ++- linux/Dockerfile-debian | 3 ++- linux/Dockerfile-fedora | 3 ++- linux/Dockerfile-ubuntu | 3 ++- linux/fpm-centos | 2 +- linux/fpm-debian | 2 +- linux/fpm-fedora | 2 +- linux/fpm-ubuntu | 2 +- linux/scripts/start.sh | 2 +- 12 files changed, 18 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d36cb419..c69ae4fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,8 @@ ## v1.4.2 - +- Fix missing bwcli command with Linux integration - Fix various bugs with jobs scheduler when using autoconf/swarm/k8s -- Fix wrong env file when running jobs using Linux integration - Fix bwcli unban command when using Linux integration - Fix permissions check when filename has a space - Fix static config (SERVER_NAME not empty) support when using autoconf/swarm/k8s diff --git a/core/jobs/jobs/download-plugins.py b/core/jobs/jobs/download-plugins.py index 52c2e9c9..346dde4b 100644 --- a/core/jobs/jobs/download-plugins.py +++ b/core/jobs/jobs/download-plugins.py @@ -7,7 +7,7 @@ sys.path.append("/opt/bunkerweb/utils") from requests import get from zipfile import ZipFile from io import BytesIO -from os import getenv, makedirs, chmod, stat +from os import getenv, makedirs, chmod, stat, _exit from os.path import isfile, dirname from stat import S_IEXEC from uuid import uuid4 @@ -42,6 +42,7 @@ try : plugin_urls = getenv("EXTERNAL_PLUGIN_URLS", "") if plugin_urls == "" : log("JOBS", "ℹ️", "No external plugins to download") + _exit(0) # Loop on URLs for plugin_url in plugin_urls.split(" ") : diff --git a/docs/plugins.md b/docs/plugins.md index be746ce4..f2aeed02 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -18,9 +18,9 @@ Here is the list of "official" plugins that we maintain (see the [bunkerweb-plug ### Automatic -If you want to quickly install external plugins, you can use the `EXTERNAL_PLUGIN_URLS` setting. It takes a list of URLs, separated with space, pointing to compressed (zip format) archives containing one or more plugin(s). +If you want to quickly install external plugins, you can use the `EXTERNAL_PLUGIN_URLS` setting. It takes a list of URLs, separated with space, pointing to compressed (zip format) archive containing one or more plugin(s). -Just use the following value if you want to automatically install the official plugins : `EXTERNAL_PLUGIN_URLS=https://github.com/bunkerity/bunkerweb-plugins/archive/refs/tags/v0.2.zip` +You can use the following value if you want to automatically install the official plugins : `EXTERNAL_PLUGIN_URLS=https://github.com/bunkerity/bunkerweb-plugins/archive/refs/tags/v0.2.zip` ### Manual diff --git a/linux/Dockerfile-centos b/linux/Dockerfile-centos index 629aef04..c5080acd 100644 --- a/linux/Dockerfile-centos +++ b/linux/Dockerfile-centos @@ -42,6 +42,7 @@ COPY VERSION /opt/bunkerweb/VERSION # Setup BW RUN cp /opt/bunkerweb/helpers/bwcli /usr/local/bin && \ + chmod 755 /usr/local/bin/bwcli && \ mkdir /opt/bunkerweb/configs && \ mkdir /opt/bunkerweb/cache && \ mkdir /opt/bunkerweb/plugins && \ @@ -49,7 +50,7 @@ RUN cp /opt/bunkerweb/helpers/bwcli /usr/local/bin && \ find /opt/bunkerweb -path /opt/bunkerweb/deps -prune -o -type f -exec chmod 0740 {} \; && \ find /opt/bunkerweb -path /opt/bunkerweb/deps -prune -o -type d -exec chmod 0750 {} \; && \ chmod 770 /opt/bunkerweb/cache /opt/bunkerweb/tmp && \ - chmod 750 /opt/bunkerweb/gen/main.py /opt/bunkerweb/job/main.py /opt/bunkerweb/cli/main.py /opt/bunkerweb/helpers/*.sh /usr/local/bin/bwcli /opt/bunkerweb/ui/main.py && \ + chmod 750 /opt/bunkerweb/gen/main.py /opt/bunkerweb/job/main.py /opt/bunkerweb/cli/main.py /opt/bunkerweb/helpers/*.sh /opt/bunkerweb/ui/main.py && \ find /opt/bunkerweb/core/*/jobs/* -type f -exec chmod 750 {} \; && \ pip3.9 install --no-cache-dir --target /opt/bunkerweb/deps/python -r /opt/bunkerweb/ui/requirements.txt diff --git a/linux/Dockerfile-debian b/linux/Dockerfile-debian index 071c593b..bf9bfadb 100644 --- a/linux/Dockerfile-debian +++ b/linux/Dockerfile-debian @@ -46,6 +46,7 @@ COPY VERSION /opt/bunkerweb/VERSION # Setup BW RUN cp /opt/bunkerweb/helpers/bwcli /usr/local/bin && \ + chmod 755 /usr/local/bin/bwcli && \ mkdir /opt/bunkerweb/configs && \ mkdir /opt/bunkerweb/cache && \ mkdir /opt/bunkerweb/plugins && \ @@ -53,7 +54,7 @@ RUN cp /opt/bunkerweb/helpers/bwcli /usr/local/bin && \ find /opt/bunkerweb -path /opt/bunkerweb/deps -prune -o -type f -exec chmod 0740 {} \; && \ find /opt/bunkerweb -path /opt/bunkerweb/deps -prune -o -type d -exec chmod 0750 {} \; && \ chmod 770 /opt/bunkerweb/cache /opt/bunkerweb/tmp && \ - chmod 750 /opt/bunkerweb/gen/main.py /opt/bunkerweb/job/main.py /opt/bunkerweb/cli/main.py /opt/bunkerweb/helpers/*.sh /usr/local/bin/bwcli /opt/bunkerweb/ui/main.py && \ + chmod 750 /opt/bunkerweb/gen/main.py /opt/bunkerweb/job/main.py /opt/bunkerweb/cli/main.py /opt/bunkerweb/helpers/*.sh /opt/bunkerweb/ui/main.py && \ find /opt/bunkerweb/core/*/jobs/* -type f -exec chmod 750 {} \; && \ pip install --no-cache-dir --target /opt/bunkerweb/deps/python -r /opt/bunkerweb/ui/requirements.txt diff --git a/linux/Dockerfile-fedora b/linux/Dockerfile-fedora index f74300a1..2f3f48a2 100644 --- a/linux/Dockerfile-fedora +++ b/linux/Dockerfile-fedora @@ -41,6 +41,7 @@ COPY VERSION /opt/bunkerweb/VERSION # Setup BW RUN cp /opt/bunkerweb/helpers/bwcli /usr/local/bin && \ + chmod 755 /usr/local/bin/bwcli && \ mkdir /opt/bunkerweb/configs && \ mkdir /opt/bunkerweb/cache && \ mkdir /opt/bunkerweb/plugins && \ @@ -48,7 +49,7 @@ RUN cp /opt/bunkerweb/helpers/bwcli /usr/local/bin && \ find /opt/bunkerweb -path /opt/bunkerweb/deps -prune -o -type f -exec chmod 0740 {} \; && \ find /opt/bunkerweb -path /opt/bunkerweb/deps -prune -o -type d -exec chmod 0750 {} \; && \ chmod 770 /opt/bunkerweb/cache /opt/bunkerweb/tmp && \ - chmod 750 /opt/bunkerweb/gen/main.py /opt/bunkerweb/job/main.py /opt/bunkerweb/cli/main.py /opt/bunkerweb/helpers/*.sh /usr/local/bin/bwcli /opt/bunkerweb/ui/main.py && \ + chmod 750 /opt/bunkerweb/gen/main.py /opt/bunkerweb/job/main.py /opt/bunkerweb/cli/main.py /opt/bunkerweb/helpers/*.sh /opt/bunkerweb/ui/main.py && \ find /opt/bunkerweb/core/*/jobs/* -type f -exec chmod 750 {} \; && \ pip install --no-cache-dir --target /opt/bunkerweb/deps/python -r /opt/bunkerweb/ui/requirements.txt diff --git a/linux/Dockerfile-ubuntu b/linux/Dockerfile-ubuntu index 99a71d17..a34c585d 100644 --- a/linux/Dockerfile-ubuntu +++ b/linux/Dockerfile-ubuntu @@ -46,6 +46,7 @@ COPY VERSION /opt/bunkerweb/VERSION # Setup BW RUN cp /opt/bunkerweb/helpers/bwcli /usr/local/bin && \ + chmod 755 /usr/local/bin/bwcli && \ mkdir /opt/bunkerweb/configs && \ mkdir /opt/bunkerweb/cache && \ mkdir /opt/bunkerweb/plugins && \ @@ -53,7 +54,7 @@ RUN cp /opt/bunkerweb/helpers/bwcli /usr/local/bin && \ find /opt/bunkerweb -path /opt/bunkerweb/deps -prune -o -type f -exec chmod 0740 {} \; && \ find /opt/bunkerweb -path /opt/bunkerweb/deps -prune -o -type d -exec chmod 0750 {} \; && \ chmod 770 /opt/bunkerweb/cache /opt/bunkerweb/tmp && \ - chmod 750 /opt/bunkerweb/gen/main.py /opt/bunkerweb/job/main.py /opt/bunkerweb/cli/main.py /opt/bunkerweb/helpers/*.sh /usr/local/bin/bwcli /opt/bunkerweb/ui/main.py && \ + chmod 750 /opt/bunkerweb/gen/main.py /opt/bunkerweb/job/main.py /opt/bunkerweb/cli/main.py /opt/bunkerweb/helpers/*.sh /opt/bunkerweb/ui/main.py && \ find /opt/bunkerweb/core/*/jobs/* -type f -exec chmod 750 {} \; && \ pip install --no-cache-dir --target /opt/bunkerweb/deps/python -r /opt/bunkerweb/ui/requirements.txt diff --git a/linux/fpm-centos b/linux/fpm-centos index 026ad7e5..b3f477fc 100644 --- a/linux/fpm-centos +++ b/linux/fpm-centos @@ -10,4 +10,4 @@ --after-install /opt/bunkerweb/scripts/postinstall.sh --before-remove /opt/bunkerweb/scripts/beforeRemove.sh --after-remove /opt/bunkerweb/scripts/afterRemove.sh -/opt/bunkerweb/=/opt/bunkerweb/ bunkerweb.service=/etc/systemd/system/bunkerweb.service bunkerweb-ui.service=/etc/systemd/system/bunkerweb-ui.service \ No newline at end of file +/opt/bunkerweb/=/opt/bunkerweb/ bunkerweb.service=/etc/systemd/system/bunkerweb.service bunkerweb-ui.service=/etc/systemd/system/bunkerweb-ui.service /usr/local/bin/bwcli=/usr/local/bin/bwcli \ No newline at end of file diff --git a/linux/fpm-debian b/linux/fpm-debian index 222a9e21..131245d7 100644 --- a/linux/fpm-debian +++ b/linux/fpm-debian @@ -10,4 +10,4 @@ --after-install /opt/bunkerweb/scripts/postinstall.sh --before-remove /opt/bunkerweb/scripts/beforeRemove.sh --after-remove /opt/bunkerweb/scripts/afterRemove.sh -/opt/bunkerweb/=/opt/bunkerweb/ bunkerweb.service=/etc/systemd/system/bunkerweb.service bunkerweb-ui.service=/etc/systemd/system/bunkerweb-ui.service +/opt/bunkerweb/=/opt/bunkerweb/ bunkerweb.service=/etc/systemd/system/bunkerweb.service bunkerweb-ui.service=/etc/systemd/system/bunkerweb-ui.service /usr/local/bin/bwcli=/usr/local/bin/bwcli diff --git a/linux/fpm-fedora b/linux/fpm-fedora index 976950cf..34643e44 100644 --- a/linux/fpm-fedora +++ b/linux/fpm-fedora @@ -10,4 +10,4 @@ --after-install /opt/bunkerweb/scripts/postinstall.sh --before-remove /opt/bunkerweb/scripts/beforeRemove.sh --after-remove /opt/bunkerweb/scripts/afterRemove.sh -/opt/bunkerweb/=/opt/bunkerweb/ bunkerweb.service=/etc/systemd/system/bunkerweb.service bunkerweb-ui.service=/etc/systemd/system/bunkerweb-ui.service \ No newline at end of file +/opt/bunkerweb/=/opt/bunkerweb/ bunkerweb.service=/etc/systemd/system/bunkerweb.service bunkerweb-ui.service=/etc/systemd/system/bunkerweb-ui.service /usr/local/bin/bwcli=/usr/local/bin/bwcli \ No newline at end of file diff --git a/linux/fpm-ubuntu b/linux/fpm-ubuntu index f3eb6c7d..bd5030e5 100644 --- a/linux/fpm-ubuntu +++ b/linux/fpm-ubuntu @@ -10,4 +10,4 @@ --after-install /opt/bunkerweb/scripts/postinstall.sh --before-remove /opt/bunkerweb/scripts/beforeRemove.sh --after-remove /opt/bunkerweb/scripts/afterRemove.sh -/opt/bunkerweb/=/opt/bunkerweb/ bunkerweb.service=/etc/systemd/system/bunkerweb.service bunkerweb-ui.service=/etc/systemd/system/bunkerweb-ui.service +/opt/bunkerweb/=/opt/bunkerweb/ bunkerweb.service=/etc/systemd/system/bunkerweb.service bunkerweb-ui.service=/etc/systemd/system/bunkerweb-ui.service /usr/local/bin/bwcli=/usr/local/bin/bwcli diff --git a/linux/scripts/start.sh b/linux/scripts/start.sh index 4f199195..dd64aced 100644 --- a/linux/scripts/start.sh +++ b/linux/scripts/start.sh @@ -91,7 +91,7 @@ function start() { # STEP4 # # Run jobs script # ############################################# - /opt/bunkerweb/job/main.py --variables /opt/bunkerweb/variables.env --run + /opt/bunkerweb/job/main.py --variables /etc/nginx/variables.env --run # Test if command worked check_ok # Exit if failed