fix: refactor service dependencies
This commit is contained in:
@@ -1,2 +0,0 @@
|
|||||||
base
|
|
||||||
tubesync-init
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
base
|
|
||||||
bgutil-ytdlp-pot-provider-build
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
base
|
|
||||||
tubesync-init
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
base
|
|
||||||
gunicorn
|
|
||||||
26
config/root/etc/s6-overlay/s6-rc.d/tubesync-app-init/run
Executable file
26
config/root/etc/s6-overlay/s6-rc.d/tubesync-app-init/run
Executable 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
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
oneshot
|
||||||
3
config/root/etc/s6-overlay/s6-rc.d/tubesync-app-init/up
Executable file
3
config/root/etc/s6-overlay/s6-rc.d/tubesync-app-init/up
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/command/execlineb -P
|
||||||
|
|
||||||
|
/etc/s6-overlay/s6-rc.d/tubesync-app-init/run
|
||||||
17
config/root/etc/s6-overlay/s6-rc.d/tubesync-config-init/run
Executable file
17
config/root/etc/s6-overlay/s6-rc.d/tubesync-config-init/run
Executable 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
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
oneshot
|
||||||
3
config/root/etc/s6-overlay/s6-rc.d/tubesync-config-init/up
Executable file
3
config/root/etc/s6-overlay/s6-rc.d/tubesync-config-init/up
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/command/execlineb -P
|
||||||
|
|
||||||
|
/etc/s6-overlay/s6-rc.d/tubesync-config-init/run
|
||||||
12
config/root/etc/s6-overlay/s6-rc.d/tubesync-downloads-init/run
Executable file
12
config/root/etc/s6-overlay/s6-rc.d/tubesync-downloads-init/run
Executable 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
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
oneshot
|
||||||
3
config/root/etc/s6-overlay/s6-rc.d/tubesync-downloads-init/up
Executable file
3
config/root/etc/s6-overlay/s6-rc.d/tubesync-downloads-init/up
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/command/execlineb -P
|
||||||
|
|
||||||
|
/etc/s6-overlay/s6-rc.d/tubesync-downloads-init/run
|
||||||
@@ -1 +0,0 @@
|
|||||||
base
|
|
||||||
@@ -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
|
|
||||||
@@ -1 +1 @@
|
|||||||
oneshot
|
bundle
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/command/execlineb -P
|
|
||||||
|
|
||||||
/etc/s6-overlay/s6-rc.d/tubesync-init/run
|
|
||||||
12
config/root/etc/s6-overlay/s6-rc.d/tubesync-migrations-init/run
Executable file
12
config/root/etc/s6-overlay/s6-rc.d/tubesync-migrations-init/run
Executable 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
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
oneshot
|
||||||
3
config/root/etc/s6-overlay/s6-rc.d/tubesync-migrations-init/up
Executable file
3
config/root/etc/s6-overlay/s6-rc.d/tubesync-migrations-init/up
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/command/execlineb -P
|
||||||
|
|
||||||
|
/etc/s6-overlay/s6-rc.d/tubesync-migrations-init/run
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
base
|
|
||||||
tubesync-init
|
|
||||||
Reference in New Issue
Block a user