feat(ci): add the default user for docker image (#1036)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
我怎么就不是一只猫呢?
2025-08-12 09:51:40 +08:00
committed by GitHub
parent 57fceabcf4
commit d0c22a1ecb
3 changed files with 46 additions and 14 deletions

View File

@ -5,10 +5,26 @@ umask ${UMASK}
if [ "$1" = "version" ]; then
./openlist version
else
if [ "$RUN_ARIA2" = "true" ]; then
cp -a /opt/service/stop/aria2 /opt/service/start 2>/dev/null
# Define the target directory path for openlist service
OPENLIST_DIR="/opt/service/start/openlist"
if [ ! -d "$OPENLIST_DIR" ]; then
cp -r /opt/service/stop/openlist "$OPENLIST_DIR" 2>/dev/null
fi
chown -R ${PUID}:${PGID} /opt
exec su-exec ${PUID}:${PGID} runsvdir /opt/service/start
fi
# Define the target directory path for aria2 service
ARIA2_DIR="/opt/service/start/aria2"
if [ "$RUN_ARIA2" = "true" ]; then
# If aria2 should run and target directory doesn't exist, copy it
if [ ! -d "$ARIA2_DIR" ]; then
mkdir -p "$ARIA2_DIR"
cp -r /opt/service/stop/aria2/* "$ARIA2_DIR" 2>/dev/null
fi
else
# If aria2 should NOT run and target directory exists, remove it
if [ -d "$ARIA2_DIR" ]; then
rm -rf "$ARIA2_DIR"
fi
fi
exec runsvdir /opt/service/start
fi