Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate apps to support host-ip per port (part 1) #1550

Draft
wants to merge 57 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
cbf74e8
collabora
stavros-k Feb 7, 2025
f893010
diskoverdata
stavros-k Feb 7, 2025
39ce5e1
elastic-search
stavros-k Feb 7, 2025
d3175b2
emby
stavros-k Feb 7, 2025
4afd15c
home-assistant
stavros-k Feb 7, 2025
260a92a
ix-app
stavros-k Feb 7, 2025
00b2a29
minio
stavros-k Feb 7, 2025
85ecc2a
netdata
stavros-k Feb 7, 2025
5f21796
nextcloud
stavros-k Feb 7, 2025
f82a985
photoprism
stavros-k Feb 7, 2025
7202d42
pihole
stavros-k Feb 7, 2025
64af975
plex
stavros-k Feb 7, 2025
f21ee49
prometheis
stavros-k Feb 7, 2025
09985b7
storj
stavros-k Feb 7, 2025
b62c90a
syncthing
stavros-k Feb 7, 2025
c1bee2f
wg-easy
stavros-k Feb 7, 2025
d3d8ade
minio
stavros-k Feb 7, 2025
c96e4ee
syncthing
stavros-k Feb 7, 2025
ea945d6
asigra-ds-system
stavros-k Feb 7, 2025
1f72e16
actual-budget
stavros-k Feb 7, 2025
5e5c878
adguard-home
stavros-k Feb 7, 2025
618e994
audiobookshelf
stavros-k Feb 7, 2025
0fa8384
autobrr
stavros-k Feb 7, 2025
ae108b6
bazarr
stavros-k Feb 7, 2025
4ae6f75
briefkasten
stavros-k Feb 7, 2025
58a7e48
calibre
stavros-k Feb 7, 2025
067822b
castopod
stavros-k Feb 7, 2025
df87e2e
chia
stavros-k Feb 7, 2025
ebf5aa0
clamav
stavros-k Feb 7, 2025
85e3a68
dashy
stavros-k Feb 10, 2025
96d3714
ddns-updater
stavros-k Feb 10, 2025
59de461
deluge
stavros-k Feb 10, 2025
c99c267
distribution
stavros-k Feb 10, 2025
eb777cc
dockge
stavros-k Feb 10, 2025
824c431
drawio
stavros-k Feb 10, 2025
87b677c
eclipse-mosquitto
stavros-k Feb 10, 2025
af2793e
filebrowser
stavros-k Feb 11, 2025
d92ec21
filestash
stavros-k Feb 11, 2025
91913f9
firefly-iii
stavros-k Feb 11, 2025
2f28ff0
flame
stavros-k Feb 11, 2025
c83939a
flaresolverr
stavros-k Feb 11, 2025
f237847
freshrss
stavros-k Feb 11, 2025
4a10db9
frigate
stavros-k Feb 11, 2025
061f591
fscrawler
stavros-k Feb 11, 2025
6339ac9
gaseous-server
stavros-k Feb 11, 2025
1192db7
gitea
stavros-k Feb 11, 2025
0f94bc0
grafana
stavros-k Feb 11, 2025
6da3567
handbrake
stavros-k Feb 11, 2025
e38689d
homepage
stavros-k Feb 11, 2025
d459923
homer
stavros-k Feb 11, 2025
bbbcd42
immich
stavros-k Feb 11, 2025
0d563e5
invidious
stavros-k Feb 11, 2025
ec36c22
ipfs
stavros-k Feb 11, 2025
11d3a27
jellyfin
stavros-k Feb 12, 2025
975709d
jellyseerr
stavros-k Feb 12, 2025
3477e25
jenkins
stavros-k Feb 12, 2025
287ff73
joplin
stavros-k Feb 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 3 additions & 1 deletion ix-dev/community/actual-budget/app.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
annotations:
min_scale_version: '25.04'
app_version: 25.2.1
capabilities: []
categories:
Expand Down Expand Up @@ -32,4 +34,4 @@ sources:
- https://hub.docker.com/r/actualbudget/actual-server
title: Actual Budget
train: community
version: 1.2.13
version: 1.3.0
6 changes: 6 additions & 0 deletions ix-dev/community/actual-budget/app_migrations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
migrations:
- file: ip_port_migration
# from:
# max_version: "FIXME:"
target:
min_version: 1.3.0
23 changes: 23 additions & 0 deletions ix-dev/community/actual-budget/migrations/ip_port_migration
Original file line number Diff line number Diff line change
@@ -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()))))
50 changes: 44 additions & 6 deletions ix-dev/community/actual-budget/questions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,51 @@ questions:
attrs:
- variable: web_port
label: WebUI Port
description: The port for Actual Budget WebUI
schema:
type: int
default: 31012
required: true
$ref:
- definitions/port
type: dict
attrs:
- variable: bind_mode
label: Port Bind Mode
description: |
The port bind mode.</br>
- Publish: The port will be published on the host for external access.</br>
- Expose: The port will be exposed for inter-container communication.</br>
- None: The port will not be exposed or published.</br>
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", "!=", ""]]
default: 31012
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: |
Expand Down
6 changes: 3 additions & 3 deletions ix-dev/community/actual-budget/templates/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{% do c1.set_user(values.run_as.user, values.run_as.group) %}
{% do c1.healthcheck.set_custom_test("NPM_CONFIG_UPDATE_NOTIFIER=false NODE_TLS_REJECT_UNAUTHORIZED=0 npm run health-check") %}

