Address review feedback: fix hostname regex, use CSS class for NWC warning banner, clarify test comment

This commit is contained in:
copilot-swe-agent[bot]
2026-07-27 11:39:40 +00:00
committed by GitHub
parent 768f26027e
commit 154988bbeb
4 changed files with 23 additions and 5 deletions
+5 -2
View File
@@ -4091,8 +4091,11 @@ def _validate_safe_name(name: str) -> bool:
return bool(name) and _SAFE_NAME_RE.match(name) is not None
# Hostname characters: letters, digits, hyphens, dots (no underscores in FQDNs)
_HOSTNAME_RE = re.compile(r'^[a-z0-9]([a-z0-9\-\.]*[a-z0-9])?$')
# Hostname characters: letters, digits, hyphens only within labels; dots separate labels.
# Each label must start and end with a letter or digit; no consecutive dots.
_HOSTNAME_RE = re.compile(
r'^[a-z0-9]([a-z0-9\-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9\-]*[a-z0-9])?)*$'
)
# Managed domain keys that produce Caddy virtual-host blocks (excluding sslemail)
_MANAGED_DOMAIN_KEYS: frozenset[str] = frozenset([
@@ -171,3 +171,15 @@ domain-field-actions {
.port-req-status {
font-weight: 600;
}
/* ── Wallet Connections unique-hostname warning ───────────────────── */
.domain-nwc-warning {
margin-bottom: 14px;
padding: 10px 14px;
background: rgba(255, 180, 0, 0.10);
border: 1px solid var(--warning-color, #f59e0b);
border-radius: 8px;
font-size: 0.88rem;
line-height: 1.6;
}
@@ -76,7 +76,7 @@ function openDomainSetupModal(feat, onSaved) {
}
var nwcWarning = isWalletConnections
? '<div style="margin-bottom:14px;padding:10px 14px;background:rgba(255,180,0,0.10);border:1px solid var(--warning-color,#f59e0b);border-radius:8px;font-size:0.88rem;line-height:1.6;">' +
? '<div class="domain-nwc-warning">' +
'<strong>⚠ Wallet Connections requires its own unique hostname.</strong> ' +
'Use a new subdomain such as <code>lightning.yourdomain.com</code>, or a separate domain. ' +
'Do not reuse a domain already assigned to Matrix, Nextcloud, WordPress, BTCPay Server, Vaultwarden, Haven, or another Caddy site.' +
@@ -193,7 +193,7 @@ function openDomainReconfigureModal(feat, existingDomain, onSaved) {
}
var nwcWarning = isWalletConnections
? '<div style="margin-bottom:14px;padding:10px 14px;background:rgba(255,180,0,0.10);border:1px solid var(--warning-color,#f59e0b);border-radius:8px;font-size:0.88rem;line-height:1.6;">' +
? '<div class="domain-nwc-warning">' +
'<strong>⚠ Wallet Connections requires its own unique hostname.</strong> ' +
'Use a new subdomain such as <code>lightning.yourdomain.com</code>, or a separate domain. ' +
'Do not reuse a domain already assigned to Matrix, Nextcloud, WordPress, BTCPay Server, Vaultwarden, Haven, or another Caddy site.' +