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

apps: fix default ports #1517

Merged
merged 8 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .github/scripts/port_validation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/usr/bin/python3

import sys
import yaml

from collections import defaultdict
from os import scandir


def extract_ports(quests):
ports = []
for quest in quests:
schema = quest["schema"]
if schema["type"] == "int" and "definitions/port" in schema.get("$ref", []) and "default" in schema:
ports.append({"name": quest["variable"], "port": schema["default"]})
elif schema["type"] == "dict":
ports.extend(extract_ports(schema["attrs"]))
elif schema["type"] == "list":
ports.extend(extract_ports(schema["items"]))

return ports


def scan_directory(path: str, current_depth: int = 0, to_depth: int = 2):
"""Iterate over `path` to depth level `to_depth`
and yield any file paths at that level."""
if current_depth > to_depth:
return

with scandir(path) as sdir:
for entry in sdir:
if current_depth == to_depth and entry.is_file():
yield entry.path
elif (current_depth < to_depth) and entry.is_dir():
yield from scan_directory(entry.path, current_depth + 1)


def get_current_port_map():
port_map = defaultdict(list)
ignore_ports = (53, 22000)
dupe_found = False
for path in filter(lambda x: x.endswith("questions.yaml"), scan_directory("ix-dev")):
with open(path) as f:
parts = path.split("/")
app_info = f"{parts[-3]}/{parts[-2]}"
for item in extract_ports(yaml.load(f, Loader=yaml.FullLoader)["questions"]):
app_port, app_name = item["port"], item["name"]
port_map[app_port].append(f"{app_info} ({app_name})")
if len(port_map[app_port]) > 1 and app_port not in ignore_ports:
dupe_found = True
dup_apps = ", ".join(port_map[app_port])
print(f"Duplicate port [{app_port}] in apps: {dup_apps}")
return port_map, dupe_found


def main():
start_range, max_range = 30000, 40000
port_map, dupe_found = get_current_port_map()
next_5_avail_ports = sorted(list(set(range(start_range, max_range + 1)) - set(port_map)))[:5]
print(f"Next 5 available ports: [{', '.join([str(x) for x in next_5_avail_ports])}]")
if dupe_found:
print("Duplicate ports found, please use one of the available ports.")
sys.exit(1)


