diff --git a/ix-dev/stable/diskoverdata/app.yaml b/ix-dev/stable/diskoverdata/app.yaml index e44c499b91..c601f6fe2d 100644 --- a/ix-dev/stable/diskoverdata/app.yaml +++ b/ix-dev/stable/diskoverdata/app.yaml @@ -1,3 +1,5 @@ +annotations: + min_scale_version: '25.04' app_version: 2.3.0 capabilities: - description: Diskover is able to chown files. @@ -50,4 +52,4 @@ sources: - https://github.com/linuxserver/docker-diskover title: Diskover Data train: stable -version: 1.4.10 +version: 1.5.0 diff --git a/ix-dev/stable/diskoverdata/migrations.yaml b/ix-dev/stable/diskoverdata/migrations.yaml new file mode 100644 index 0000000000..b9eb2d279d --- /dev/null +++ b/ix-dev/stable/diskoverdata/migrations.yaml @@ -0,0 +1,4 @@ +migrations: + - file: ip_port_migration + target: + min_version: 1.5.0 diff --git a/ix-dev/stable/diskoverdata/migrations/ip_port_migration b/ix-dev/stable/diskoverdata/migrations/ip_port_migration new file mode 100755 index 0000000000..381ef3d30d --- /dev/null +++ b/ix-dev/stable/diskoverdata/migrations/ip_port_migration @@ -0,0 +1,23 @@ +#!/usr/bin/python3 + +import os +import sys +import yaml + + +def migrate(values): + values["network"]["web_port"] = { + "port_number": values["network"]["web_port"], + "bind_mode": "published", + "host_ips": [], + } + return values + + +if __name__ == "__main__": + if len(sys.argv) != 2: + exit(1) + + if os.path.exists(sys.argv[1]): + with open(sys.argv[1], "r") as f: + print(yaml.dump(migrate(yaml.safe_load(f.read())))) diff --git a/ix-dev/stable/diskoverdata/questions.yaml b/ix-dev/stable/diskoverdata/questions.yaml index f4ab2fdd72..be47ce1176 100644 --- a/ix-dev/stable/diskoverdata/questions.yaml +++ b/ix-dev/stable/diskoverdata/questions.yaml @@ -91,13 +91,52 @@ questions: attrs: - variable: web_port label: WebUI Port - description: The port for Diskover Data WebUI schema: - type: int - default: 30102 - required: true - $ref: - - definitions/port + type: dict + show_if: [["host_network", "=", false]] + attrs: + - variable: bind_mode + label: Port Bind Mode + description: | + The port bind mode.
+ - Publish: The port will be published on the host for external access.
+ - Expose: The port will be exposed for inter-container communication.
+ - None: The port will not be exposed or published.
+ Note: If the Dockerfile defines an EXPOSE directive, + the port will still be exposed for inter-container communication regardless of this setting. + schema: + type: string + default: "published" + enum: + - value: "published" + description: Publish port on the host for external access + - value: "exposed" + description: Expose port for inter-container communication + - value: "" + description: None + - variable: port_number + label: Port Number + schema: + type: int + show_if: [["bind_mode", "=", "published"]] + default: 30102 + required: true + $ref: + - definitions/port + - variable: host_ips + label: Host IPs + description: IPs on the host to bind this port + schema: + type: list + default: [] + items: + - variable: host_ip + label: Host IP + schema: + type: string + required: true + $ref: + - definitions/node_bind_ip - variable: host_network label: Host Network description: | diff --git a/ix-dev/stable/diskoverdata/templates/docker-compose.yaml b/ix-dev/stable/diskoverdata/templates/docker-compose.yaml index 7d762f1c8d..9742d2555a 100644 --- a/ix-dev/stable/diskoverdata/templates/docker-compose.yaml +++ b/ix-dev/stable/diskoverdata/templates/docker-compose.yaml @@ -40,7 +40,9 @@ {% do c1.environment.add_env("ES_HTTPS", false) %} {% do c1.environment.add_user_envs(values.diskover_data.additional_envs) %} -{% do c1.ports.add_port(values.network.web_port, values.consts.internal_web_port) %} +{% if not values.network.host_network %} + {% do c1.add_port(values.network.web_port, {"container_port": values.consts.internal_web_port}) %} +{% endif %} {% do c1.add_storage("/config", values.storage.config) %} {% do c1.add_storage("/data", values.storage.data) %} @@ -54,7 +56,8 @@ {% do es.depends.add_dependency(values.consts.perms_container_name, "service_completed_successfully") %} {% endif %} -{% do tpl.portals.add_portal({"port": values.network.web_port, "path": "/login.php"}) %} +{% set port = values.consts.internal_web_port if values.network.host_network else values.network.web_port.port_number %} +{% do tpl.portals.add_portal({"port": port, "path": "/login.php"}) %} {% do tpl.notes.set_body(values.consts.notes_body) %} {{ tpl.render() | tojson }} diff --git a/ix-dev/stable/diskoverdata/templates/test_values/basic-values.yaml b/ix-dev/stable/diskoverdata/templates/test_values/basic-values.yaml index 53a10f1286..b4063404fb 100644 --- a/ix-dev/stable/diskoverdata/templates/test_values/basic-values.yaml +++ b/ix-dev/stable/diskoverdata/templates/test_values/basic-values.yaml @@ -11,7 +11,9 @@ diskover_data: additional_envs: [] network: host_network: false - web_port: 8080 + web_port: + bind_mode: published + port_number: 8080 run_as: user: 568