From 02fdae4971d25573fcc142d3690fef7b17e1fa0d Mon Sep 17 00:00:00 2001 From: Aaron Dewes Date: Sun, 5 Jun 2022 20:07:01 +0200 Subject: [PATCH] Publish a beta of 0.0.5 to the beta channel (#46) --- app/lib/composegenerator/v2/utils/networking.py | 8 ++++---- app/lib/composegenerator/v3/generate.py | 5 +++-- app/lib/composegenerator/v3/networking.py | 2 ++ app/lib/validate.py | 16 ++++++++-------- docker-compose.yml | 2 +- info.json | 6 +++--- 6 files changed, 21 insertions(+), 18 deletions(-) diff --git a/app/lib/composegenerator/v2/utils/networking.py b/app/lib/composegenerator/v2/utils/networking.py index aedb781..709969c 100644 --- a/app/lib/composegenerator/v2/utils/networking.py +++ b/app/lib/composegenerator/v2/utils/networking.py @@ -47,7 +47,7 @@ def getContainerHiddenService( if isinstance(container.hiddenServicePorts, int): return getHiddenServiceString( "{} {}".format(metadata.name, container.name), - metadata.id, + metadata.id if isMainContainer else "{}-{}".format(metadata.id, container.name), container.hiddenServicePorts, containerIp, container.hiddenServicePorts, @@ -55,7 +55,7 @@ def getContainerHiddenService( elif isinstance(container.hiddenServicePorts, list): return getHiddenServiceMultiPort( "{} {}".format(metadata.name, container.name), - metadata.id, + metadata.id if isMainContainer else "{}-{}".format(metadata.id, container.name), containerIp, container.hiddenServicePorts, ) @@ -77,14 +77,14 @@ def getContainerHiddenService( else: additionalHiddenServices[key] = value for key, value in additionalHiddenServices.items(): - otherHiddenServices += "\n" if isinstance(value, int): otherHiddenServices += "# {} {} {} Hidden Service\nHiddenServiceDir /var/lib/tor/app-{}-{}\n".format( - metadata.name, container.name, key, metadata.id, container.name + metadata.name, container.name, key, metadata.id, key ) otherHiddenServices += "HiddenServicePort {} {}:{}".format( value, containerIp, value ) + otherHiddenServices += "\n" elif isinstance(value, list): otherHiddenServices += getHiddenServiceMultiPort( "{} {}".format(metadata.name, key), "{}-{}".format(metadata.id, key), containerIp, value diff --git a/app/lib/composegenerator/v3/generate.py b/app/lib/composegenerator/v3/generate.py index 014a769..5b7f56e 100644 --- a/app/lib/composegenerator/v3/generate.py +++ b/app/lib/composegenerator/v3/generate.py @@ -85,11 +85,12 @@ def createComposeConfigFromV3(app: dict, nodeRoot: str): newApp = configureIps(newApp, networkingFile, envFile) # This is validated earlier for container in newApp.containers: - container.ports = container.requiredPorts + for tcpPort in container.requiredPorts: + container.ports.append("{}:{}".format(tcpPort, tcpPort)) del container.requiredPorts for container in newApp.containers: for udpPort in container.requiredUdpPorts: - container.ports.append("{}/udp".format(udpPort)) + container.ports.append("{}/udp:{}/udp".format(udpPort, udpPort)) del container.requiredUdpPorts newApp = configureMainPort(newApp, nodeRoot) newApp = configureHiddenServices(newApp, nodeRoot) diff --git a/app/lib/composegenerator/v3/networking.py b/app/lib/composegenerator/v3/networking.py index 8280c95..66d5a96 100644 --- a/app/lib/composegenerator/v3/networking.py +++ b/app/lib/composegenerator/v3/networking.py @@ -77,6 +77,8 @@ def configureMainPort(app: AppStage2, nodeRoot: str) -> AppStage3: # If it doesn't contain a :, it's the port itself if mainPort == False: mainPort = mainContainer.ports[0] + if mainPort.find(":") != -1: + mainPort = mainPort.split(":")[1] else: mainContainer.ports = [portToAppend] diff --git a/app/lib/validate.py b/app/lib/validate.py index f822659..9dfe236 100644 --- a/app/lib/validate.py +++ b/app/lib/validate.py @@ -7,18 +7,18 @@ import yaml from jsonschema import validate import yaml +scriptDir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..") + +with open(os.path.join(scriptDir, 'app-standard-v1.yml'), 'r') as f: + schemaVersion1 = yaml.safe_load(f) +with open(os.path.join(scriptDir, 'app-standard-v2.yml'), 'r') as f: + schemaVersion2 = yaml.safe_load(f) +with open(os.path.join(scriptDir, 'app-standard-v3.yml'), 'r') as f: + schemaVersion3 = yaml.safe_load(f) # Validates app data # Returns true if valid, false otherwise -scriptDir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..") def validateApp(app: dict): - with open(os.path.join(scriptDir, 'app-standard-v1.yml'), 'r') as f: - schemaVersion1 = yaml.safe_load(f) - with open(os.path.join(scriptDir, 'app-standard-v2.yml'), 'r') as f: - schemaVersion2 = yaml.safe_load(f) - with open(os.path.join(scriptDir, 'app-standard-v3.yml'), 'r') as f: - schemaVersion3 = yaml.safe_load(f) - if 'version' in app and str(app['version']) == "1": try: validate(app, schemaVersion1) diff --git a/docker-compose.yml b/docker-compose.yml index 488db1b..2f9b918 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -100,7 +100,7 @@ services: ipv4_address: $LND_IP dashboard: container_name: dashboard - image: ghcr.io/runcitadel/dashboard:v0.0.12@sha256:102a44b938765be8224c63785949b90bf796670f01aef4e282d58a4c26a42595 + image: ghcr.io/runcitadel/dashboard:v0.0.13@sha256:86be4a105e9599163866d2e4f79c4d4ab9725ce56d71d7d7341e4d0ab3441b54 restart: on-failure stop_grace_period: 1m30s networks: diff --git a/info.json b/info.json index b85be19..cfec533 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { - "version": "0.0.4-rc.1", - "name": "Citadel 0.0.4 Release Candidate 1", + "version": "0.0.5-rc.1", + "name": "Citadel 0.0.5-rc.1", "requires": ">=0.0.1", - "notes": "This update fixes multiple bugs in the 0.0.4 release." + "notes": "This update fixes a few bugs in the 0.0.4 release that were preventing some apps from working correctly." }