mirror of
https://github.com/runcitadel/core.git
synced 2024-09-23 01:30:23 +00:00
Fix update check
This commit is contained in:
parent
c12fdf794b
commit
d44bf72b93
|
@ -1,11 +1,14 @@
|
||||||
{
|
{
|
||||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
"title": "app.yml specification v1",
|
"title": "Citadel app.yml v1",
|
||||||
"description": "The app.yml format, cleaned up. This format should be used for new apps, but the autoconverter can only convert to v0, so v0 will be kept for some time.",
|
"description": "The first draft of Citadel's app.yml format",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"version": {
|
"version": {
|
||||||
"type": ["string", "number"],
|
"type": [
|
||||||
|
"string",
|
||||||
|
"number"
|
||||||
|
],
|
||||||
"description": "The version of the app.yml format you're using."
|
"description": "The version of the app.yml format you're using."
|
||||||
},
|
},
|
||||||
"metadata": {
|
"metadata": {
|
||||||
|
@ -111,13 +114,22 @@
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": ["lnd", "bitcoind", "electrum", "root", "hw"]
|
"enum": [
|
||||||
|
"lnd",
|
||||||
|
"bitcoind",
|
||||||
|
"electrum",
|
||||||
|
"root",
|
||||||
|
"hw"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ports": {
|
"ports": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": ["string", "number"]
|
"type": [
|
||||||
|
"string",
|
||||||
|
"number"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"port": {
|
"port": {
|
||||||
|
@ -125,7 +137,7 @@
|
||||||
"description": "If this is the main container, the port inside the container which will be exposed to the outside as the port specified in metadata."
|
"description": "If this is the main container, the port inside the container which will be exposed to the outside as the port specified in metadata."
|
||||||
},
|
},
|
||||||
"environment": {
|
"environment": {
|
||||||
"type": ["object", "array"]
|
"type": "object"
|
||||||
},
|
},
|
||||||
"data": {
|
"data": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
|
@ -147,11 +159,21 @@
|
||||||
"description": "The services the container depends on"
|
"description": "The services the container depends on"
|
||||||
},
|
},
|
||||||
"entrypoint": {
|
"entrypoint": {
|
||||||
"type": ["string", "array"],
|
"type": [
|
||||||
|
"string",
|
||||||
|
"array"
|
||||||
|
],
|
||||||
"description": "The entrypoint for the container"
|
"description": "The entrypoint for the container"
|
||||||
},
|
},
|
||||||
|
"bitcoin_mount_dir": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Where to mount the bitcoin dir"
|
||||||
|
},
|
||||||
"command": {
|
"command": {
|
||||||
"type": ["string", "array"],
|
"type": [
|
||||||
|
"string",
|
||||||
|
"array"
|
||||||
|
],
|
||||||
"description": "The command for the container"
|
"description": "The command for the container"
|
||||||
},
|
},
|
||||||
"init": {
|
"init": {
|
||||||
|
@ -179,17 +201,30 @@
|
||||||
"description": "Set this to a map of service names to hidden service ports if your container exposes multiple ports, and all of them should be hidden services.",
|
"description": "Set this to a map of service names to hidden service ports if your container exposes multiple ports, and all of them should be hidden services.",
|
||||||
"patternProperties": {
|
"patternProperties": {
|
||||||
"^[a-zA-Z0-9_]+$": {
|
"^[a-zA-Z0-9_]+$": {
|
||||||
"type": ["number", "array"]
|
"type": [
|
||||||
|
"number",
|
||||||
|
"array"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"restart": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "When the container should restart. Can be 'always' or 'on-failure'."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false,
|
||||||
|
"required": [
|
||||||
|
"name",
|
||||||
|
"image"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"required": ["name", "image"],
|
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": ["metadata", "containers"],
|
"required": [
|
||||||
|
"metadata",
|
||||||
|
"containers"
|
||||||
|
],
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
import json
|
import json
|
||||||
from lib.manage import compose, createDataDir, deleteData, getUserData, setInstalled, setRemoved, startInstalled, stopInstalled, update, deriveEntropy, updateRepos, download
|
from lib.manage import compose, createDataDir, deleteData, getUserData, setInstalled, setRemoved, startInstalled, stopInstalled, update, deriveEntropy, updateRepos, download, getAvailableUpdates
|
||||||
from lib.validate import findAndValidateApps
|
from lib.validate import findAndValidateApps
|
||||||
import os
|
import os
|
||||||
import argparse
|
import argparse
|
||||||
|
@ -47,8 +47,7 @@ if args.action == 'list':
|
||||||
exit(0)
|
exit(0)
|
||||||
elif args.action == "list-updates":
|
elif args.action == "list-updates":
|
||||||
availableUpdates = getAvailableUpdates()
|
availableUpdates = getAvailableUpdates()
|
||||||
for app in availableUpdates:
|
print(json.dumps(availableUpdates))
|
||||||
print(app)
|
|
||||||
exit(0)
|
exit(0)
|
||||||
elif args.action == 'download':
|
elif args.action == 'download':
|
||||||
updateRepos()
|
updateRepos()
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
import stat
|
import stat
|
||||||
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
import threading
|
import threading
|
||||||
from typing import List
|
from typing import List
|
||||||
|
@ -124,9 +125,10 @@ def getAvailableUpdates():
|
||||||
for app in apps:
|
for app in apps:
|
||||||
try:
|
try:
|
||||||
if checkUpdateAvailable(app):
|
if checkUpdateAvailable(app):
|
||||||
availableUpdates.push(app)
|
availableUpdates.append(app)
|
||||||
except Exception:
|
except Exception:
|
||||||
print("Can't check app {} yet".format(app))
|
print("Warning: Can't check app {} yet".format(app), file=sys.stderr)
|
||||||
|
return availableUpdates
|
||||||
|
|
||||||
def startInstalled():
|
def startInstalled():
|
||||||
# If userfile doesn't exist, just do nothing
|
# If userfile doesn't exist, just do nothing
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# SPDX-FileCopyrightText: 2020 Umbrel. https://getumbrel.com
|
# SPDX-FileCopyrightText: 2020 Umbrel. https://getumbrel.com
|
||||||
# SPDX-FileCopyrightText: 2021 Aaron Dewes <aaron.dewes@web.de>
|
# SPDX-FileCopyrightText: 2021-2022 Citadel and contributors
|
||||||
# SPDX-FileCopyrightText: 2021 https://github.com/o3o3o
|
# SPDX-FileCopyrightText: 2021 https://github.com/o3o3o
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# SPDX-FileCopyrightText: 2020 Umbrel. https://getumbrel.com
|
# SPDX-FileCopyrightText: 2020 Umbrel. https://getumbrel.com
|
||||||
# SPDX-FileCopyrightText: 2021 Aaron Dewes <aaron.dewes@web.de>
|
# SPDX-FileCopyrightText: 2021-2022 Citadel and contributors
|
||||||
# SPDX-FileCopyrightText: 2021 https://github.com/o3o3o
|
# SPDX-FileCopyrightText: 2021 https://github.com/o3o3o
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# SPDX-FileCopyrightText: 2021 Aaron Dewes <aaron.dewes@web.de>
|
# SPDX-FileCopyrightText: 2021-2022 Citadel and contributors
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
|
12
events/triggers/get-app-updates
Executable file
12
events/triggers/get-app-updates
Executable file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# SPDX-FileCopyrightText: 2021-2022 Citadel and contributors
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
CITADEL_ROOT="$(readlink -f $(dirname "${BASH_SOURCE[0]}")/../..)"
|
||||||
|
|
||||||
|
OUTPUT_FILE="${CITADEL_ROOT}/statuses/available-updates.json"
|
||||||
|
|
||||||
|
echo "false" > "${OUTPUT_FILE}"
|
||||||
|
"${CITADEL_ROOT}/scripts/app" list-updates > "${OUTPUT_FILE}"
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# SPDX-FileCopyrightText: 2021 Aaron Dewes <aaron.dewes@web.de>
|
# SPDX-FileCopyrightText: 2021-2022 Citadel and contributors
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# SPDX-FileCopyrightText: 2020 Umbrel. https://getumbrel.com
|
# SPDX-FileCopyrightText: 2020 Umbrel. https://getumbrel.com
|
||||||
# SPDX-FileCopyrightText: 2021 Aaron Dewes <aaron.dewes@web.de>
|
# SPDX-FileCopyrightText: 2021-2022 Citadel and contributors
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# SPDX-FileCopyrightText: 2020 Umbrel. https://getumbrel.com
|
# SPDX-FileCopyrightText: 2020 Umbrel. https://getumbrel.com
|
||||||
# SPDX-FileCopyrightText: 2021 Aaron Dewes <aaron.dewes@web.de>
|
# SPDX-FileCopyrightText: 2021-2022 Citadel and contributors
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# SPDX-FileCopyrightText: 2020 Umbrel. https://getumbrel.com
|
# SPDX-FileCopyrightText: 2020 Umbrel. https://getumbrel.com
|
||||||
# SPDX-FileCopyrightText: 2021 Aaron Dewes <aaron.dewes@web.de>
|
# SPDX-FileCopyrightText: 2021-2022 Citadel and contributors
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
SPDX-FileCopyrightText: 2020 Aaron Dewes <aaron.dewes@web.de>
|
SPDX-FileCopyrightText: 2021-2022 Citadel and contributors
|
||||||
|
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
Loading…
Reference in New Issue
Block a user