f037be7a6a
gates / gates (push) Successful in 48s
R-970: /api/config, /api/config/hash, /api/config/apply removed (they read and replaced controller.yaml with every secret, reachable with the box's own hub API key, unsigned; nothing called them). The hub-key Bearer door on /api/selfupdate/ and /api/geo/ and the matching CSRF exemption are gone; the dashboard keeps using those with a session. The route table is buildMux, so a test drives the real one. Data tab: the export password field is autocomplete=new-password with a non-login name; the 2nd copy's status rows that repeated the form are gone (the no-target reason moves into the form). R-1103: app_fields.html loses its installed-only branches (no page serves them since R-1095); the tests that rendered that dead path are retired, their rules asserted on the settings tab (R-694 moved there). Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
138 lines
8.2 KiB
HTML
138 lines
8.2 KiB
HTML
{{/* THE APP'S CONFIGURATION FIELDS — the install wizard's form (deploy.html).
|
|
|
|
It renders ONLY for an app that is not installed (v0.322.0, R-1103): since v0.321.0 (R-1095)
|
|
`/apps/{slug}/install` of an installed app answers 302 to its settings tab, and the settings tab
|
|
shows the install answers as rows and the login as one panel (app_settings.html, app_login.go).
|
|
The old read-only „installed" branches are gone; their secret rules live where the values are
|
|
shown now — R-254/R-709 on the settings tab (TestAppPage_LoginPairPanel, TestR255_NoPlantedSecretReachesAnyPage).
|
|
|
|
The PRE-DEPLOY hidden input is deliberate: the form must carry what it submits, so the value
|
|
saved is the one the household was shown (controller/README §318). */}}
|
|
|
|
{{define "app_deploy_fields"}}
|
|
{{if .AutoFields}}
|
|
<div class="form-section">
|
|
<h4>{{T "deploy.automatikusan_generalt_ertekek"}}</h4>
|
|
<p class="form-section-desc">{{T "deploy.ezek_az_ertekek_a_telepitessel"}}</p>
|
|
{{$autoValues := .AutoFieldValues}}
|
|
{{range .AutoFields}}
|
|
{{$val := index $autoValues .EnvVar}}
|
|
<div class="form-group form-group-auto">
|
|
<label>{{.Label}} {{if eq .Type "secret"}}<span class="auto-generated-badge"><svg class="ico ico-sm"><use href="#i-check"/></svg> {{T "deploy.automatikusan_generalva"}}</span>{{end}}</label>
|
|
{{if $val}}
|
|
{{if eq .Type "secret"}}
|
|
<div class="input-with-button">
|
|
<input type="password" id="auto-field-{{.EnvVar}}" class="form-control" value="{{$val}}" readonly>
|
|
<button type="button" class="btn btn-sm btn-outline" onclick="toggleAutoField('auto-field-{{.EnvVar}}', this)">{{T "deploy.megjelenites"}}</button>
|
|
</div>
|
|
{{else}}
|
|
<input type="text" id="auto-field-{{.EnvVar}}" class="form-control" value="{{$val}}" readonly>
|
|
{{end}}
|
|
{{if eq .Type "secret"}}
|
|
<input type="hidden" name="{{.EnvVar}}" value="{{$val}}">
|
|
{{end}}
|
|
{{end}}
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
{{end}}
|
|
|
|
{{if .UserFields}}
|
|
<div class="form-section">
|
|
<h4>{{T "deploy.beallitasok"}}</h4>
|
|
{{range .UserFields}}
|
|
<div class="form-group">
|
|
<label for="field-{{.EnvVar}}">
|
|
{{.Label}}
|
|
{{if or .Required (eq .Type "password")}}<span class="required">*</span>{{end}}
|
|
{{if .LockedAfterDeploy}}<span class="locked-hint">{{T "deploy.telepites_utan_nem_modosithato"}}</span>{{end}}
|
|
</label>
|
|
|
|
{{if eq .Type "subdomain"}}
|
|
<div class="subdomain-input-group">
|
|
<input type="text" id="field-{{.EnvVar}}" name="{{.EnvVar}}"
|
|
class="form-control subdomain-input"
|
|
{{/* R-351: a reinstall offers the address the customer's own backup recorded,
|
|
ahead of the catalog default. Editable — a domain can legitimately change. */}}
|
|
value="{{if index $.RestoreFieldValues .EnvVar}}{{index $.RestoreFieldValues .EnvVar}}{{else}}{{.Default}}{{end}}"
|
|
placeholder="{{T "deploy.aldomain_placeholder"}}"
|
|
pattern="[a-z0-9]([a-z0-9-]*[a-z0-9])?"
|
|
required
|
|
oninput="this.value=this.value.toLowerCase().replace(/[^a-z0-9-]/g,'')">
|
|
<span class="subdomain-suffix">.{{$.Domain}}</span>
|
|
</div>
|
|
<span class="form-hint">{{T "deploy.az_aldomain_telepites_utan_nem"}}</span>
|
|
{{else if eq .Type "select"}}
|
|
<select id="field-{{.EnvVar}}" name="{{.EnvVar}}" class="form-control">
|
|
{{range .Options}}
|
|
<option value="{{.Value}}">{{.Label}}</option>
|
|
{{end}}
|
|
</select>
|
|
{{else if eq .Type "password"}}
|
|
<div class="input-with-button">
|
|
<input type="password" id="field-{{.EnvVar}}" name="{{.EnvVar}}"
|
|
class="form-control" value="{{.Default}}"
|
|
placeholder="{{.Placeholder}}"
|
|
data-field-type="password"
|
|
required>
|
|
<button type="button" class="btn btn-sm btn-outline pw-toggle-btn"
|
|
onclick="togglePasswordField('field-{{.EnvVar}}', 'field-confirm-{{.EnvVar}}', this)"
|
|
title="{{T "deploy.megjelenites"}}">👁</button>
|
|
<button type="button" class="btn btn-sm btn-outline"
|
|
onclick="generatePassword('field-{{.EnvVar}}', 'field-confirm-{{.EnvVar}}', '{{.Generate}}')">{{T "deploy.generalas"}}</button>
|
|
</div>
|
|
<div class="input-with-button" style="margin-top:.25rem">
|
|
<input type="password" id="field-confirm-{{.EnvVar}}"
|
|
class="form-control" placeholder="{{T "deploy.jelszo_megerositese"}}"
|
|
data-confirm-for="field-{{.EnvVar}}">
|
|
</div>
|
|
{{else if eq .Type "boolean"}}
|
|
<label class="toggle">
|
|
<input type="checkbox" id="field-{{.EnvVar}}" name="{{.EnvVar}}" value="true">
|
|
<span class="toggle-label">{{T "deploy.igen"}}</span>
|
|
</label>
|
|
{{else if eq .Type "path"}}
|
|
{{if $.StoragePaths}}
|
|
<select id="field-{{.EnvVar}}" name="{{.EnvVar}}" class="form-control"
|
|
onchange="checkStorageSpace(this)">
|
|
{{range $.StoragePaths}}
|
|
<option value="{{.Path}}" data-free-percent="{{printf "%.0f" .FreePercent}}"
|
|
{{if .NotAllowed}}disabled{{end}}
|
|
{{/* R-351: on a reinstall the drive the BACKUP recorded wins over the
|
|
configured default — it is where this app's data actually lived, and
|
|
restoring into a different drive is the mismatch the restore then has
|
|
to stop and name. The customer can still pick another. */}}
|
|
{{if $.RestorePrefillHDDPath}}{{if and (eq .Path $.RestorePrefillHDDPath) (not .NotAllowed)}}selected{{end}}{{else if and .IsDefault (not .NotAllowed)}}selected{{end}}>
|
|
{{T "deploy.szabad_2"}}{{if .NotAllowed}} ({{.NotAllowedNote}}){{else if .IsDefault}} {{T "deploy.alapertelmezett"}}{{end}}
|
|
</option>
|
|
{{end}}
|
|
</select>
|
|
<div id="storage-space-warn" class="form-hint" style="color:var(--warn);display:none">
|
|
<svg class="ico ico-sm"><use href="#i-triangle-alert"/></svg> {{T "deploy.a_kivalasztott_tarhely_majdnem_megtelt"}}
|
|
</div>
|
|
<div class="form-hint" style="margin-top:.4rem;opacity:.8">
|
|
<svg class="ico ico-sm"><use href="#i-info"/></svg> {{T "deploy.a_kivalasztott_meghajton_az_alkalmazas"}}
|
|
</div>
|
|
{{else}}
|
|
<input type="text" id="field-{{.EnvVar}}" name="{{.EnvVar}}"
|
|
class="form-control" value="{{.Default}}"
|
|
placeholder="{{.Placeholder}}"
|
|
{{if .Required}}required{{end}}>
|
|
<span class="form-hint" style="color:var(--warn)">{{T "deploy.nincs_regisztralt_adattarolo_adja_meg"}}</span>
|
|
{{end}}
|
|
{{else}}
|
|
<input type="text" id="field-{{.EnvVar}}" name="{{.EnvVar}}"
|
|
class="form-control" value="{{.Default}}"
|
|
placeholder="{{.Placeholder}}"
|
|
{{if .Required}}required{{end}}>
|
|
{{end}}
|
|
|
|
{{if and .Description (ne .Type "subdomain")}}
|
|
<span class="form-hint">{{.Description}}</span>
|
|
{{end}}
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
{{end}}
|
|
{{end}}
|