Skip to content

Commit

Permalink
s6 v3
Browse files Browse the repository at this point in the history
  • Loading branch information
mrhotio committed Aug 27, 2023
1 parent 60b2274 commit f5d532c
Show file tree
Hide file tree
Showing 21 changed files with 31 additions and 11 deletions.
1 change: 0 additions & 1 deletion linux-amd64.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ COPY --from=builder /unpackerr/unpackerr.amd64.linux ${APP_DIR}/unpackerr
COPY --from=builder /unpackerr/examples/unpackerr.conf.example ${APP_DIR}/unpackerr.conf.example
RUN chmod 755 "${APP_DIR}/unpackerr"
COPY root/ /
RUN chmod -R +x /etc/cont-init.d/ /etc/services.d/
1 change: 0 additions & 1 deletion linux-arm64.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ COPY --from=builder /unpackerr/unpackerr.arm64.linux ${APP_DIR}/unpackerr
COPY --from=builder /unpackerr/examples/unpackerr.conf.example ${APP_DIR}/unpackerr.conf.example
RUN chmod 755 "${APP_DIR}/unpackerr"
COPY root/ /
RUN chmod -R +x /etc/cont-init.d/ /etc/services.d/
9 changes: 0 additions & 9 deletions root/etc/cont-init.d/01-configure-app

This file was deleted.

Empty file.
1 change: 1 addition & 0 deletions root/etc/s6-overlay/s6-rc.d/init-perms/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
oneshot
1 change: 1 addition & 0 deletions root/etc/s6-overlay/s6-rc.d/init-perms/up
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
find /etc/s6-overlay/s6-rc.d -name "run*" -execdir chmod +x {} +
Empty file.
19 changes: 19 additions & 0 deletions root/etc/s6-overlay/s6-rc.d/init-secrets/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/command/with-contenv bash
# shellcheck shell=bash

find /var/run/s6/container_environment/ -type f -name 'FILE__*' -print0 | while IFS= read -r -d '' FILENAME; do
NEW_VAR=${FILENAME//FILE__/}
SECRET_FILE=$(cat "${FILENAME}")
if [[ ! -f ${SECRET_FILE} ]]; then
echo "[${NEW_VAR##*/}] The file \"${SECRET_FILE}\" wasn't found!"
exit 1
fi
SECRET=$(cat "${SECRET_FILE}")
if [[ -n ${SECRET} ]]; then
echo -n "${SECRET}" > "${NEW_VAR}"
echo "[${NEW_VAR##*/}] Set with secret from \"${SECRET_FILE}\"."
else
echo "[${NEW_VAR##*/}] No secret found in \"${SECRET_FILE}\"!"
exit 1
fi
done
1 change: 1 addition & 0 deletions root/etc/s6-overlay/s6-rc.d/init-secrets/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
oneshot
1 change: 1 addition & 0 deletions root/etc/s6-overlay/s6-rc.d/init-secrets/up
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/init-secrets/run
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@ fi
echo "Applying permissions to ${CONFIG_DIR}"
chmod "=rwx" "${CONFIG_DIR}"
chown hotio:hotio "${CONFIG_DIR}"

if [[ ! -f "${CONFIG_DIR}/unpackerr.conf" ]]; then
cp "${APP_DIR}/unpackerr.conf.example" "${CONFIG_DIR}/unpackerr.conf"
chown hotio:hotio "${CONFIG_DIR}/unpackerr.conf"
fi
1 change: 1 addition & 0 deletions root/etc/s6-overlay/s6-rc.d/init-setup/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
oneshot
1 change: 1 addition & 0 deletions root/etc/s6-overlay/s6-rc.d/init-setup/up
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/init-setup/run
Empty file.
File renamed without changes.
1 change: 1 addition & 0 deletions root/etc/s6-overlay/s6-rc.d/service-unpackerr/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
longrun
Empty file.
Empty file.
Empty file.
Empty file.

0 comments on commit f5d532c

Please sign in to comment.