mirror of
https://github.com/koush/scrypted.git
synced 2026-02-03 14:13:28 +00:00
core: remove watchtower from proxmox totally
This commit is contained in:
@@ -36,4 +36,5 @@ docker compose pull
|
||||
WATCHTOWER_HTTP_API_TOKEN=$(echo $RANDOM | md5sum | head -c 32) docker compose up --force-recreate
|
||||
|
||||
# abort on container exit is problematic if watchtower is the one that aborts.
|
||||
# this is also redundant now that watchtower is disabled.
|
||||
# WATCHTOWER_HTTP_API_TOKEN=$(echo $RANDOM | md5sum | head -c 32) docker compose up --force-recreate --abort-on-container-exit
|
||||
|
||||
4
plugins/core/package-lock.json
generated
4
plugins/core/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@scrypted/core",
|
||||
"version": "0.3.138",
|
||||
"version": "0.3.139",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@scrypted/core",
|
||||
"version": "0.3.138",
|
||||
"version": "0.3.139",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@scrypted/common": "file:../../common",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@scrypted/core",
|
||||
"version": "0.3.138",
|
||||
"version": "0.3.139",
|
||||
"description": "Scrypted Core plugin. Provides the UI, websocket, and engine.io APIs.",
|
||||
"author": "Scrypted",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -345,7 +345,6 @@ class ScryptedCore extends ScryptedDeviceBase implements HttpRequestHandler, Dev
|
||||
const dockerCompose = yaml.parseDocument(readFileAsString('/root/.scrypted/docker-compose.yml'));
|
||||
// @ts-ignore
|
||||
dockerCompose.contents.get('services').get('scrypted').set('image', `ghcr.io/koush/scrypted${releaseChannel}`);
|
||||
yaml.stringify(dockerCompose);
|
||||
writeFileSync('/root/.scrypted/docker-compose.yml', yaml.stringify(dockerCompose));
|
||||
this.setPullImage();
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import fs from 'fs';
|
||||
import fs, { writeFileSync } from 'fs';
|
||||
import sdk from '@scrypted/sdk';
|
||||
import yaml from 'yaml';
|
||||
import { readFileAsString } from '@scrypted/common/src/eval/scrypted-eval';
|
||||
|
||||
export const SCRYPTED_INSTALL_ENVIRONMENT_LXC = 'lxc';
|
||||
export const SCRYPTED_INSTALL_ENVIRONMENT_LXC_DOCKER = 'lxc-docker';
|
||||
@@ -18,6 +20,25 @@ export async function checkLxc() {
|
||||
if (process.env.SCRYPTED_INSTALL_ENVIRONMENT !== SCRYPTED_INSTALL_ENVIRONMENT_LXC_DOCKER)
|
||||
return;
|
||||
|
||||
await checkLxcCompose();
|
||||
await checkLxcScript();
|
||||
}
|
||||
|
||||
async function checkLxcCompose() {
|
||||
// the lxc-docker used watchtower for automatic updates but watchtower started crashing in the lxc environment
|
||||
// after a docker update.
|
||||
// watchtower was removed from the lxc as a result.
|
||||
// however existing installations may still have watchtower in their docker-compose.yml and need it removed.
|
||||
const dockerCompose = yaml.parseDocument(readFileAsString('/root/.scrypted/docker-compose.yml'));
|
||||
// @ts-ignore
|
||||
const watchtower = dockerCompose.contents.get('services').get('watchtower');
|
||||
if (watchtower.get('profiles'))
|
||||
return;
|
||||
watchtower.set('profiles', ['disabled']);
|
||||
writeFileSync('/root/.scrypted/docker-compose.yml', yaml.stringify(dockerCompose));
|
||||
}
|
||||
|
||||
async function checkLxcScript() {
|
||||
const foundDockerComposeSh = await fs.promises.readFile(DOCKER_COMPOSE_SH_PATH, 'utf8');
|
||||
const dockerComposeSh = await fs.promises.readFile(LXC_DOCKER_COMPOSE_SH_PATH, 'utf8');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user