{% do c1.environment.add_env("ACTUAL_PORT", values.network.web_port) %}
{% do c1.environment.add_env("ACTUAL_PORT", values.network.web_port.port_number) %}
{% do c1.environment.add_env("ACTUAL_HOSTNAME", "0.0.0.0") %}
{% do c1.environment.add_env("ACTUAL_SERVER_FILES", "%s/server-files" | format(values.consts.base_data_path)) %}
{% do c1.environment.add_env("ACTUAL_USER_FILES", "%s/user-files" | format(values.consts.base_data_path)) %}
Expand All @@ -22,7 +22,7 @@
{% endif %}

{% do c1.environment.add_user_envs(values.actual_budget.additional_envs) %}
{% do c1.ports.add_port(values.network.web_port, values.network.web_port) %}
{% do c1.add_port(values.network.web_port) %}

{% do c1.add_storage("/data", values.storage.data) %}
{% do perm_container.add_or_skip_action("data", values.storage.data, perms_config) %}
Expand All @@ -37,6 +37,6 @@
{% do c1.depends.add_dependency(values.consts.perms_container_name, "service_completed_successfully") %}
{% endif %}

{% do tpl.portals.add_portal({"port": values.network.web_port, "scheme": "https" if values.network.certificate_id else "http"}) %}
{% do tpl.portals.add_portal({"port": values.network.web_port.port_number, "scheme": "https" if values.network.certificate_id else "http"}) %}

{{ tpl.render() | tojson }}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ actual_budget:
network:
host_network: false
certificate_id: null
web_port: 8080
web_port:
bind_mode: published
port_number: 8080

run_as:
user: 568
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ actual_budget:
additional_envs: []
network:
host_network: true
web_port: 8080
web_port:
bind_mode: published
port_number: 8080

run_as:
user: 568
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ actual_budget:
network:
host_network: false
certificate_id: "1"
web_port: 8080
web_port:
bind_mode: published
port_number: 8080

