diff --git a/luci-app-alist/Makefile b/luci-app-alist/Makefile index 8298ab8..220b3fc 100644 --- a/luci-app-alist/Makefile +++ b/luci-app-alist/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-alist -PKG_VERSION:=1.0.6 +PKG_VERSION:=1.0.7 PKG_RELEASE:=1 LUCI_TITLE:=LuCI support for alist diff --git a/luci-app-alist/luasrc/model/cbi/alist/basic.lua b/luci-app-alist/luasrc/model/cbi/alist/basic.lua index eaca6cc..3914288 100644 --- a/luci-app-alist/luasrc/model/cbi/alist/basic.lua +++ b/luci-app-alist/luasrc/model/cbi/alist/basic.lua @@ -33,6 +33,11 @@ o:depends("ssl", "1") o = s:option(Flag, "allow_wan", translate("Allow Access From Internet")) o.rmempty = false +o = s:option(Value, "token_expires_in", translate("Login Validity Period (hours)")) +o.datatype = "and(uinteger,min(0))" +o.default = "48" +o.rmempty = false + o = s:option(Value, "temp_dir", translate("Cache directory")) o.datatype = "string" o.default = "/tmp/alist" diff --git a/luci-app-alist/po/zh-cn/alist.po b/luci-app-alist/po/zh-cn/alist.po index 2008c20..fd3578a 100644 --- a/luci-app-alist/po/zh-cn/alist.po +++ b/luci-app-alist/po/zh-cn/alist.po @@ -72,3 +72,6 @@ msgstr "读取中..." msgid "Read" msgstr "读取" + +msgid "Login Validity Period (hours)" +msgstr "登录有效期(小时)" diff --git a/luci-app-alist/root/etc/config/alist b/luci-app-alist/root/etc/config/alist index 8606df9..e47fae6 100644 --- a/luci-app-alist/root/etc/config/alist +++ b/luci-app-alist/root/etc/config/alist @@ -3,3 +3,4 @@ config alist option 'port' '5244' option 'temp_dir' '/tmp/alist' option 'ssl' '0' + option 'token_expires_in' '48' diff --git a/luci-app-alist/root/etc/init.d/alist b/luci-app-alist/root/etc/init.d/alist index bb29913..2760a88 100755 --- a/luci-app-alist/root/etc/init.d/alist +++ b/luci-app-alist/root/etc/init.d/alist @@ -13,6 +13,7 @@ get_config() { config_get ssl $1 ssl 0 config_get ssl_cert $1 ssl_cert "" config_get ssl_key $1 ssl_key "" + config_get token_expires_in $1 token_expires_in 48 config_get allow_wan $1 allow_wan 0 config_load network config_get lan_addr lan ipaddr "0.0.0.0" @@ -42,16 +43,8 @@ start_service() { config_foreach get_config alist [ $enabled != 1 ] && return 1 mkdir -p $temp_dir - if [ "$ssl" -eq 1 ];then - SSL=true - else - SSL=false - fi - if [ "$log" -eq 1 ];then - LOG=true - else - LOG=false - fi + [ "$ssl" -eq 1 ] && SSL=true || SSL=false + [ "$log" -eq 1 ] && LOG=true || LOG=false if [ "$allow_wan" -eq "1" ]; then listen_addr="0.0.0.0" external_access="allow" @@ -62,7 +55,7 @@ start_service() { set_firewall cat /dev/null > $temp_dir/alist.log cat > $CONFIG_DIR/config.json <