mirror of
https://github.com/kenzok8/openwrt-packages.git
synced 2025-01-08 11:37:36 +08:00
update 2023-07-05 14:01:36
This commit is contained in:
parent
6f83a4e878
commit
a6e9cc6009
11
alist/patches/900-fix-https-port.patch
Normal file
11
alist/patches/900-fix-https-port.patch
Normal file
@ -0,0 +1,11 @@
|
||||
--- a/cmd/server.go
|
||||
+++ b/cmd/server.go
|
||||
@@ -56,7 +56,7 @@ the address is defined in config file`,
|
||||
}()
|
||||
}
|
||||
if conf.Conf.Scheme.HttpsPort != -1 {
|
||||
- httpsBase := fmt.Sprintf("%s:%d", conf.Conf.Scheme.Address, conf.Conf.Scheme.HttpPort)
|
||||
+ httpsBase := fmt.Sprintf("%s:%d", conf.Conf.Scheme.Address, conf.Conf.Scheme.HttpsPort)
|
||||
utils.Log.Infof("start HTTPS server @ %s", httpsBase)
|
||||
httpsSrv = &http.Server{Addr: httpsBase, Handler: r}
|
||||
go func() {
|
@ -6,7 +6,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-alist
|
||||
PKG_VERSION:=1.0.9
|
||||
PKG_VERSION:=1.0.10
|
||||
PKG_RELEASE:=1
|
||||
|
||||
LUCI_TITLE:=LuCI support for alist
|
||||
|
@ -58,10 +58,10 @@ set_firewall() {
|
||||
start_service() {
|
||||
config_load alist
|
||||
config_foreach get_config alist
|
||||
[ $enabled != 1 ] && return 1
|
||||
[ $enabled -ne 1 ] && return 1
|
||||
mkdir -p $temp_dir $data_dir
|
||||
[ "$ssl" -eq 1 ] && SSL=true || SSL=false
|
||||
[ "$log" -eq 1 ] && LOG=true || LOG=false
|
||||
[ "$ssl" -eq 1 ] && https_port=$port http_port="-1" || https_port="-1" http_port=$port
|
||||
[ "$log" -eq 1 ] && log=true || log=false
|
||||
if [ -e /proc/uptime ]; then
|
||||
[ $(awk -F. '{print $1}' /proc/uptime) -lt "120" ] && delayed_start=$delayed_start || delayed_start=0
|
||||
else
|
||||
@ -77,10 +77,50 @@ start_service() {
|
||||
# mysql
|
||||
[ "$mysql" -eq 1 ] && database=mysql || database=sqlite3
|
||||
set_firewall
|
||||
cat /dev/null > $temp_dir/alist.log
|
||||
true > $temp_dir/alist.log
|
||||
cat > $data_dir/config.json <<EOF
|
||||
{"force":false,"address":"$listen_addr","port":$port,"https_port":$port,"site_url":"$site_url","cdn":"","jwt_secret":"","token_expires_in":$token_expires_in,"database":{"type":"$database","host":"$mysql_host","port":$mysql_port,"user":"$mysql_username","password":"$mysql_password","name":"$mysql_database","db_file":"$data_dir/data.db","table_prefix":"x_","ssl_mode":""},"scheme":{"disable_http":$SSL,"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},"delayed_start":$delayed_start,"max_connections":$max_connections}
|
||||
{
|
||||
"force": false,
|
||||
"site_url": "$site_url",
|
||||
"cdn": "",
|
||||
"jwt_secret": "",
|
||||
"token_expires_in": $token_expires_in,
|
||||
"database": {
|
||||
"type": "$database",
|
||||
"host": "$mysql_host",
|
||||
"port": "$mysql_port",
|
||||
"user": "$mysql_username",
|
||||
"password": "$mysql_password",
|
||||
"name": "$mysql_database",
|
||||
"db_file": "$data_dir/data.db",
|
||||
"table_prefix": "x_",
|
||||
"ssl_mode": ""
|
||||
},
|
||||
"scheme": {
|
||||
"address": "$listen_addr",
|
||||
"http_port": $http_port,
|
||||
"https_port": $https_port,
|
||||
"force_https": false,
|
||||
"cert_file": "$ssl_cert",
|
||||
"key_file": "$ssl_key",
|
||||
"unix_file": "/var/alist.sock"
|
||||
},
|
||||
"temp_dir": "$temp_dir",
|
||||
"bleve_dir": "$data_dir/bleve",
|
||||
"log": {
|
||||
"enable": $log,
|
||||
"name": "$temp_dir/alist.log",
|
||||
"max_size": 10,
|
||||
"max_backups": 5,
|
||||
"max_age": 28,
|
||||
"compress": false
|
||||
},
|
||||
"delayed_start": $delayed_start,
|
||||
"max_connections": $max_connections,
|
||||
"tls_insecure_skip_verify": true
|
||||
}
|
||||
EOF
|
||||
|
||||
procd_open_instance alist
|
||||
procd_set_param command $PROG
|
||||
procd_append_param command server --data $data_dir
|
||||
@ -101,5 +141,6 @@ stop_service() {
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
sleep 1
|
||||
start
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user