luci-app-alist: add login validity setting item
This commit is contained in:
parent
7ea57fa8df
commit
eca2b61783
@ -6,7 +6,7 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=luci-app-alist
|
PKG_NAME:=luci-app-alist
|
||||||
PKG_VERSION:=1.0.6
|
PKG_VERSION:=1.0.7
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
LUCI_TITLE:=LuCI support for alist
|
LUCI_TITLE:=LuCI support for alist
|
||||||
|
@ -33,6 +33,11 @@ o:depends("ssl", "1")
|
|||||||
o = s:option(Flag, "allow_wan", translate("Allow Access From Internet"))
|
o = s:option(Flag, "allow_wan", translate("Allow Access From Internet"))
|
||||||
o.rmempty = false
|
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 = s:option(Value, "temp_dir", translate("Cache directory"))
|
||||||
o.datatype = "string"
|
o.datatype = "string"
|
||||||
o.default = "/tmp/alist"
|
o.default = "/tmp/alist"
|
||||||
|
@ -72,3 +72,6 @@ msgstr "读取中..."
|
|||||||
|
|
||||||
msgid "Read"
|
msgid "Read"
|
||||||
msgstr "读取"
|
msgstr "读取"
|
||||||
|
|
||||||
|
msgid "Login Validity Period (hours)"
|
||||||
|
msgstr "登录有效期(小时)"
|
||||||
|
@ -3,3 +3,4 @@ config alist
|
|||||||
option 'port' '5244'
|
option 'port' '5244'
|
||||||
option 'temp_dir' '/tmp/alist'
|
option 'temp_dir' '/tmp/alist'
|
||||||
option 'ssl' '0'
|
option 'ssl' '0'
|
||||||
|
option 'token_expires_in' '48'
|
||||||
|
@ -13,6 +13,7 @@ get_config() {
|
|||||||
config_get ssl $1 ssl 0
|
config_get ssl $1 ssl 0
|
||||||
config_get ssl_cert $1 ssl_cert ""
|
config_get ssl_cert $1 ssl_cert ""
|
||||||
config_get ssl_key $1 ssl_key ""
|
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_get allow_wan $1 allow_wan 0
|
||||||
config_load network
|
config_load network
|
||||||
config_get lan_addr lan ipaddr "0.0.0.0"
|
config_get lan_addr lan ipaddr "0.0.0.0"
|
||||||
@ -42,16 +43,8 @@ start_service() {
|
|||||||
config_foreach get_config alist
|
config_foreach get_config alist
|
||||||
[ $enabled != 1 ] && return 1
|
[ $enabled != 1 ] && return 1
|
||||||
mkdir -p $temp_dir
|
mkdir -p $temp_dir
|
||||||
if [ "$ssl" -eq 1 ];then
|
[ "$ssl" -eq 1 ] && SSL=true || SSL=false
|
||||||
SSL=true
|
[ "$log" -eq 1 ] && LOG=true || LOG=false
|
||||||
else
|
|
||||||
SSL=false
|
|
||||||
fi
|
|
||||||
if [ "$log" -eq 1 ];then
|
|
||||||
LOG=true
|
|
||||||
else
|
|
||||||
LOG=false
|
|
||||||
fi
|
|
||||||
if [ "$allow_wan" -eq "1" ]; then
|
if [ "$allow_wan" -eq "1" ]; then
|
||||||
listen_addr="0.0.0.0"
|
listen_addr="0.0.0.0"
|
||||||
external_access="allow"
|
external_access="allow"
|
||||||
@ -62,7 +55,7 @@ start_service() {
|
|||||||
set_firewall
|
set_firewall
|
||||||
cat /dev/null > $temp_dir/alist.log
|
cat /dev/null > $temp_dir/alist.log
|
||||||
cat > $CONFIG_DIR/config.json <<EOF
|
cat > $CONFIG_DIR/config.json <<EOF
|
||||||
{"force":false,"address":"$listen_addr","port":$port,"cdn":"","jwt_secret":"","token_expires_in":48,"database":{"type":"sqlite3","host":"","port":0,"user":"","password":"","name":"","db_file":"/etc/alist/data.db","table_prefix":"x_","ssl_mode":""},"scheme":{"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}}
|
{"force":false,"address":"$listen_addr","port":$port,"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":{"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}}
|
||||||
EOF
|
EOF
|
||||||
procd_open_instance alist
|
procd_open_instance alist
|
||||||
procd_set_param command $PROG
|
procd_set_param command $PROG
|
||||||
|
Loading…
Reference in New Issue
Block a user