feat: configure MariaDB TLS for setup and runtime connections (#5)

This commit is contained in:
Mikhail Chusavitin committed 2026-10-26 10:47:46 +03:00
1 parent 15f81e053c
commit 370407d3ba
9 files changed
+325 -9

No files matched your search

+17 -1
View File
@@ -75,10 +75,26 @@
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
placeholder="{{if .Settings}}********{{else}}password{{end}}">
{{if .Settings}}
<p class="text-xs text-gray-500 mt-1">Оставьте пустым, чтобы сохранить текущий пароль</p>
<p class="text-xs text-gray-500 mt-1">Оставьте пустым, чтобы сохранить пароль для того же хоста, порта и пользователя</p>
{{end}}
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1" for="tls_mode">TLS</label>
<select name="tls_mode" id="tls_mode" class="w-full px-3 py-2 border rounded-md">
<option value="preferred" {{if .Settings}}{{if eq .Settings.TLSMode "preferred"}}selected{{end}}{{end}}>Preferred: шифрование, если сервер поддерживает</option>
<option value="required" {{if .Settings}}{{if eq .Settings.TLSMode "required"}}selected{{end}}{{end}}>Required: обязательное шифрование</option>
<option value="verify-ca" {{if .Settings}}{{if eq .Settings.TLSMode "verify-ca"}}selected{{end}}{{end}}>Verify CA: проверка сертификата</option>
<option value="verify-full" {{if .Settings}}{{if eq .Settings.TLSMode "verify-full"}}selected{{end}}{{end}}>Verify full: проверка сертификата и имени сервера</option>
</select>
<p class="text-xs text-gray-500 mt-1">Preferred допускает соединение без TLS. Для проверки подлинности сервера выберите Verify full.</p>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1" for="tls_ca_pem">CA-сертификат (PEM)</label>
<textarea name="tls_ca_pem" id="tls_ca_pem" rows="3" class="w-full px-3 py-2 border rounded-md font-mono text-xs">{{if .Settings}}{{.Settings.TLSCAPEM}}{{end}}</textarea>
<p class="text-xs text-gray-500 mt-1">Для Verify CA обязателен; Verify full без PEM использует системные сертификаты.</p>
</div>
<div id="status" class="hidden p-3 rounded-md text-sm"></div>
<div class="flex space-x-3 pt-4 mt-auto">