feat(podkop): add DNS Rewrite TTL configuration option

This commit is contained in:
Nikita Skryabin
2025-02-20 23:27:50 +03:00
parent ec936e2369
commit 1f3a65347e
2 changed files with 28 additions and 5 deletions

View File

@@ -697,6 +697,24 @@ return view.extend({
return true;
};
o = s.taboption('additional', form.Value, 'dns_rewrite_ttl', 'DNS Rewrite TTL', 'Time in seconds for DNS record caching (default: 600)');
o.default = '600';
o.rmempty = false;
o.ucisection = 'main';
o.validate = function (section_id, value) {
if (!value) {
return 'TTL value cannot be empty';
}
const ttl = parseInt(value);
if (isNaN(ttl) || ttl < 0) {
return 'TTL must be a positive number';
}
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)');