mirror of
https://github.com/itdoginfo/podkop.git
synced 2025-12-12 06:26:59 +03:00
feat(podkop): add show_version command
- Update init script to include show_version command - Add show_version function to display current version - Update EXTRA_COMMANDS to include show_version - Remove version from web and config
This commit is contained in:
@@ -17,18 +17,6 @@ return view.extend({
|
||||
|
||||
m = new form.Map('podkop', _('Podkop configuration'), null, ['main', 'second']);
|
||||
|
||||
m = new form.Map('podkop', _('Podkop'), null, ['main', 'second']);
|
||||
L.uci.load('podkop').then(() => {
|
||||
const version = L.uci.get('podkop', 'main', 'version') || '';
|
||||
if (version) {
|
||||
m.title = _('Podkop') + ' v' + version;
|
||||
if (!window.location.search.includes('v=')) {
|
||||
const newUrl = window.location.pathname + '?v=' + version;
|
||||
window.history.replaceState(null, '', newUrl);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
s = m.section(form.TypedSection, 'main');
|
||||
s.anonymous = true;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
config main 'main'
|
||||
option version '0.3.3'
|
||||
option mode 'proxy'
|
||||
#option interface ''
|
||||
option proxy_config_type ''
|
||||
|
||||
@@ -7,7 +7,7 @@ script=$(readlink "$initscript")
|
||||
NAME="$(basename ${script:-$initscript})"
|
||||
config_load "$NAME"
|
||||
|
||||
EXTRA_COMMANDS="list_update check_proxy check_nft check_github check_logs check_all check_three main show_config"
|
||||
EXTRA_COMMANDS="list_update check_proxy check_nft check_github check_logs check_all check_three main show_config show_version"
|
||||
EXTRA_HELP=" list_update Updating domain and subnet lists
|
||||
sing_box_config_vless For test vless string
|
||||
check_proxy Check if sing-box proxy works correctly
|
||||
@@ -17,7 +17,8 @@ EXTRA_HELP=" list_update Updating domain and subnet lists
|
||||
check_all Run all checks
|
||||
check_three Run check_proxy, check_nft and check_github
|
||||
main Main function
|
||||
show_config Show current configuration with masked sensitive data"
|
||||
show_config Show current configuration with masked sensitive data
|
||||
show_version Show current version"
|
||||
|
||||
[ ! -L /usr/sbin/podkop ] && ln -s /etc/init.d/podkop /usr/sbin/podkop
|
||||
|
||||
@@ -1082,7 +1083,7 @@ sing_box_rules() {
|
||||
local rule_set="$1"
|
||||
local outbound="$2"
|
||||
|
||||
# Check if there is an outbound rule for “tproxy-in”
|
||||
# Check if there is an outbound rule for "tproxy-in"
|
||||
local rule_exists=$(jq -r '.route.rules[] | select(.outbound == "'"$outbound"'" and .inbound == ["tproxy-in"])' "$SING_BOX_CONFIG")
|
||||
|
||||
if [[ -n "$rule_exists" ]]; then
|
||||
@@ -1447,3 +1448,8 @@ show_config() {
|
||||
cat "$tmp_config"
|
||||
rm -f "$tmp_config"
|
||||
}
|
||||
|
||||
show_version() {
|
||||
local version=$(opkg info podkop | grep -m 1 "Version:" | cut -d' ' -f2)
|
||||
echo "$version"
|
||||
}
|
||||
Reference in New Issue
Block a user