Add NPM certificate selection and read-only VDS certificate renewal sync
All checks were successful
Test and publish Homegate / checks (push) Successful in 28s
Test and publish Homegate / publish (push) Successful in 12m47s

This commit is contained in:
2026-10-15 05:12:03 +03:00
parent b305cc1ba8
commit eeffcfb616
18 changed files with 838 additions and 49 deletions

9
ui/dist/settings.js vendored
View File

@@ -19,6 +19,13 @@ function renderManagedSettings() {
${passwordField('npm_password', 'Пароль NPM')}
</div>
</section>
<section class="form-section"><h2>Сертификаты с NPM на VDS</h2><p>Необязательное подключение. Продлением занимается NPM на VDS. Homegate читает сертификаты и обновляет их копии дома; настройки и прокси на VDS не меняются.</p>
<div class="form-grid">
<label class="field full">HTTPS адрес панели NPM на VDS<input name="remote_npm_url" type="url" value="${esc(links.remote_npm_url || '')}" placeholder="https://npm.example.com"><small>Адрес API-панели, без /api. Оставьте пустым, если копирование не нужно.</small></label>
<label class="field full">Логин NPM на VDS<input name="remote_npm_identity" value="${esc(links.remote_npm_identity || '')}" autocomplete="username"></label>
${passwordField('remote_npm_password', 'Пароль NPM на VDS')}
</div>
</section>
<section class="form-section"><h2>DNS</h2><div class="form-grid">
<label class="field full">Создание DNS-записей<select name="dns_mode"><option value="pihole6" ${c.dns_mode !== 'manual' ? 'selected' : ''}>Автоматически — Pi-hole 6</option><option value="manual" ${c.dns_mode === 'manual' ? 'selected' : ''}>Вручную — другой DNS</option></select></label>
<div id="pihole-fields" class="field full" ${c.dns_mode === 'manual' ? 'hidden' : ''}>
@@ -60,7 +67,7 @@ async function saveManagedSettings(event) {
const list = name => fields.get(name).split(/\n|,/).map(value => value.trim()).filter(Boolean);
Object.assign(config, {proxy_ip: fields.get('proxy_ip').trim(), allowed_networks: list('allowed_networks'),
domain_zones: list('domain_zones'), dns_mode: fields.get('dns_mode'), interval_seconds: Number(fields.get('interval_seconds'))});
const connections = Object.fromEntries(['npm_url','npm_identity','npm_password','pihole_url','pihole_password','ssh_public_url','api_ca_pem'].map(key => [key, fields.get(key) || '']));
const connections = Object.fromEntries(['npm_url','npm_identity','npm_password','pihole_url','pihole_password','ssh_public_url','api_ca_pem','remote_npm_url','remote_npm_identity','remote_npm_password'].map(key => [key, fields.get(key) || '']));
connections.clear_pihole_password = fields.has('pihole_no_password');
const first = data.setup_required, button = form.querySelector('[type=submit]');
button.disabled = true;