Giter Club home page Giter Club logo

Comments (4)

felix-klk avatar felix-klk commented on June 21, 2024 1

因为在外网下 希望可以独立更改 alist https端口避免被扫 同时通过反代过后的alist302 我这里会出现性能问题 直接不反代映射端口 就不存在这个问题

from luci-app-alist.

sbwml avatar sbwml commented on June 21, 2024 1

如果你们认为这个东西是刚需,你可以自己编译来用,但它肯定不会在这个仓库上出现。修改补丁如下:

From b78bd251a91f8f2cb9f9c35a5b94c1fbc82f4141 Mon Sep 17 00:00:00 2001
From: sbwml <[email protected]>
Date: Mon, 3 Jul 2023 21:52:49 +0800
Subject: [PATCH] luci-app-alist: add https listening port support

---
 luci-app-alist/luasrc/model/cbi/alist/basic.lua | 5 +++++
 luci-app-alist/po/zh-cn/alist.po                | 3 +++
 luci-app-alist/root/etc/init.d/alist            | 3 ++-
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/luci-app-alist/luasrc/model/cbi/alist/basic.lua b/luci-app-alist/luasrc/model/cbi/alist/basic.lua
index 5b7723b..1e95832 100644
--- a/luci-app-alist/luasrc/model/cbi/alist/basic.lua
+++ b/luci-app-alist/luasrc/model/cbi/alist/basic.lua
@@ -23,6 +23,11 @@ o.rmempty = false
 o = s:option(Flag, "ssl", translate("Enable SSL"))
 o.rmempty=false
 
+o = s:option(Value, "https_port", translate("HTTPS Port"))
+o.datatype = "and(port,min(1))"
+o.default = "5245"
+o:depends("ssl", "1")
+
 o = s:option(Value,"ssl_cert", translate("SSL cert"), translate("SSL certificate file path"))
 o.datatype = "file"
 o:depends("ssl", "1")
diff --git a/luci-app-alist/po/zh-cn/alist.po b/luci-app-alist/po/zh-cn/alist.po
index 1f996d9..1d625a1 100644
--- a/luci-app-alist/po/zh-cn/alist.po
+++ b/luci-app-alist/po/zh-cn/alist.po
@@ -19,6 +19,9 @@ msgstr "启用"
 msgid "Port"
 msgstr "端口"
 
+msgid "HTTPS Port"
+msgstr "HTTPS 端口"
+
 msgid "Enable SSL"
 msgstr "启用 SSL"
 
diff --git a/luci-app-alist/root/etc/init.d/alist b/luci-app-alist/root/etc/init.d/alist
index c6de70f..0fc8867 100755
--- a/luci-app-alist/root/etc/init.d/alist
+++ b/luci-app-alist/root/etc/init.d/alist
@@ -12,6 +12,7 @@ get_config() {
 	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 https_port $1 https_port 5245
 	config_get ssl_cert $1 ssl_cert ""
 	config_get ssl_key $1 ssl_key ""
 	config_get token_expires_in $1 token_expires_in 48
@@ -79,7 +80,7 @@ start_service() {
 	set_firewall
 	cat /dev/null > $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,"address":"$listen_addr","port":$port,"https_port":$https_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":false,"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}
 EOF
 	procd_open_instance alist
 	procd_set_param command $PROG
-- 
2.34.8

from luci-app-alist.

sbwml avatar sbwml commented on June 21, 2024

目前仅激活单协议是刻意为之 a86f0ee ,你可以给一个有说服力的理由和它使用场景,再考虑是否需要增加独立 https 端口选项。因为我想不到在openwrt 上是有http/s 独立分开的使用方法(尽管luci 已被反向代理或配置tls 协议访问)

from luci-app-alist.

chengnan049 avatar chengnan049 commented on June 21, 2024

场景的确不大,内网情况下会更加方便,且免除了 TLS 过程,有时候容器多了也会用到,反过来想仅使用单协议似乎也没有什么好处吧,毕竟内网环境下应该没有 HTTPS 的必要

from luci-app-alist.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.