From 01ff544616a98b88bccce909438ee377f62ab86d Mon Sep 17 00:00:00 2001 From: sbwml Date: Thu, 22 Jun 2023 11:16:16 +0800 Subject: [PATCH] luci-app-alist: Add data path setting --- luci-app-alist/luasrc/model/cbi/alist/basic.lua | 4 ++++ luci-app-alist/po/zh-cn/alist.po | 3 +++ luci-app-alist/root/etc/init.d/alist | 8 ++++---- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/luci-app-alist/luasrc/model/cbi/alist/basic.lua b/luci-app-alist/luasrc/model/cbi/alist/basic.lua index b550b42..8447dc9 100644 --- a/luci-app-alist/luasrc/model/cbi/alist/basic.lua +++ b/luci-app-alist/luasrc/model/cbi/alist/basic.lua @@ -52,6 +52,10 @@ o.datatype = "and(uinteger,min(0))" o.default = "0" o.rmempty = false +o = s:option(Value, "data_dir", translate("Data directory")) +o.datatype = "string" +o.default = "/etc/alist" + 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 beebf07..2cc74fc 100644 --- a/luci-app-alist/po/zh-cn/alist.po +++ b/luci-app-alist/po/zh-cn/alist.po @@ -34,6 +34,9 @@ msgstr "SSL 密钥" msgid "SSL key file path" msgstr "SSL 密钥文件路径" +msgid "Data directory" +msgstr "数据目录" + msgid "Cache directory" msgstr "缓存目录" diff --git a/luci-app-alist/root/etc/init.d/alist b/luci-app-alist/root/etc/init.d/alist index e9a5507..610b85b 100755 --- a/luci-app-alist/root/etc/init.d/alist +++ b/luci-app-alist/root/etc/init.d/alist @@ -3,13 +3,13 @@ START=99 USE_PROCD=1 PROG=/usr/bin/alist -CONFIG_DIR=/etc/alist get_config() { config_get_bool enabled $1 enabled 1 config_get port $1 port 5244 config_get log $1 log 1 config_get site_url $1 site_url "" + config_get data_dir $1 data_dir "/etc/alist" config_get temp_dir $1 temp_dir "/tmp/alist" config_get ssl $1 ssl 0 config_get ssl_cert $1 ssl_cert "" @@ -67,12 +67,12 @@ start_service() { fi set_firewall cat /dev/null > $temp_dir/alist.log - cat > $CONFIG_DIR/config.json < $data_dir/config.json <