if __name__ == "__main__":
main()
2 changes: 2 additions & 0 deletions .github/workflows/dev_apps_validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ jobs:
run: git fetch -u origin master:master
- name: validate dev catalog
run: /bin/bash -c "/usr/local/bin/apps_dev_charts_validate validate --path $(pwd)"
- name: Validate Ports
run: ./.github/scripts/port_validation.py
2 changes: 1 addition & 1 deletion ix-dev/community/autobrr/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ sources:
- https://github.com/autobrr/autobrr
title: Autobrr
train: community
version: 1.2.15
version: 1.2.16
2 changes: 1 addition & 1 deletion ix-dev/community/autobrr/questions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ questions:
description: The port for Autobrr WebUI
schema:
type: int
default: 30051
default: 30016
required: true
$ref:
- definitions/port
Expand Down
2 changes: 1 addition & 1 deletion ix-dev/community/dozzle/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ sources:
- https://github.com/amir20/dozzle
title: Dozzle
train: community
version: 1.0.0
version: 1.0.1
2 changes: 1 addition & 1 deletion ix-dev/community/dozzle/questions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ questions:
schema:
type: int
show_if: [["bind_mode", "!=", ""]]
default: 31100
default: 30064
required: true
$ref:
- definitions/port
Expand Down
2 changes: 1 addition & 1 deletion ix-dev/community/firefly-iii/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ sources:
- https://github.com/firefly-iii/firefly-iii
title: Firefly III
train: community
version: 1.4.11
version: 1.4.12
2 changes: 1 addition & 1 deletion ix-dev/community/firefly-iii/questions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ questions:
description: The port for Firefly III WebUI
schema:
type: int
default: 30027
default: 30105
required: true
$ref:
- definitions/port
Expand Down
2 changes: 1 addition & 1 deletion ix-dev/community/flaresolverr/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ sources:
- https://github.com/FlareSolverr/FlareSolverr
title: FlareSolverr
train: community
version: 1.0.16
version: 1.0.17
2 changes: 1 addition & 1 deletion ix-dev/community/flaresolverr/questions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ questions:
description: The port for FlareSolverr WebUI
schema:
type: int
default: 31027
default: 30098
required: true
$ref:
- definitions/port
Expand Down
2 changes: 1 addition & 1 deletion ix-dev/community/freshrss/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ sources:
- https://hub.docker.com/r/freshrss/freshrss
title: FreshRSS
train: community
version: 1.3.7
version: 1.3.8
2 changes: 1 addition & 1 deletion ix-dev/community/freshrss/questions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ questions:
description: The port for FreshRSS WebUI
schema:
type: int
default: 30027
default: 30108
required: true
$ref:
- definitions/port
Expand Down
2 changes: 1 addition & 1 deletion ix-dev/community/glances/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ sources:
- https://hub.docker.com/r/nicolargo/glances
title: Glances
train: community
version: 1.0.2
version: 1.0.3
2 changes: 1 addition & 1 deletion ix-dev/community/glances/questions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ questions:
schema:
type: int
show_if: [["bind_mode", "!=", ""]]
default: 31116
default: 30015
required: true
$ref:
- definitions/port
Expand Down
2 changes: 1 addition & 1 deletion ix-dev/community/handbrake/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ sources:
- https://hub.docker.com/r/jlesage/handbrake
title: Handbrake
train: community
version: 2.1.8
version: 2.1.9
4 changes: 2 additions & 2 deletions ix-dev/community/handbrake/questions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ questions:
description: The port for Handbrake WebUI
schema:
type: int
default: 31010
default: 30089
required: true
$ref:
- definitions/port
Expand All @@ -113,7 +113,7 @@ questions:
description: The port for VNC
schema:
type: int
default: 31011
default: 30044
required: true
$ref:
- definitions/port
Expand Down
2 changes: 1 addition & 1 deletion ix-dev/community/homarr/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ sources:
- ghcr.io/homarr-labs/homarr
title: Homarr
train: community
version: 2.0.7
version: 2.0.8
2 changes: 1 addition & 1 deletion ix-dev/community/homarr/questions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ questions:
schema:
type: int
show_if: [["bind_mode", "=", "published"]]
default: 30052
default: 30100
required: true
$ref:
- definitions/port
Expand Down
2 changes: 1 addition & 1 deletion ix-dev/community/it-tools/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ sources:
- https://github.com/CorentinTh/it-tools/
title: IT Tools
train: community
version: 1.0.2
version: 1.0.3
2 changes: 1 addition & 1 deletion ix-dev/community/it-tools/questions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ questions:
schema:
type: int
show_if: [["bind_mode", "=", "published"]]
default: 31100
default: 30063
required: true
$ref:
- definitions/port
Expand Down
2 changes: 1 addition & 1 deletion ix-dev/community/jenkins/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ sources:
- https://www.jenkins.io/
title: Jenkins
train: community
version: 1.1.9
version: 1.1.10
2 changes: 1 addition & 1 deletion ix-dev/community/jenkins/questions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ questions:
description: The port for Jenkins WebUI
schema:
type: int
default: 30025
default: 30017
required: true
$ref:
- definitions/port
Expand Down
2 changes: 1 addition & 1 deletion ix-dev/community/joplin/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ sources:
- https://hub.docker.com/r/joplin/server/
title: Joplin
train: community
version: 1.3.6
version: 1.3.7
4 changes: 2 additions & 2 deletions ix-dev/community/joplin/questions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ questions:
The base URL for Joplin.</br>
Examples:</br>
https://joplin.example.com</br>
http://192.168.1.100:30062
http://192.168.1.100:30106
schema:
type: uri
default: ""
Expand Down Expand Up @@ -88,7 +88,7 @@ questions:
description: The port for Joplin WebUI
schema:
type: int
default: 30027
default: 30106
required: true
$ref:
- definitions/port
Expand Down
2 changes: 1 addition & 1 deletion ix-dev/community/kapowarr/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ sources:
- https://github.com/Casvt/Kapowarr
title: Kapowarr
train: community
version: 1.1.8
version: 1.1.9
2 changes: 1 addition & 1 deletion ix-dev/community/kapowarr/questions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ questions:
description: The port for Kapowarr WebUI
schema:
type: int
default: 31010
default: 30093
show_if: [["host_network", "=", false]]
required: true
$ref:
Expand Down
2 changes: 1 addition & 1 deletion ix-dev/community/lidarr/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ sources:
- https://github.com/Lidarr/Lidarr
title: Lidarr
train: community
version: 1.2.15
version: 1.2.16
2 changes: 1 addition & 1 deletion ix-dev/community/lidarr/questions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ questions:
description: The port for Lidarr WebUI
schema:
type: int
default: 30014
default: 30071
required: true
$ref:
- definitions/port
Expand Down
2 changes: 1 addition & 1 deletion ix-dev/community/listmonk/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ sources:
- https://github.com/knadh/listmonk
title: Listmonk
train: community
version: 1.2.6
version: 1.2.7
2 changes: 1 addition & 1 deletion ix-dev/community/listmonk/questions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ questions:
description: The port for Listmonk WebUI
schema:
type: int
default: 30008
default: 30087
required: true
$ref:
- definitions/port
Expand Down
2 changes: 1 addition & 1 deletion ix-dev/community/logseq/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ sources:
- https://github.com/logseq/logseq
title: Logseq
train: community
version: 1.1.7
version: 1.1.8
2 changes: 1 addition & 1 deletion ix-dev/community/logseq/questions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ questions:
description: The port for Logseq WebUI
schema:
type: int
default: 30079
default: 30086
required: true
$ref:
- definitions/port
Expand Down
2 changes: 1 addition & 1 deletion ix-dev/community/mealie/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ sources:
- https://docs.mealie.io/
title: Mealie
train: community
version: 1.4.10
version: 1.4.11
4 changes: 2 additions & 2 deletions ix-dev/community/mealie/questions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ questions:
description: |
The URL that Mealie will be accessible from.</br>
Example: </br>
http://server.ip:30080</br>
http://server.ip:30111</br>
https://Mealie.example.com
schema:
type: uri
Expand Down Expand Up @@ -135,7 +135,7 @@ questions:
description: The port for Mealie WebUI
schema:
type: int
default: 30027
default: 30111
required: true
$ref:
- definitions/port
Expand Down
2 changes: 1 addition & 1 deletion ix-dev/community/n8n/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ sources:
- https://hub.docker.com/r/n8nio/n8n
title: n8n
train: community
version: 1.5.20
version: 1.5.21
2 changes: 1 addition & 1 deletion ix-dev/community/n8n/questions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ questions:
description: The port for n8n WebUI
schema:
type: int
default: 30027
default: 30109
required: true
$ref:
- definitions/port
Expand Down
2 changes: 1 addition & 1 deletion ix-dev/community/ollama/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ sources:
- https://github.com/ollama/ollama
title: Ollama
train: community
version: 1.0.29
version: 1.0.30
2 changes: 1 addition & 1 deletion ix-dev/community/ollama/questions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ questions:
description: The port for Ollama API
schema:
type: int
default: 31028
default: 30068
required: true
$ref:
- definitions/port
Expand Down
2 changes: 1 addition & 1 deletion ix-dev/community/overseerr/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ sources:
- https://github.com/sct/overseerr
title: Overseerr
train: community
version: 1.1.7
version: 1.1.8
2 changes: 1 addition & 1 deletion ix-dev/community/overseerr/questions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ questions:
description: The port for Overseerr WebUI
schema:
type: int
default: 30042
default: 30002
required: true
$ref:
- definitions/port
Expand Down
2 changes: 1 addition & 1 deletion ix-dev/community/planka/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ sources:
- https://github.com/plankanban/planka
title: Planka
train: community
version: 1.2.7
version: 1.2.8
Loading
Loading