From 9d81b8aaa7e5f76e42297e0eac3f72fb81d4fbbd Mon Sep 17 00:00:00 2001 From: Zoey Date: Tue, 12 Mar 2024 16:42:32 +0100 Subject: [PATCH] add findutils/remove prerun patches Signed-off-by: Zoey --- Dockerfile | 4 ++-- README.md | 9 ++++----- rootfs/usr/local/bin/entrypoint.sh | 23 +++++++---------------- 3 files changed, 13 insertions(+), 23 deletions(-) diff --git a/Dockerfile b/Dockerfile index e8393e998..0b1fc01af 100644 --- a/Dockerfile +++ b/Dockerfile @@ -67,11 +67,11 @@ COPY --from=zoeyvid/curl-quic:373 /usr/local/bin/curl /usr/local/bin/curl RUN apk upgrade --no-cache -a && \ apk add --no-cache ca-certificates tzdata tini \ - patch bash nano \ + bash nano \ nodejs-current \ openssl apache2-utils \ lua5.1-lzlib lua5.1-socket \ - coreutils grep jq shadow sudo \ + coreutils grep findutils jq shadow sudo \ luarocks5.1 lua5.1-dev lua5.1-sec build-base git yarn && \ curl https://raw.githubusercontent.com/acmesh-official/acme.sh/master/acme.sh | sh -s -- --install-online --home /usr/local/acme.sh --nocron && \ git clone https://github.com/coreruleset/coreruleset --branch "$CRS_VER" /tmp/coreruleset && \ diff --git a/README.md b/README.md index 6030ad46a..c8d7d4c3e 100644 --- a/README.md +++ b/README.md @@ -204,11 +204,10 @@ Password: iArhP1j7p1P6TA92FA2FMbbUGYqwcYzxC4AVEe12Wbi94FY9gNN62aKyF1shrvG4NycjjX ``` Immediately after logging in with this default user you will be asked to modify your details and change your password. -### prerun patches/scripts (EXPERT option) - if you don't know what this is, ignore it -run order: entrypoint.sh (patches => scripts) => start.sh => launch.sh
-if you need to apply patches before NPMplus launches put them under: `/opt/npm/etc/prerun/patches/*.patch` (applied using `patch -p1`)
-if you need to run scripts before NPMplus launches put them under: `/opt/npm/etc/prerun/scripts/*.sh` (please add `#!/bin/sh` / `#!/bin/bash` to the top of the script)
-you need to create this folders yourself, they will be launches from the `/` folder - **NOTE:** I won't help you creating thoose patches/scripts if you need them you also need to know how to create them +### prerun scripts (EXPERT option) - if you don't know what this is, ignore it +run order: entrypoint.sh (prerun scripts) => start.sh => launch.sh
+if you need to run scripts before NPMplus launches put them under: `/opt/npm/etc/prerun/*.sh` (please add `#!/bin/sh` / `#!/bin/bash` to the top of the script)
+you need to create this folder yourself - **NOTE:** I won't help you creating thoose patches/scripts if you need them you also need to know how to create them ## Contributing All are welcome to create pull requests for this project, against the `develop` branch. diff --git a/rootfs/usr/local/bin/entrypoint.sh b/rootfs/usr/local/bin/entrypoint.sh index 30a6be04a..82bf28b79 100755 --- a/rootfs/usr/local/bin/entrypoint.sh +++ b/rootfs/usr/local/bin/entrypoint.sh @@ -1,20 +1,11 @@ #!/bin/sh -cd / || exit - -for patch in /data/etc/prerun/patches/*.patch; do - [ -e "$patch" ] || break - echo "Applying prerun patch using patch -p1: $patch" - patch -p1 <"$patch" -done - -for script in /data/etc/prerun/scripts/*.sh; do - [ -e "$patch" ] || break - echo "Exexcuting prerun script: $script" - chmod +x "$script" - "$script" -done - -cd /app || exit +if [ -n "$(ls -A /data/etc/prerun 2> /dev/null)" ]; then + for script in /data/etc/prerun/*.sh; do + echo "Exexcuting prerun script: $script" + chmod +x "$script" + "$script" + done +fi exec start.sh