Skip to content

Commit 32793cb

Browse files
authored
feat: drop privileges in cwa-ingest-service to abc user
Co-authored-by: ajn142 <>
1 parent c5e3e08 commit 32793cb

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

  • root/etc/s6-overlay/s6-rc.d/cwa-ingest-service

root/etc/s6-overlay/s6-rc.d/cwa-ingest-service/run

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#!/usr/bin/with-contenv bash
22

3+
# Drop privileges to abc (LinuxServer PUID/PGID user)
4+
if [ "$(id -u)" = "0" ]; then
5+
exec s6-setuidgid abc "$0" "$@"
6+
fi
7+
38
echo "========== STARTING CWA-INGEST SERVICE =========="
49

510
WATCH_FOLDER=${WATCH_FOLDER:-$(grep -o '"ingest_folder": "[^"]*' /app/calibre-web-automated/dirs.json | grep -o '[^"]*$')}
@@ -538,7 +543,7 @@ if [ -n "$(get_stale_temp_interval_from_db)" ]; then
538543
fi
539544

540545
( set -o pipefail
541-
s6-setuidgid abc inotifywait -m -r --format="%e %w%f" -e close_write -e moved_to "$WATCH_FOLDER" | \
546+
inotifywait -m -r --format="%e %w%f" -e close_write -e moved_to "$WATCH_FOLDER" | \
542547
while read -r events filepath; do
543548
handle_event "$filepath"
544549
done

0 commit comments

Comments
 (0)