update 2024-06-25 12:20:30

This commit is contained in:
kenzok8 2024-06-25 12:20:30 +08:00
parent 847c68de87
commit 8fb3f55174
3 changed files with 18 additions and 10 deletions

View File

@ -1,3 +1,3 @@
config istoreenhance
option port '8443'
option port '5443'
option enabled '1'

View File

@ -5,13 +5,16 @@ USE_PROCD=1
get_config() {
config_get_bool enabled $1 enabled 1
config_get port $1 port 8443
config_get port $1 port 5443
}
start_service() {
config_load istoreenhance
config_foreach get_config istoreenhance
[ $enabled != 1 ] && return 1
if [ $enabled != 1 ]; then
disabled_mirrors
return 1
fi
procd_open_instance
procd_set_param limits nofile="65535 65535"
@ -24,3 +27,15 @@ start_service() {
service_triggers() {
procd_add_reload_trigger "istoreenhance"
}
disabled_mirrors() {
local mirror=$(uci get dockerd.globals.registry_mirrors | grep -oE 'https://registry\.linkease\.net:[0-9]+')
[ -n "$mirror" ] || return 0
uci del_list "dockerd.globals.registry_mirrors=$mirror"
uci commit dockerd
/etc/init.d/dockerd reload
}
service_stopped() {
disabled_mirrors
}

View File

@ -7,13 +7,6 @@ uci -q batch <<-EOF >/dev/null
commit ucitrack
delete firewall.istoreenhance
set firewall.istoreenhance=rule
set firewall.istoreenhance.name="istoreenhance"
set firewall.istoreenhance.target="ACCEPT"
set firewall.istoreenhance.src="wan"
set firewall.istoreenhance.proto="tcp"
set firewall.istoreenhance.dest_port="8443"
commit firewall
EOF
/etc/init.d/istoreenhance enable