core: ensure lxc-docker is updated every boot

This commit is contained in:
Koushik Dutta
2024-12-28 20:35:44 -08:00
parent 0cf4802385
commit 8e1dfa8174
3 changed files with 9 additions and 15 deletions

View File

@@ -4,21 +4,15 @@ cd /root/.scrypted
# always immediately upgrade everything in case there's a broken update.
# this will also be preferable for troubleshooting via lxc reboot.
export DEBIAN_FRONTEND=noninteractive
((yes | dpkg --configure -a) ; apt -y --fix-broken install && apt -y update && apt -y dist-upgrade) &
yes | dpkg --configure -a
apt -y --fix-broken install && apt -y update && apt -y dist-upgrade
# foreground pull if requested.
if [ -e "volume/.pull" ]
then
rm -rf volume/.pull
PULL="--pull"
(sleep 300 && docker container prune -f && docker image prune -a -f) &
else
# always background pull in case there's a broken image.
(sleep 300 && docker compose pull && docker container prune -f && docker image prune -a -f) &
fi
# force a pull to ensure we have the latest images.
# not using --pull always cause that fails everything on network down
docker compose pull
# do not daemonize, when it exits, systemd will restart it.
# force a recreate as .env may have changed.
# furthermore force recreate gets the container back into a known state
# which is preferable in case the user has made manual changes and then restarts.
WATCHTOWER_HTTP_API_TOKEN=$(echo $RANDOM | md5sum | head -c 32) docker compose up --force-recreate --abort-on-container-exit $PULL
WATCHTOWER_HTTP_API_TOKEN=$(echo $RANDOM | md5sum | head -c 32) docker compose up --force-recreate --abort-on-container-exit

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/core",
"version": "0.3.101",
"version": "0.3.102",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/core",
"version": "0.3.101",
"version": "0.3.102",
"license": "Apache-2.0",
"dependencies": {
"@scrypted/common": "file:../../common",

View File

@@ -1,6 +1,6 @@
{
"name": "@scrypted/core",
"version": "0.3.101",
"version": "0.3.102",
"description": "Scrypted Core plugin. Provides the UI, websocket, and engine.io APIs.",
"author": "Scrypted",
"license": "Apache-2.0",