diff --git a/ix-dev/stable/emby/app.yaml b/ix-dev/stable/emby/app.yaml index 4f948493b7..c7433bcfb4 100644 --- a/ix-dev/stable/emby/app.yaml +++ b/ix-dev/stable/emby/app.yaml @@ -1,3 +1,5 @@ +annotations: + min_scale_version: '25.04' app_version: 4.8.10.0 capabilities: - description: Emby is able to chown files. @@ -49,4 +51,4 @@ sources: - https://github.com/truenas/charts/tree/master/charts/emby title: Emby Server train: stable -version: 1.2.15 +version: 1.3.0 diff --git a/ix-dev/stable/emby/ix_values.yaml b/ix-dev/stable/emby/ix_values.yaml index 68d611f27e..31b23fd0df 100644 --- a/ix-dev/stable/emby/ix_values.yaml +++ b/ix-dev/stable/emby/ix_values.yaml @@ -5,3 +5,5 @@ images: consts: emby_container_name: emby + internal_http_port: 8096 + internal_https_port: 8920 diff --git a/ix-dev/stable/emby/migrations.yaml b/ix-dev/stable/emby/migrations.yaml new file mode 100644 index 0000000000..7240b558c5 --- /dev/null +++ b/ix-dev/stable/emby/migrations.yaml @@ -0,0 +1,4 @@ +migrations: + - file: ip_port_migration + target: + min_version: 1.3.0 diff --git a/ix-dev/stable/emby/migrations/ip_port_migration b/ix-dev/stable/emby/migrations/ip_port_migration new file mode 100755 index 0000000000..05d7f53684 --- /dev/null +++ b/ix-dev/stable/emby/migrations/ip_port_migration @@ -0,0 +1,23 @@ +#!/usr/bin/python3 + +import os +import sys +import yaml + + +def migrate(values): + values["network"]["http_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/emby/questions.yaml b/ix-dev/stable/emby/questions.yaml index f15737f52a..3bd0188b78 100644 --- a/ix-dev/stable/emby/questions.yaml +++ b/ix-dev/stable/emby/questions.yaml @@ -78,15 +78,54 @@ questions: schema: type: dict attrs: - - variable: web_port - label: WebUI Port - description: The port for Emby WebUI + - variable: http_port + label: HTTP Port schema: - type: int - default: 9096 - 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: "" + 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: 9096 + 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: https_port label: HTTPS Port schema: diff --git a/ix-dev/stable/emby/templates/docker-compose.yaml b/ix-dev/stable/emby/templates/docker-compose.yaml index da619bf2fd..7b248c0e9b 100644 --- a/ix-dev/stable/emby/templates/docker-compose.yaml +++ b/ix-dev/stable/emby/templates/docker-compose.yaml @@ -3,14 +3,14 @@ {% set c1 = tpl.add_container(values.consts.emby_container_name, "image") %} {% do c1.set_user(0, 0) %} {% do c1.add_caps(["CHOWN", "DAC_OVERRIDE", "FOWNER", "SETGID", "SETUID", "KILL"]) %} -{% do c1.healthcheck.set_test("wget", {"port": 8096, "path": "/emby/System/Ping"}) %} +{% do c1.healthcheck.set_test("wget", {"port": values.consts.internal_http_port, "path": "/emby/System/Ping"}) %} {% do c1.environment.add_env("GIDLIST", c1.get_current_groups()|join(",")) %} {% do c1.environment.add_user_envs(values.emby.additional_envs) %} {% if not values.network.host_network %} - {% do c1.ports.add_port(values.network.web_port, 8096) %} - {% do c1.add_port(values.network.https_port, {"container_port": 8920}) %} + {% do c1.add_port(values.network.http_port, {"container_port": values.consts.internal_http_port}) %} + {% do c1.add_port(values.network.https_port, {"container_port": values.consts.internal_https_port}) %} {% endif %} {% do c1.add_storage("/config", values.storage.config) %} @@ -18,6 +18,6 @@ {% do c1.add_storage(store.mount_path, store) %} {% endfor %} -{% do tpl.portals.add_portal({"port": 8096 if values.network.host_network else values.network.web_port})%} +{% do tpl.portals.add_portal({"port": values.consts.internal_http_port if values.network.host_network else values.network.http_port.port_number})%} {{ tpl.render() | tojson }} diff --git a/ix-dev/stable/emby/templates/test_values/basic-values.yaml b/ix-dev/stable/emby/templates/test_values/basic-values.yaml index 613696b5d3..c23ddac43a 100644 --- a/ix-dev/stable/emby/templates/test_values/basic-values.yaml +++ b/ix-dev/stable/emby/templates/test_values/basic-values.yaml @@ -9,7 +9,9 @@ emby: additional_envs: [] network: host_network: false - web_port: 8096 + http_port: + bind_mode: published + port_number: 8080 https_port: bind_mode: "" diff --git a/ix-dev/stable/emby/templates/test_values/hostnet-values.yaml b/ix-dev/stable/emby/templates/test_values/hostnet-values.yaml index 03639e5cac..adfa4a9860 100644 --- a/ix-dev/stable/emby/templates/test_values/hostnet-values.yaml +++ b/ix-dev/stable/emby/templates/test_values/hostnet-values.yaml @@ -9,10 +9,12 @@ emby: additional_envs: [] network: host_network: true - web_port: 32400 + http_port: + bind_mode: published + port_number: 8080 https_port: bind_mode: "" - + run_as: user: 568 group: 568