fix: refactor service dependencies

This commit is contained in:
tcely
2026-05-01 11:08:00 -04:00
parent c41e8a6aec
commit 9e76e89e17
54 changed files with 84 additions and 71 deletions

View File

@@ -1,2 +0,0 @@
base
bgutil-ytdlp-pot-provider-build

View File

@@ -1,2 +0,0 @@
base
tubesync-init

View File

@@ -1,2 +0,0 @@
base
gunicorn

View File

@@ -0,0 +1,26 @@
#!/command/with-contenv bash
# Copy local_settings.py for the user
if [ -f /config/tubesync/local_settings.py ]
then
# from the image for an example or comparison
cp -v -p /app/tubesync/local_settings.py \
/config/tubesync/local_settings.py.image
# to the image to apply the user's settings
cp -v -p /config/tubesync/local_settings.py \
/app/tubesync/local_settings.py
chown app:app \
/config/tubesync/local_settings.py.image
chmod 0755 \
/config/tubesync/local_settings.py.image
fi
# Reset permissions
chown -R root:app /app
chmod -R 0750 /app
chmod 0755 /app/*.py /app/*.sh
find /app -mindepth 2 -type f -execdir chmod 640 '{}' +
chown -R app:app /app/common/static
chown -R app:app /app/static

View File

@@ -0,0 +1 @@
oneshot

View File

@@ -0,0 +1,3 @@
#!/command/execlineb -P
/etc/s6-overlay/s6-rc.d/tubesync-app-init/run

View File

@@ -0,0 +1,17 @@
#!/command/with-contenv bash
# Change runtime user UID and GID
groupmod -o -g "${PGID:=911}" app
usermod -o -u "${PUID:=911}" app
# Ensure existence and reset permissions
mkdir -v -p /run/app
chown -R app:app /run/app
chmod -R 0700 /run/app
# Ensure /config directories exist
mkdir -v -p /config/{cache,media,state,tasks,tubesync}
# Reset permissions
chown -R app:app /config
chmod -R 0755 /config

View File

@@ -0,0 +1 @@
oneshot

View File

@@ -0,0 +1,3 @@
#!/command/execlineb -P
/etc/s6-overlay/s6-rc.d/tubesync-config-init/run

View File

@@ -0,0 +1,12 @@
#!/command/with-contenv bash
# Optionally reset the download dir permissions
if [[ 'True' != "${TUBESYNC_RESET_DOWNLOAD_DIR:-True}" ]]
then
exit 0
fi
echo "TUBESYNC_RESET_DOWNLOAD_DIR=True, Resetting /downloads directory permissions"
chown -R app:app /downloads
chmod -R 0755 /downloads

View File

@@ -0,0 +1 @@
oneshot

View File

@@ -0,0 +1,3 @@
#!/command/execlineb -P
/etc/s6-overlay/s6-rc.d/tubesync-downloads-init/run

View File

@@ -1,52 +0,0 @@
#!/command/with-contenv bash
# Change runtime user UID and GID
groupmod -o -g "${PGID:=911}" app
usermod -o -u "${PUID:=911}" app
# Ensure /config directories exist
mkdir -v -p /config/{cache,media,state,tasks,tubesync}
# Copy local_settings.py for the user
if [ -f /config/tubesync/local_settings.py ]
then
# from the image for an example or comparison
cp -v -p /app/tubesync/local_settings.py \
/config/tubesync/local_settings.py.image
# to the image to apply the user's settings
cp -v -p /config/tubesync/local_settings.py \
/app/tubesync/local_settings.py
fi
# Reset permissions
chown -R app:app /run/app
chmod -R 0700 /run/app
chown -R app:app /config
chmod -R 0755 /config
chown -R root:app /app
chmod -R 0750 /app
chmod 0755 /app/*.py /app/*.sh
find /app -mindepth 2 -type f -execdir chmod 640 '{}' +
chown -R app:app /app/common/static
chown -R app:app /app/static
# Optionally reset the download dir permissions
if [ "${TUBESYNC_RESET_DOWNLOAD_DIR:=True}" == "True" ]
then
export TUBESYNC_RESET_DOWNLOAD_DIR
echo "TUBESYNC_RESET_DOWNLOAD_DIR=True, Resetting /downloads directory permissions"
chown -R app:app /downloads
chmod -R 0755 /downloads
fi
if [ 'True' = "${TUBESYNC_DEBUG:-False}" ]
then
s6-setuidgid app \
/usr/bin/python3 /app/manage.py \
showmigrations -v 3 --list
fi
# Run migrations
exec s6-setuidgid app \
/usr/bin/python3 /app/manage.py migrate

View File

@@ -1 +1 @@
oneshot
bundle

View File

@@ -1,3 +0,0 @@
#!/command/execlineb -P
/etc/s6-overlay/s6-rc.d/tubesync-init/run

View File

@@ -0,0 +1,12 @@
#!/command/with-contenv bash
if [[ 'True' == "${TUBESYNC_DEBUG:-False}" ]]
then
s6-setuidgid app \
/usr/bin/python3 /app/manage.py \
showmigrations -v 3 --list
fi
# Run migrations
exec s6-setuidgid app \
/usr/bin/python3 /app/manage.py migrate

View File

@@ -0,0 +1 @@
oneshot

View File

@@ -0,0 +1,3 @@
#!/command/execlineb -P
/etc/s6-overlay/s6-rc.d/tubesync-migrations-init/run

View File

@@ -1,2 +0,0 @@
base
tubesync-init