mirror of
https://github.com/itdoginfo/podkop.git
synced 2025-12-13 15:06:51 +03:00
feat: Add log_level option in LuCI and use configured value for sing-box logging
This commit is contained in:
@@ -378,6 +378,24 @@ function createSettingsContent(section) {
|
|||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
o = section.option(
|
||||||
|
form.ListValue,
|
||||||
|
"log_level",
|
||||||
|
_("Log Level"),
|
||||||
|
_(
|
||||||
|
"Select the log level for sing-box",
|
||||||
|
),
|
||||||
|
);
|
||||||
|
o.value("trace", "Trace");
|
||||||
|
o.value("debug", "Debug");
|
||||||
|
o.value("info", "Info");
|
||||||
|
o.value("warn", "Warn");
|
||||||
|
o.value("error", "Error");
|
||||||
|
o.value("fatal", "Fatal");
|
||||||
|
o.value("panic", "Panic");
|
||||||
|
o.default = "warn";
|
||||||
|
o.rmempty = false;
|
||||||
|
|
||||||
o = section.option(
|
o = section.option(
|
||||||
form.Flag,
|
form.Flag,
|
||||||
"exclude_ntp",
|
"exclude_ntp",
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ config settings 'settings'
|
|||||||
option dont_touch_dhcp '0'
|
option dont_touch_dhcp '0'
|
||||||
option config_path '/etc/sing-box/config.json'
|
option config_path '/etc/sing-box/config.json'
|
||||||
option cache_path '/tmp/sing-box/cache.db'
|
option cache_path '/tmp/sing-box/cache.db'
|
||||||
|
option log_level 'warn'
|
||||||
option exclude_ntp '0'
|
option exclude_ntp '0'
|
||||||
option shutdown_correctly '0'
|
option shutdown_correctly '0'
|
||||||
#list routing_excluded_ips '192.168.1.3'
|
#list routing_excluded_ips '192.168.1.3'
|
||||||
|
|||||||
@@ -590,7 +590,9 @@ sing_box_init_config() {
|
|||||||
sing_box_configure_log() {
|
sing_box_configure_log() {
|
||||||
log "Configure the log section of a sing-box JSON configuration"
|
log "Configure the log section of a sing-box JSON configuration"
|
||||||
|
|
||||||
config=$(sing_box_cm_configure_log "$config" false "$SB_DEFAULT_LOG_LEVEL" false)
|
local log_level
|
||||||
|
config_get log_level "settings" "log_level"
|
||||||
|
config=$(sing_box_cm_configure_log "$config" false "$log_level" false)
|
||||||
}
|
}
|
||||||
|
|
||||||
sing_box_configure_inbounds() {
|
sing_box_configure_inbounds() {
|
||||||
|
|||||||
@@ -22,8 +22,6 @@ NFT_INTERFACE_SET_NAME="interfaces"
|
|||||||
|
|
||||||
## sing-box
|
## sing-box
|
||||||
SB_REQUIRED_VERSION="1.12.0"
|
SB_REQUIRED_VERSION="1.12.0"
|
||||||
# Log
|
|
||||||
SB_DEFAULT_LOG_LEVEL="warn"
|
|
||||||
# DNS
|
# DNS
|
||||||
SB_DNS_SERVER_TAG="dns-server"
|
SB_DNS_SERVER_TAG="dns-server"
|
||||||
SB_FAKEIP_DNS_SERVER_TAG="fakeip-server"
|
SB_FAKEIP_DNS_SERVER_TAG="fakeip-server"
|
||||||
|
|||||||
Reference in New Issue
Block a user