mirror of
https://github.com/itdoginfo/podkop.git
synced 2025-12-06 19:46:52 +03:00
feat(podkop): add configurable cache file path support
This commit is contained in:
@@ -697,6 +697,13 @@ return view.extend({
|
|||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
o = s.taboption('additional', form.Value, 'cache_file', 'Cache File Path', 'Select or enter path for sing-box cache file');
|
||||||
|
o.value('/tmp/cache.db', 'RAM (/tmp/cache.db)');
|
||||||
|
o.value('/usr/share/sing-box/cache.db', 'Flash (/usr/share/sing-box/cache.db)');
|
||||||
|
o.default = '/tmp/cache.db';
|
||||||
|
o.rmempty = false;
|
||||||
|
o.ucisection = 'main';
|
||||||
|
|
||||||
// Diagnostics tab
|
// Diagnostics tab
|
||||||
o = s.tab('diagnostics', _('Diagnostics'));
|
o = s.tab('diagnostics', _('Diagnostics'));
|
||||||
|
|
||||||
|
|||||||
@@ -754,9 +754,20 @@ sing_box_dns_rule_fakeip_section() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sing_box_cache_file() {
|
sing_box_cache_file() {
|
||||||
log "Configure cache.db in sing-box"
|
local cache_path
|
||||||
|
|
||||||
|
config_get cache_file "main" "cache_file" "/tmp/cache.db"
|
||||||
|
|
||||||
|
if [ "$cache_file" = "custom" ]; then
|
||||||
|
config_get cache_path "main" "custom_cache_path"
|
||||||
|
else
|
||||||
|
cache_path="$cache_file"
|
||||||
|
fi
|
||||||
|
|
||||||
|
log "Configure sing-box cache.db path"
|
||||||
|
|
||||||
jq \
|
jq \
|
||||||
--arg CACHE_FILE_PATH "$CACHE_FILE_PATH" \
|
--arg CACHE_FILE_PATH "$cache_path" \
|
||||||
'.experimental = {
|
'.experimental = {
|
||||||
"cache_file": {
|
"cache_file": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
|
|||||||
Reference in New Issue
Block a user