update 2023-06-20 23:35:38

This commit is contained in:
github-actions[bot] 2023-06-20 23:35:38 +08:00
parent b7d6ce5489
commit 4077476c3d
6 changed files with 19 additions and 4 deletions

View File

@ -6,7 +6,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-alist
PKG_VERSION:=1.0.8
PKG_VERSION:=1.0.9
PKG_RELEASE:=1
LUCI_TITLE:=LuCI support for alist

View File

@ -47,6 +47,11 @@ o.datatype = "and(uinteger,min(1))"
o.default = "48"
o.rmempty = false
o = s:option(Value, "delayed_start", translate("Delayed Start (seconds)"))
o.datatype = "and(uinteger,min(0))"
o.default = "0"
o.rmempty = false
o = s:option(Value, "temp_dir", translate("Cache directory"))
o.datatype = "string"
o.default = "/tmp/alist"

View File

@ -90,3 +90,6 @@ msgstr "站点 URL"
msgid "When the web is reverse proxied to a subdirectory, this option must be filled out to ensure proper functioning of the web. Do not include '/' at the end of the URL"
msgstr "Web 被反向代理到二级目录时,必须填写该选项以确保 Web 正常工作。URL 结尾请勿携带 '/'"
msgid "Delayed Start (seconds)"
msgstr "开机延时启动(秒)"

View File

@ -6,3 +6,4 @@ config alist
option 'token_expires_in' '48'
option 'max_connections' '0'
option 'site_url' ''
option 'delayed_start' '0'

View File

@ -17,6 +17,7 @@ get_config() {
config_get token_expires_in $1 token_expires_in 48
config_get allow_wan $1 allow_wan 0
config_get max_connections $1 max_connections 0
config_get delayed_start $1 delayed_start 0
config_load network
config_get lan_addr lan ipaddr "0.0.0.0"
if echo "${lan_addr}" | grep -Fq ' '; then
@ -52,6 +53,11 @@ start_service() {
mkdir -p $temp_dir
[ "$ssl" -eq 1 ] && SSL=true || SSL=false
[ "$log" -eq 1 ] && LOG=true || LOG=false
if [ -e /proc/uptime ]; then
[ $(awk -F. '{print $1}' /proc/uptime) -lt "300" ] && delayed_start=$delayed_start || delayed_start=0
else
delayed_start=$delayed_start
fi
if [ "$allow_wan" -eq "1" ]; then
listen_addr="0.0.0.0"
external_access="allow"
@ -62,7 +68,7 @@ start_service() {
set_firewall
cat /dev/null > $temp_dir/alist.log
cat > $CONFIG_DIR/config.json <<EOF
{"force":false,"address":"$listen_addr","port":$port,"https_port":$port,"site_url":"$site_url","cdn":"","jwt_secret":"","token_expires_in":$token_expires_in,"database":{"type":"sqlite3","host":"","port":0,"user":"","password":"","name":"","db_file":"/etc/alist/data.db","table_prefix":"x_","ssl_mode":""},"scheme":{"disable_http":$SSL,"https":$SSL,"cert_file":"$ssl_cert","key_file":"$ssl_key"},"temp_dir":"$temp_dir","log":{"enable":$LOG,"name":"$temp_dir/alist.log","max_size":10,"max_backups":5,"max_age":28,"compress":false},"max_connections":$max_connections}
{"force":false,"address":"$listen_addr","port":$port,"https_port":$port,"site_url":"$site_url","cdn":"","jwt_secret":"","token_expires_in":$token_expires_in,"database":{"type":"sqlite3","host":"","port":0,"user":"","password":"","name":"","db_file":"/etc/alist/data.db","table_prefix":"x_","ssl_mode":""},"scheme":{"disable_http":$SSL,"https":$SSL,"cert_file":"$ssl_cert","key_file":"$ssl_key"},"temp_dir":"$temp_dir","log":{"enable":$LOG,"name":"$temp_dir/alist.log","max_size":10,"max_backups":5,"max_age":28,"compress":false},"delayed_start":$delayed_start,"max_connections":$max_connections}
EOF
procd_open_instance alist
procd_set_param command $PROG

View File

@ -21,13 +21,13 @@ define Download/geoip
HASH:=811085edc67057690c783e735182db32e5a4b446ee5f6d70ef9e12960ce910da
endef
GEOSITE_VER:=20230619125603
GEOSITE_VER:=20230620064205
GEOSITE_FILE:=dlc.dat.$(GEOSITE_VER)
define Download/geosite
URL:=https://github.com/v2fly/domain-list-community/releases/download/$(GEOSITE_VER)/
URL_FILE:=dlc.dat
FILE:=$(GEOSITE_FILE)
HASH:=9c1fdbbc22eea13f57d5b645cd9de3d9524d7ac66b2fd7511662aa195d38f242
HASH:=2957721a20ea5c4306dcf04e28385d11973d4495f0882f4d8c00e1946aeed011
endef
define Package/v2ray-geodata/template