Skip to content

Commit 45141ce

Browse files
committed
caddy: only show grafana / fork observer in dashboard if they exist
1 parent b8b9af0 commit 45141ce

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

resources/charts/caddy/values.yaml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,3 @@ volumeMounts:
8585
subPath: index
8686

8787
port: 80
88-
89-
services:
90-
- title: Grafana
91-
path: /grafana/
92-
host: loki-grafana
93-
port: 80
94-
- title: Fork Observer
95-
path: /fork-observer/
96-
host: fork-observer
97-
port: 2323
98-

src/warnet/deploy.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,25 @@ def deploy_caddy(directory: Path, debug: bool):
269269
if not network_file.get(name, {}).get("enabled", False):
270270
return
271271

272-
cmd = f"{HELM_COMMAND} {name} {CADDY_CHART} --namespace {namespace} --create-namespace"
272+
# configure reverse proxy to webservers in the network
273+
services = []
274+
# built-in services
275+
if check_logging_required(directory):
276+
services.append(
277+
{"title": "Grafana", "path": "/grafana/", "host": "loki-grafana", "port": 80}
278+
)
279+
if network_file.get("fork_observer", {}).get("enabled", False):
280+
services.append(
281+
{"title": "Fork Observer", "path": "/fork-observer/", "host": "fork-observer", "port": 2323}
282+
)
283+
284+
click.echo(f"Adding services to dashboard: {json.dumps(services, indent=2)}")
285+
286+
cmd = (
287+
f"{HELM_COMMAND} {name} {CADDY_CHART} "
288+
f"--namespace {namespace} --create-namespace "
289+
f"--set-json services='{json.dumps(services)}'"
290+
)
273291
if debug:
274292
cmd += " --debug"
275293

0 commit comments

Comments
 (0)