-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of https://github.com/sbwml/luci-app-alist
- Loading branch information
Showing
17 changed files
with
240 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,13 +7,13 @@ | |
include $(TOPDIR)/rules.mk | ||
|
||
PKG_NAME:=alist | ||
PKG_VERSION:=2.6.4 | ||
PKG_WEB_VERSION:=2.6.4 | ||
PKG_VERSION:=3.0.0-rc.0 | ||
PKG_WEB_VERSION:=3.0.0-rc.0 | ||
PKG_RELEASE:=1 | ||
|
||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz | ||
PKG_SOURCE_URL:=https://codeload.github.com/alist-org/alist/tar.gz/v$(PKG_VERSION)? | ||
PKG_HASH:=3860f5cec5d809159c55498874c472386cd6142a932a5e7bbfb3b0f569e3e12b | ||
PKG_HASH:=659ddabc87ceca834a09320c6dd87ab24b16247b992d297b12d9ea4771bed9bf | ||
|
||
PKG_LICENSE:=GPL-3.0 | ||
PKG_LICENSE_FILE:=LICENSE | ||
|
@@ -22,8 +22,8 @@ PKG_MAINTAINER:=sbwml <[email protected]> | |
define Download/$(PKG_NAME)-web | ||
FILE:=$(PKG_NAME)-web-$(PKG_WEB_VERSION).tar.gz | ||
URL_FILE:=dist.tar.gz | ||
URL:=https://github.com/alist-org/web-v2/releases/download/$(PKG_WEB_VERSION)/ | ||
HASH:=4189ce3c523e6b8f6bba55faefabc926f6ef793c8755c5c2a2d3f75532fb2243 | ||
URL:=https://github.com/alist-org/alist-web/releases/download/$(PKG_WEB_VERSION)/ | ||
HASH:=55ad8bf4e39e48ff1a0a503783c4e6922e102810cae6dcdf99cec91263c79414 | ||
endef | ||
|
||
PKG_CONFIG_DEPENDS:=CONFIG_ALIST_COMPRESS_UPX | ||
|
@@ -32,10 +32,12 @@ PKG_BUILD_DEPENDS:=golang/host | |
PKG_BUILD_PARALLEL:=1 | ||
PKG_USE_MIPS16:=0 | ||
|
||
GO_PKG:=github.com/Xhofe/alist | ||
ALIST_PKG:=github.com/Xhofe/alist/conf | ||
PKG_ALIST:=github.com/alist-org/alist/v3/internal/conf | ||
GO_PKG:=github.com/alist-org/alist | ||
GO_PKG_LDFLAGS:=-w -s | ||
GO_PKG_LDFLAGS_X:=$(ALIST_PKG).GitTag=v$(PKG_VERSION)-$(ARCH) | ||
GO_PKG_LDFLAGS_X:= \ | ||
$(PKG_ALIST).Version=v$(PKG_VERSION)-$(ARCH) \ | ||
$(PKG_ALIST).WebVersion=$(PKG_WEB_VERSION) | ||
|
||
include $(INCLUDE_DIR)/package.mk | ||
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk | ||
|
@@ -66,8 +68,8 @@ endef | |
define Build/Prepare | ||
$(call Build/Prepare/Default) | ||
$(eval $(call Download,$(PKG_NAME)-web)) | ||
$(TAR) --strip-components=1 -C $(PKG_BUILD_DIR)/public -xzf $(DL_DIR)/$(PKG_NAME)-web-$(PKG_WEB_VERSION).tar.gz | ||
$(CP) ./files/assets/. $(PKG_BUILD_DIR)/public/assets/ | ||
$(TAR) --strip-components=1 -C $(PKG_BUILD_DIR)/public/dist -xzf $(DL_DIR)/$(PKG_NAME)-web-$(PKG_WEB_VERSION).tar.gz | ||
$(CP) ./files/assets/. $(PKG_BUILD_DIR)/public/dist/assets/ | ||
endef | ||
|
||
define Build/Compile | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
38 changes: 0 additions & 38 deletions
38
alist/patches/0001-Revert-feat-clear-temp-file-while-start.patch
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
alist/patches/001-disable-delete-of-temp-directory-at-startup.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- a/internal/bootstrap/config.go | ||
+++ b/internal/bootstrap/config.go | ||
@@ -55,11 +55,7 @@ func InitConfig() { | ||
} | ||
conf.Conf.TempDir = absPath | ||
} | ||
- err := os.RemoveAll(filepath.Join(conf.Conf.TempDir)) | ||
- if err != nil { | ||
- log.Errorln("failed delete temp file:", err) | ||
- } | ||
- err = os.MkdirAll(conf.Conf.TempDir, 0700) | ||
+ err := os.MkdirAll(conf.Conf.TempDir, 0700) | ||
if err != nil { | ||
log.Fatalf("create temp dir error: %+v", err) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
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 | ||
|
||
o = s:option(Flag, "enabled", translate("Enable")) | ||
o.rmempty = false | ||
|
||
o = s:option(Value, "port", translate("Port")) | ||
o.datatype = "and(port,min(1))" | ||
o.rmempty = false | ||
|
||
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") | ||
|
||
o = s:option(Flag, "allow_wan", translate("Allow Access From Internet")) | ||
o.rmempty = false | ||
|
||
o = s:option(Value, "temp_dir", translate("Cache directory")) | ||
o.datatype = "string" | ||
o.default = "/tmp/alist" | ||
o.rmempty = false | ||
|
||
o = s:option(Button, "admin_info", translate("View Password")) | ||
o.rawhtml = true | ||
o.template = "alist/admin_info" | ||
|
||
return m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
m = Map("alist") | ||
|
||
m:append(Template("alist/alist_log")) | ||
|
||
return m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<%+cbi/valueheader%> | ||
<script type="text/javascript">//<![CDATA[ | ||
function admin_info(btn) | ||
{ | ||
btn.disabled = true; | ||
btn.value = '<%:Reading...%>'; | ||
XHR.get('<%=luci.dispatcher.build_url("admin", "nas", "alist", "admin_info")%>', | ||
null, | ||
function(x,rv) | ||
{ | ||
var tb = document.getElementById('<%=self.option%>-status'); | ||
if (tb) | ||
{ | ||
tb.innerHTML = "<%:Username:%>" + "<font color='green'>" + rv.username + "</font>"; | ||
tb.innerHTML += "<%:Password:%>" + "<font color='green'>" + rv.password + "</font>"; | ||
} | ||
btn.disabled = false; | ||
btn.value = '<%:Read%>'; | ||
} | ||
); | ||
return false; | ||
} | ||
//]]></script> | ||
<input type="button" class="btn cbi-button cbi-button-apply" value="<%:Read%>" onclick="return admin_info(this)" /> | ||
<span id="<%=self.option%>-status"><em><%=self.value%></em></span> | ||
<%+cbi/valuefooter%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<script type="text/javascript"> | ||
//<![CDATA[ | ||
function clear_log(btn) { | ||
XHR.get('<%=url([[admin]], [[nas]], [[alist]], [[clear_log]])%>', null, | ||
function(x, data) { | ||
if(x && x.status == 200) { | ||
var log_textarea = document.getElementById('log_textarea'); | ||
log_textarea.innerHTML = ""; | ||
log_textarea.scrollTop = log_textarea.scrollHeight; | ||
} | ||
location.reload(); | ||
} | ||
); | ||
} | ||
XHR.poll(2, '<%=url([[admin]], [[nas]], [[alist]], [[get_log]])%>', null, | ||
function(x, data) { | ||
if(x && x.status == 200) { | ||
var log_textarea = document.getElementById('log_textarea'); | ||
log_textarea.innerHTML = x.responseText; | ||
log_textarea.scrollTop = log_textarea.scrollHeight; | ||
} | ||
} | ||
); | ||
//]]> | ||
</script> | ||
<fieldset class="cbi-section" id="_log_fieldset"> | ||
<input class="cbi-button cbi-input-remove" type="button" onclick="clear_log()" value="<%:Clear logs%>" style="margin-left: 10px; margin-top: 10px;"> | ||
<textarea id="log_textarea" class="cbi-input-textarea" style="width: calc(100% - 20px); height: 500px; margin: 10px;" data-update="change" rows="5" wrap="off" readonly="readonly"></textarea> | ||
</fieldset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.