Skip to content

Commit

Permalink
add findutils/remove prerun patches
Browse files Browse the repository at this point in the history
Signed-off-by: Zoey <[email protected]>
  • Loading branch information
Zoey2936 committed Mar 12, 2024
1 parent baacde6 commit 9d81b8a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 23 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <br>
if you need to apply patches before NPMplus launches put them under: `/opt/npm/etc/prerun/patches/*.patch` (applied using `patch -p1`) <br>
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) <br>
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 <br>
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) <br>
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.
Expand Down
23 changes: 7 additions & 16 deletions rootfs/usr/local/bin/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9d81b8a

Please sign in to comment.