4c8bf63ce3
New "Configurations" section lets operators pre-configure customer settings
in the Hub, then docker-setup.sh can download a ready-made controller.yaml
using just a customer ID and retrieval password.
- Store: customer_configs table with CRUD + per-customer API key lookup
- API: GET /api/v1/config/{id} with X-Retrieval-Password auth
- Auth: per-customer API keys alongside existing global key (backward compatible)
- Web UI: /configs list, create, edit, delete, YAML preview, copy-to-clipboard
- YAML gen: deep-merge controller.yaml.example template with customer overrides
- Template fetcher: background goroutine refreshing template from Gitea repo
- Navigation: Dashboard / Configurations tabs on all pages
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
149 lines
7.8 KiB
HTML
149 lines
7.8 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Felhom Hub — {{if .IsNew}}New Configuration{{else}}Edit {{.Config.CustomerID}}{{end}}</title>
|
|
<link rel="stylesheet" href="/style.css">
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<header>
|
|
<h1>Felhom Hub</h1>
|
|
<nav class="nav-links">
|
|
<a href="/" class="nav-link">Dashboard</a>
|
|
<a href="/configs" class="nav-link active">Configurations</a>
|
|
</nav>
|
|
</header>
|
|
|
|
<a href="{{if .IsNew}}/configs{{else}}/configs/{{.Config.CustomerID}}{{end}}" class="back-link">← Back</a>
|
|
<h2>{{if .IsNew}}New Customer Configuration{{else}}Edit: {{.Config.CustomerID}}{{end}}</h2>
|
|
|
|
{{if .Error}}
|
|
<div class="flash flash-error">{{.Error}}</div>
|
|
{{end}}
|
|
|
|
<form method="POST" action="{{if .IsNew}}/configs/new{{else}}/configs/{{.Config.CustomerID}}/edit{{end}}" class="config-form">
|
|
<div class="card">
|
|
<h2>Customer Identity</h2>
|
|
<div class="form-grid">
|
|
<div class="form-group">
|
|
<label for="customer_id">Customer ID *</label>
|
|
<input type="text" id="customer_id" name="customer_id"
|
|
value="{{.Config.CustomerID}}"
|
|
pattern="[a-zA-Z0-9.\-]+"
|
|
placeholder="e.g. customer-1"
|
|
{{if not .IsNew}}readonly{{end}}
|
|
required>
|
|
{{if .IsNew}}<span class="form-hint">Letters, numbers, dots, hyphens only</span>{{end}}
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="customer_name">Display Name *</label>
|
|
<input type="text" id="customer_name" name="customer_name"
|
|
value="{{.Config.CustomerName}}"
|
|
placeholder="e.g. Kovács család"
|
|
required>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="domain">Domain *</label>
|
|
<input type="text" id="domain" name="domain"
|
|
value="{{.Config.Domain}}"
|
|
placeholder="e.g. kovacs.felhom.eu"
|
|
required>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="email">Email</label>
|
|
<input type="email" id="email" name="email"
|
|
value="{{.Config.Email}}"
|
|
placeholder="e.g. kovacs@example.com">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<details class="card" {{if index .Overrides "infrastructure"}}open{{end}}>
|
|
<summary><h2 style="display:inline">Infrastructure</h2></summary>
|
|
<div class="form-grid" style="margin-top: 1rem;">
|
|
<div class="form-group">
|
|
<label for="cf_tunnel_token">Cloudflare Tunnel Token</label>
|
|
<input type="text" id="cf_tunnel_token" name="cf_tunnel_token"
|
|
value="{{with .Overrides}}{{with index . "infrastructure"}}{{with index . "cf_tunnel_token"}}{{.}}{{end}}{{end}}{{end}}"
|
|
placeholder="Optional">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="cf_api_token">Cloudflare API Token</label>
|
|
<input type="text" id="cf_api_token" name="cf_api_token"
|
|
value="{{with .Overrides}}{{with index . "infrastructure"}}{{with index . "cf_api_token"}}{{.}}{{end}}{{end}}{{end}}"
|
|
placeholder="For DNS-01 challenge">
|
|
</div>
|
|
</div>
|
|
</details>
|
|
|
|
<details class="card" {{if index .Overrides "git"}}open{{end}}>
|
|
<summary><h2 style="display:inline">Git Sync</h2></summary>
|
|
<div class="form-grid" style="margin-top: 1rem;">
|
|
<div class="form-group">
|
|
<label for="git_username">Git Username</label>
|
|
<input type="text" id="git_username" name="git_username"
|
|
value="{{with .Overrides}}{{with index . "git"}}{{with index . "username"}}{{.}}{{end}}{{end}}{{end}}"
|
|
placeholder="For private catalog">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="git_token">Git Token</label>
|
|
<input type="text" id="git_token" name="git_token"
|
|
value="{{with .Overrides}}{{with index . "git"}}{{with index . "token"}}{{.}}{{end}}{{end}}{{end}}"
|
|
placeholder="For private catalog">
|
|
</div>
|
|
</div>
|
|
</details>
|
|
|
|
<details class="card" {{if index .Overrides "monitoring"}}open{{end}}>
|
|
<summary><h2 style="display:inline">Monitoring UUIDs</h2></summary>
|
|
<div class="form-grid" style="margin-top: 1rem;">
|
|
{{$uuids := ""}}
|
|
{{with .Overrides}}{{with index . "monitoring"}}{{with index . "ping_uuids"}}{{$uuids = .}}{{end}}{{end}}{{end}}
|
|
<div class="form-group">
|
|
<label for="uuid_heartbeat">Heartbeat</label>
|
|
<input type="text" id="uuid_heartbeat" name="uuid_heartbeat"
|
|
value="{{with $uuids}}{{with index . "heartbeat"}}{{.}}{{end}}{{end}}"
|
|
placeholder="UUID">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="uuid_system_health">System Health</label>
|
|
<input type="text" id="uuid_system_health" name="uuid_system_health"
|
|
value="{{with $uuids}}{{with index . "system_health"}}{{.}}{{end}}{{end}}"
|
|
placeholder="UUID">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="uuid_db_dump">DB Dump</label>
|
|
<input type="text" id="uuid_db_dump" name="uuid_db_dump"
|
|
value="{{with $uuids}}{{with index . "db_dump"}}{{.}}{{end}}{{end}}"
|
|
placeholder="UUID">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="uuid_backup">Backup</label>
|
|
<input type="text" id="uuid_backup" name="uuid_backup"
|
|
value="{{with $uuids}}{{with index . "backup"}}{{.}}{{end}}{{end}}"
|
|
placeholder="UUID">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="uuid_backup_integrity">Backup Integrity</label>
|
|
<input type="text" id="uuid_backup_integrity" name="uuid_backup_integrity"
|
|
value="{{with $uuids}}{{with index . "backup_integrity"}}{{.}}{{end}}{{end}}"
|
|
placeholder="UUID">
|
|
</div>
|
|
</div>
|
|
</details>
|
|
|
|
<div style="margin-top: 1.5rem; display: flex; gap: 1rem;">
|
|
<button type="submit" class="btn">{{if .IsNew}}Create Configuration{{else}}Save Changes{{end}}</button>
|
|
<a href="{{if .IsNew}}/configs{{else}}/configs/{{.Config.CustomerID}}{{end}}" class="btn btn-outline">Cancel</a>
|
|
</div>
|
|
</form>
|
|
|
|
<footer>
|
|
<p>Felhom Hub — Configuration Management</p>
|
|
</footer>
|
|
</div>
|
|
</body>
|
|
</html>
|