{% extends "console/base.html" %} {% load ostium_ui %} {% block title %}设置{% endblock %} {% block breadcrumb %}设置{% endblock %} {% block page_header %}
{% icon "settings" "w-3.5 h-3.5" %} 服务配置

运行时设置

这些设置保存在数据库中,保存后自动触发核心配置更新,无需编辑环境变量。

{% if state.desired_revision == state.applied_revision %}配置已应用{% else %}配置待应用{% endif %}
{% endblock %} {% block content %}
{% csrf_token %}
{% if form.non_field_errors %}
{{ form.non_field_errors }}
{% endif %}
{% icon "globe" %} 通用
{% for key in groups.General %} {% with field=form|get_item:key %} {% if field %}
{{ field }} {{ field.errors }} {% if field.help_text %}{{ field.help_text }}{% endif %}
{% endif %} {% endwith %} {% endfor %}
{% icon "lan" %} 网络与 DNS
{% for key in groups.Network %} {% with field=form|get_item:key %} {% if field %}
{{ field }} {{ field.errors }} {% if field.help_text %}{{ field.help_text }}{% endif %}
{% endif %} {% endwith %} {% endfor %}
auto:探测 DoH,失败回退 UDP;doh:失败则拒绝应用;udp:不探测。
{% icon "shield" %} 安全
{% for key in groups.Security %} {% with field=form|get_item:key %} {% if field %}
{{ field.errors }} {% if field.help_text %}{{ field.help_text }}{% endif %}
{% endif %} {% endwith %} {% endfor %}
{% icon "lock" %}
管理面默认只监听 127.0.0.1。公网暴露必须启用 Caddy TLS 与 TOTP,详见文档。
{% icon "bell" %} 通知
{% for key in groups.Notifications %} {% with field=form|get_item:key %} {% if field %}
{{ field }} {{ field.errors }} {% if field.help_text %}{{ field.help_text }}{% endif %}
{% endif %} {% endwith %} {% endfor %}
{% icon "database" %} 维护与保留
{% for key in groups.Maintenance %} {% with field=form|get_item:key %} {% if field %}
{{ field }} {{ field.errors }} {% if field.help_text %}{{ field.help_text }}{% endif %}
{% endif %} {% endwith %} {% endfor %}
保存后 worker 会自动校验并应用新配置。
{% icon "key" %} 自动备份密码
{% if backup_password_configured %}已设置{% else %}未设置{% endif %}
{% icon "lock" %}
自动备份密码只写入服务器的 secrets/backup-password 文件(0600), 不进入数据库、不进入备份文件,也不会在页面回显。丢失密码将无法解密备份。
{% if backup_password_source == "env" %}
{% icon "alert" %}
当前由 OSTIUM_BACKUP_PASSWORD 环境变量管理,优先级高于页面密码。要改用页面设置,请先从环境变量中移除它并重启 worker。
{% else %} {% if backup_password_source == "file" %}
{% icon "check" %}
页面密码文件已生效。可以更新密码,或清除后重新设置。
{% endif %}
{% csrf_token %} {% if backup_form.non_field_errors %}
{{ backup_form.non_field_errors }}
{% endif %}
{{ backup_form.password }} {{ backup_form.password.errors }} {% if backup_form.password.help_text %}{{ backup_form.password.help_text }}{% endif %}
{{ backup_form.confirm }} {{ backup_form.confirm.errors }}
{% if backup_password_source == "file" %}
{% csrf_token %}
{% endif %} {% endif %}
{% endblock %}