run_as:
user: 568
Expand Down
4 changes: 3 additions & 1 deletion ix-dev/community/adguard-home/app.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
annotations:
min_scale_version: '25.04'
app_version: v0.107.56
capabilities:
- description: AdGuard Home is able to bind to a privileged port.
Expand Down Expand Up @@ -42,4 +44,4 @@ sources:
- https://hub.docker.com/r/adguard/adguardhome
title: AdGuard Home
train: community
version: 1.1.15
version: 1.2.0
6 changes: 6 additions & 0 deletions ix-dev/community/adguard-home/app_migrations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
migrations:
- file: ip_port_migration
# from:
# max_version: "FIXME:"
target:
min_version: 1.2.0
28 changes: 28 additions & 0 deletions ix-dev/community/adguard-home/migrations/ip_port_migration
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/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": [],
}
values["network"]["dns_port"] = {
"port_number": values["network"].get("dns_port", 1053),
"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()))))
100 changes: 88 additions & 12 deletions ix-dev/community/adguard-home/questions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,22 +69,98 @@ questions:
attrs:
- variable: web_port
label: WebUI Port
description: The port for AdGuard Home WebUI
schema:
type: int
default: 30004
required: true
$ref:
- definitions/port
type: dict
attrs:
- variable: bind_mode
label: Port Bind Mode
description: |
The port bind mode.</br>
- Publish: The port will be published on the host for external access.</br>
- Expose: The port will be exposed for inter-container communication.</br>
- None: The port will not be exposed or published.</br>
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", "!=", ""]]
default: 30004
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: dns_port
label: DNS Port
description: The port for AdGuard Home DNS
schema:
type: int
default: 53
required: true
$ref:
- definitions/port
type: dict
attrs:
- variable: bind_mode
label: Port Bind Mode
description: |
The port bind mode.</br>
- Publish: The port will be published on the host for external access.</br>
- Expose: The port will be exposed for inter-container communication.</br>
- None: The port will not be exposed or published.</br>
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: 53
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: |
Expand Down
12 changes: 6 additions & 6 deletions ix-dev/community/adguard-home/templates/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{% set c1 = tpl.add_container(values.consts.adguard_container_name, "image") %}
{% do c1.healthcheck.set_test("wget", {
"port": values.adguard.https_port_to_probe if values.adguard.use_https_probe else values.network.web_port,
"port": values.adguard.https_port_to_probe if values.adguard.use_https_probe else values.network.web_port.port_number,
"scheme": "https" if values.adguard.use_https_probe else "http",
"path": "/",
}) %}
Expand All @@ -17,16 +17,16 @@
{% do c1.set_command([
"--no-check-update",
"--web-addr",
"0.0.0.0:%d"|format(values.network.web_port),
"0.0.0.0:%d"|format(values.network.web_port.port_number),
"--config",
"%s/AdGuardHome.yaml"|format(values.consts.config_path),
"--work-dir",
values.consts.work_path,
]) %}

{% do c1.ports.add_port(values.network.web_port, values.network.web_port) %}
{% do c1.ports.add_port(values.network.dns_port, 53) %}
{% do c1.ports.add_port(values.network.dns_port, 53, {"protocol": "udp"}) %}
{% do c1.add_port(values.network.web_port) %}
{% do c1.add_port(values.network.dns_port, {"container_port": 53}) %}
{% do c1.add_port(values.network.dns_port, {"container_port": 53, "protocol": "udp"}) %}

{% for port in values.network.additional_ports %}
{% do c1.add_port(port) %}
Expand All @@ -39,6 +39,6 @@
{% endfor %}

{% do tpl.notes.set_body(values.consts.notes_body) %}
{% do tpl.portals.add_portal({"port": values.network.web_port}) %}
{% do tpl.portals.add_portal({"port": values.network.web_port.port_number}) %}

{{ tpl.render() | tojson }}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ resources:
adguard:
additional_envs: []
network:
web_port: 8080
dns_port: 1053
web_port:
bind_mode: published
port_number: 8080
dns_port:
bind_mode: published
port_number: 1053
host_network: false
dhcp_enabled: false
additional_ports: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ resources:
adguard:
additional_envs: []
network:
web_port: 8080
dns_port: 1053
web_port:
bind_mode: published
port_number: 8080
dns_port:
bind_mode: published
port_number: 1053
host_network: false
dhcp_enabled: true
additional_ports: []
Expand Down
4 changes: 3 additions & 1 deletion ix-dev/community/audiobookshelf/app.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
annotations:
min_scale_version: '25.04'
app_version: 2.19.2
capabilities: []
categories:
Expand Down Expand Up @@ -33,4 +35,4 @@ sources:
- https://github.com/advplyr/audiobookshelf
title: Audiobookshelf
train: community
version: 1.3.16
version: 1.4.0
Loading
Loading