luci: custom temp dir support
This commit is contained in:
parent
4fa6533d46
commit
6139bc8871
@ -3,3 +3,4 @@ config alist
|
||||
option 'port' '5244'
|
||||
option 'expiration' '60'
|
||||
option 'cleanup_interval' '120'
|
||||
option 'temp_dir' '/tmp'
|
||||
|
@ -10,14 +10,16 @@ get_config() {
|
||||
config_get port $1 port 5244
|
||||
config_get expiration $1 expiration 60
|
||||
config_get cleanup_interval $1 cleanup_interval 120
|
||||
config_get temp_dir $1 temp_dir "/tmp"
|
||||
}
|
||||
|
||||
start_service() {
|
||||
config_load alist
|
||||
config_foreach get_config alist
|
||||
[ $enabled != 1 ] && return 1
|
||||
mkdir -p $temp_dir
|
||||
cat > $CONFIG <<EOF
|
||||
{"address":"0.0.0.0","port":$port,"assets":"","database":{"type":"sqlite3","user":"","password":"","host":"","port":0,"name":"","table_prefix":"x_","db_file":"/etc/alist/data.db","ssl_mode":"disable"},"scheme":{"https":false,"cert_file":"","key_file":""},"cache":{"expiration":$expiration,"cleanup_interval":$cleanup_interval}}
|
||||
{"address":"0.0.0.0","port":$port,"assets":"","database":{"type":"sqlite3","user":"","password":"","host":"","port":0,"name":"","table_prefix":"x_","db_file":"/etc/alist/data.db","ssl_mode":"disable"},"scheme":{"https":false,"cert_file":"","key_file":""},"cache":{"expiration":$expiration,"cleanup_interval":$cleanup_interval},"temp_dir":"$temp_dir"}
|
||||
EOF
|
||||
procd_open_instance
|
||||
procd_set_param command $PROG
|
||||
|
@ -17,5 +17,6 @@ s.anonymous=true
|
||||
|
||||
s:option(Value, "expiration", translate("Cache invalidation time (unit: minutes)")).rmempty=false
|
||||
s:option(Value, "cleanup_interval", translate("Clear the invalidation cache interval")).rmempty=false
|
||||
s:option(Value, "temp_dir", translate("Temp directory")).rmempty=false
|
||||
|
||||
return m
|
||||
|
@ -25,6 +25,9 @@ msgstr "缓存失效时间(分钟)"
|
||||
msgid "Clear the invalidation cache interval"
|
||||
msgstr "清理失效缓存间隔"
|
||||
|
||||
msgid "Temp directory"
|
||||
msgstr "临时目录"
|
||||
|
||||
msgid "The Alist service is running."
|
||||
msgstr "Alist 服务已启动"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user