🌴 Sync 2026-03-05 23:51:42

This commit is contained in:
github-actions[bot] committed 2026-03-05 23:51:42 +08:00
1 parent 97c049ed0a
commit 0acff03804
14253 files changed
+3893239

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
# Copyright (C) 2019 Openwrt.org
#
# This is a free software, use it under Apache Licene 2.0 & GNU General Public License v3.0.
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=Cloudreve for LuCI
LUCI_DEPENDS:=+cloudreve
LUCI_PKGARCH:=all
PKG_NAME:=luci-app-cloudreve
define Package/luci-app-cloudreve/conffiles
/etc/config/cloudreve
/etc/cloudreve/
endef
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature
@@ -0,0 +1,17 @@
module("luci.controller.cloudreve",package.seeall)
function index()
entry({"admin", "nas"}, firstchild(), _("NAS") , 45).dependent = false
if not nixio.fs.access("/etc/config/cloudreve")then
return
end
entry({"admin","nas","cloudreve"},cbi("cloudreve"),_("Cloudreve")).acl_depends = { "luci-app-cloudreve" }
entry({"admin","nas","cloudreve","status"},call("act_status")).leaf=true
end
function act_status()
local e={}
e.running=luci.sys.call("pgrep cloudreve >/dev/null")==0
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end
@@ -0,0 +1,16 @@
m = Map("cloudreve", translate("Cloudreve"), translate("Self-hosted file management and sharing system, supports multiple storage providers."))
m:section(SimpleSection).template="cloudreve/cloudreve_status"
s = m:section(TypedSection, "cloudreve")
s.anonymous=true
enabled = s:option(Flag, "enabled", translate("Enable"))
enabled.rmempty = false
port = s:option(Value,"port",translate("Port"))
port.default = "8052"
port.placeholder = "8052"
port.rmempty = false
return m
@@ -0,0 +1,27 @@
<script type="text/javascript">//<![CDATA[
XHR.poll(3, '<%=url([[admin]], [[nas]], [[cloudreve]], [[status]])%>', null,
function(x, data) {
var tb = document.getElementById('cloudreve_status');
if (data && tb) {
if (data.running) {
var links = '<em><b><font color=green>Cloudreve <%:RUNNING%></font></b></em><input class="cbi-button mar-10" type="button" value="<%:Open Web Interface%>" onclick="openwebui();" />';
tb.innerHTML = links;
} else {
tb.innerHTML = '<em><b><font color=red>Cloudreve <%:NOT RUNNING%></font></b></em>';
}
}
}
);
function openwebui(){
var url = window.location.host+":<%=luci.sys.exec("uci -q get cloudreve.@cloudreve[0].port"):gsub("^%s*(.-)%s*$", "%1")%>";
window.open('http://'+url,'target','');
};
//]]>
</script>
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
<fieldset class="cbi-section">
<p id="cloudreve_status">
<em><%:Collecting data...%></em>
</p>
</fieldset>
+1
View File
@@ -0,0 +1 @@
zh_Hans
@@ -0,0 +1,27 @@
msgid "Cloudreve"
msgstr "Cloudreve"
msgid "Self-hosted file management and sharing system, supports multiple storage providers."
msgstr "Cloudreve 可助你即刻构建出兼备自用或公用的网盘服务,通过多种存储策略的支持、虚拟文件系统等特性实现灵活的文件管理体验。"
msgid "Default login username: admin@cloudreve.org, password: password."
msgstr "默认登录用户名:admin@cloudreve.org,密码:password。"
msgid "Open Web Interface"
msgstr "打开Web界面"
msgid "Cloudreve Run Status"
msgstr "Cloudreve 运行状态"
msgid "Running"
msgstr "运行中"
msgid "Not running"
msgstr "未运行"
msgid "Enable"
msgstr "启用"
msgid "Port"
msgstr "端口"
@@ -0,0 +1,4 @@
config cloudreve
option enabled '0'
option port '8052'
+37
View File
@@ -0,0 +1,37 @@
#!/bin/sh /etc/rc.common
START=99
USE_PROCD=1
homedir="/etc/cloudreve"
get_config() {
config_get_bool enabled $1 enabled 0
config_get port $1 port 8052
}
start_service() {
config_load cloudreve
config_foreach get_config cloudreve
[ $enabled != 1 ] && return 1
mkdir -p "$homedir"
if [ -f "$homedir/cloudreve.ini" ]; then
sed -i "s/Listen = :[0-9]*/Listen = :$port/g" "$homedir/cloudreve.ini"
else
cat >"$homedir/cloudreve.ini"<<EOF
[System]
Debug = false
Mode = master
Listen = :${port}
EOF
fi
procd_open_instance
procd_set_param command /usr/bin/cloudreve -c $homedir/cloudreve.ini
procd_set_param stderr 1
procd_set_param respawn
procd_close_instance
}
service_triggers() {
procd_add_reload_trigger "cloudreve"
}
@@ -0,0 +1,21 @@
#!/bin/sh
[ ! -f "/usr/share/ucitrack/luci-app-cloudreve.json" ] && {
cat > /usr/share/ucitrack/luci-app-cloudreve.json << EEOF
{
"config": "cloudreve",
"init": "cloudreve"
}
EEOF
}
uci -q batch <<-EOF >/dev/null
delete ucitrack.@cloudreve[-1]
add ucitrack cloudreve
set ucitrack.@cloudreve[-1].init=cloudreve
commit ucitrack
EOF
chmod +x /etc/init.d/cloudreve >/dev/null 2>&1
rm -f /tmp/luci-indexcache
exit 0
@@ -0,0 +1,11 @@
{
"luci-app-cloudreve": {
"description": "Grant UCI access for luci-app-cloudreve",
"read": {
"uci": [ "cloudreve" ]
},
"write": {
"uci": [ "cloudreve" ]
}
}
}