2023-01-31 01:23:08 +08:00
local m , s
m = Map ( " alist " , translate ( " Alist " ) , translate ( " A file list program that supports multiple storage. " ) .. " <br/> " .. [[<a href="https://alist.nn.ci/zh/guide/drivers/local.html" target="_blank">]] .. translate ( " User Manual " ) .. [[</a>]] )
m : section ( SimpleSection ) . template = " alist/alist_status "
s = m : section ( TypedSection , " alist " )
s.addremove = false
s.anonymous = true
2023-04-14 16:22:24 +08:00
o = s : option ( Flag , " enabled " , translate ( " Enabled " ) )
2023-01-31 01:23:08 +08:00
o.rmempty = false
o = s : option ( Value , " port " , translate ( " Port " ) )
o.datatype = " and(port,min(1)) "
o.rmempty = false
2023-06-18 16:20:52 +08:00
o.default = " 5244 "
2023-01-31 01:23:08 +08:00
o = s : option ( Flag , " log " , translate ( " Enable Logs " ) )
o.default = 1
o.rmempty = false
o = s : option ( Flag , " ssl " , translate ( " Enable SSL " ) )
o.rmempty = false
o = s : option ( Value , " ssl_cert " , translate ( " SSL cert " ) , translate ( " SSL certificate file path " ) )
o.datatype = " file "
o : depends ( " ssl " , " 1 " )
o = s : option ( Value , " ssl_key " , translate ( " SSL key " ) , translate ( " SSL key file path " ) )
o.datatype = " file "
o : depends ( " ssl " , " 1 " )
2024-04-04 04:17:53 +08:00
o = s : option ( Flag , " mysql " , translate ( " Enable Database " ) )
2023-06-22 16:22:07 +08:00
o.rmempty = false
2024-04-04 04:17:53 +08:00
o = s : option ( ListValue , " mysql_type " , translate ( " Database Type " ) )
2023-06-22 16:22:07 +08:00
o.datatype = " string "
2024-04-04 04:17:53 +08:00
o : value ( " mysql " , translate ( " MySQL " ) )
o : value ( " postgres " , translate ( " PostgreSQL " ) )
o.default = " mysql "
2023-06-22 16:22:07 +08:00
o : depends ( " mysql " , " 1 " )
2024-04-04 04:17:53 +08:00
o = s : option ( Value , " mysql_host " , translate ( " Database Host " ) )
o.datatype = " string "
o : depends ( " mysql " , " 1 " )
o = s : option ( Value , " mysql_port " , translate ( " Database Port " ) )
2023-06-22 16:22:07 +08:00
o.datatype = " and(port,min(1)) "
o.default = " 3306 "
o : depends ( " mysql " , " 1 " )
2024-04-04 04:17:53 +08:00
o = s : option ( Value , " mysql_username " , translate ( " Database Username " ) )
2023-06-22 16:22:07 +08:00
o.datatype = " string "
o : depends ( " mysql " , " 1 " )
2024-04-04 04:17:53 +08:00
o = s : option ( Value , " mysql_password " , translate ( " Database Password " ) )
2023-06-22 16:22:07 +08:00
o.datatype = " string "
o.password = true
o : depends ( " mysql " , " 1 " )
o = s : option ( Value , " mysql_database " , translate ( " Database Name " ) )
o.datatype = " string "
o : depends ( " mysql " , " 1 " )
2024-04-04 04:17:53 +08:00
o = s : option ( Value , " mysql_table_prefix " , translate ( " Database Table Prefix " ) )
o.datatype = " string "
o.default = " x_ "
o : depends ( " mysql " , " 1 " )
o = s : option ( Value , " mysql_ssl_mode " , translate ( " Database SSL Mode " ) )
o.datatype = " string "
o : depends ( " mysql " , " 1 " )
o = s : option ( Value , " mysql_dsn " , translate ( " Database DSN " ) )
o.datatype = " string "
o : depends ( " mysql " , " 1 " )
2023-01-31 01:23:08 +08:00
o = s : option ( Flag , " allow_wan " , translate ( " Allow Access From Internet " ) )
o.rmempty = false
2023-06-18 16:20:52 +08:00
o = s : option ( Value , " site_url " , translate ( " Site URL " ) , translate ( " 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 " ) )
o.datatype = " string "
2023-02-21 23:37:40 +08:00
o = s : option ( Value , " max_connections " , translate ( " Max Connections " ) , translate ( " 0 is unlimited, It is recommend to set a low number of concurrency (10-20) for poor performance device " ) )
o.datatype = " and(uinteger,min(0)) "
o.default = " 0 "
o.rmempty = false
2023-01-31 01:23:08 +08:00
o = s : option ( Value , " token_expires_in " , translate ( " Login Validity Period (hours) " ) )
2023-05-07 13:19:34 +08:00
o.datatype = " and(uinteger,min(1)) "
2023-01-31 01:23:08 +08:00
o.default = " 48 "
o.rmempty = false
2023-06-20 23:35:38 +08:00
o = s : option ( Value , " delayed_start " , translate ( " Delayed Start (seconds) " ) )
o.datatype = " and(uinteger,min(0)) "
o.default = " 0 "
o.rmempty = false
2023-06-22 16:22:07 +08:00
o = s : option ( Value , " data_dir " , translate ( " Data directory " ) )
o.datatype = " string "
o.default = " /etc/alist "
2023-01-31 01:23:08 +08:00
o = s : option ( Value , " temp_dir " , translate ( " Cache directory " ) )
o.datatype = " string "
o.default = " /tmp/alist "
o.rmempty = false
2023-08-11 23:35:19 +08:00
o = s : option ( Button , " admin_info " , translate ( " Reset Password " ) )
2023-01-31 01:23:08 +08:00
o.rawhtml = true
o.template = " alist/admin_info "
return m