🌴 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

+35
View File
@@ -0,0 +1,35 @@
# SPDX-License-Identifier: GPL-3.0-or-later
#
# Copyright (C) 2019 Elon Huang <elonhhuang@gmail.com>
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-rclone
PKG_VERSION:=1.4.1
PKG_RELEASE:=1
LUCI_TITLE:=LuCI support for Rclone
LUCI_DEPENDS:=+luci-compat +rclone-config +fuse-overlayfs +fuse3-utils \
+PACKAGE_$(PKG_NAME)_INCLUDE_rclone-webui:rclone-webui-react \
+PACKAGE_$(PKG_NAME)_INCLUDE_rclone-ng:rclone-ng
PKG_CONFIG_DEPENDS:= \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_rclone-webui \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_rclone-ng
PKG_LICENSE:=GPL-3.0-or-later
PKG_MAINTAINER:=ElonH <elonhhuang@gmail.com>
define Package/luci-app-rclone/config
config PACKAGE_$(PKG_NAME)_INCLUDE_rclone-webui
bool "Include rclone-webui"
default y
config PACKAGE_$(PKG_NAME)_INCLUDE_rclone-ng
bool "Include rclone-ng (another webui)"
default y
endef
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature
@@ -0,0 +1,10 @@
module("luci.controller.rclone", package.seeall)
function index()
if not nixio.fs.access("/etc/config/rclone") then return end
entry({"admin", "nas"}, firstchild(), _("NAS") , 45).dependent = false
local page = entry({"admin", "nas", "rclone"}, cbi("rclone"), _("Rclone"))
page.order = 100
page.dependent = false
page.acl_depends = { "luci-app-rclone" }
end
+190
View File
@@ -0,0 +1,190 @@
require('luci.sys')
require('luci.util')
local ipkg = require('luci.model.ipkg')
local fs = require 'nixio.fs'
local uci = require 'luci.model.uci'.cursor()
local m, s
local running = (luci.sys.call('pidof rclone > /dev/null') == 0)
local state_msg = ''
local trport = uci:get('rclone', 'config', 'port')
local triptype = uci:get('rclone', 'config', 'addr_type')
local trip = ''
if triptype == 'local' then
trip = uci:get('network', 'loopback', 'ipaddr')
elseif triptype == 'lan' then
trip = uci:get('network', 'lan', 'ipaddr')
else
trip = '[ip]'
end
if type(trip) == 'table' then
require('luci.ip')
trip = trip[1]
trip = luci.ip.new(trip)
trip = trip:host()
trip = trip:string()
end
if running then
state_msg = '<b><font color="green">' .. translate('rclone running') .. '</font></b>'
address_msg = translate('rclone address') .. ' : http://' .. trip .. ':' .. trport .. '<br/> <br/>'
else
state_msg = '<b><font color="red">' .. translate('rclone not run') .. '</font></b>'
address_msg = ''
end
if ipkg.installed("rclone-webui-react") and ipkg.installed("rclone-ng") then
m =
Map(
'rclone',
translate('Rclone'),
translate('Rclone ("rsync for cloud storage") is a command line program to sync root/usr/bin and directories to and from different cloud storage providers.') ..
' <br/> <br/> ' .. translate('rclone state') .. ' : ' .. state_msg .. '<br/> <br/>'
.. address_msg ..
translate('Installed Web Interface') ..
'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" class="btn cbi-button" style="margin: 0 5px;" value=" ' ..
translate('Webui React') ..
" \" onclick=\"window.open('http://'+window.location.hostname+'/rclone-webui-react')\"/>" ..
'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" class="btn cbi-button" style="margin: 0 5px;" value=" ' ..
translate('RcloneNg') ..
" \" onclick=\"window.open('http://'+window.location.hostname+'/RcloneNg')\"/> <br/><br/>"
)
elseif ipkg.installed("rclone-webui-react") then
m =
Map(
'rclone',
translate('Rclone'),
translate('Rclone ("rsync for cloud storage") is a command line program to sync root/usr/bin and directories to and from different cloud storage providers.') ..
' <br/> <br/> ' .. translate('rclone state') .. ' : ' .. state_msg .. '<br/> <br/>'
.. address_msg ..
translate('Installed Web Interface') ..
'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" class="btn cbi-button" style="margin: 0 5px;" value=" ' ..
translate('Webui React') ..
" \" onclick=\"window.open('http://'+window.location.hostname+'/rclone-webui-react')\"/>"
)
elseif ipkg.installed("rclone-ng") then
m =
Map(
'rclone',
translate('Rclone'),
translate('Rclone ("rsync for cloud storage") is a command line program to sync root/usr/bin and directories to and from different cloud storage providers.') ..
' <br/> <br/> ' .. translate('rclone state') .. ' : ' .. state_msg .. '<br/> <br/>'
.. address_msg ..
translate('Installed Web Interface') ..
'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" class="btn cbi-button" style="margin: 0 5px;" value=" ' ..
translate('RcloneNg') ..
" \" onclick=\"window.open('http://'+window.location.hostname+'/RcloneNg')\"/> <br/><br/>"
)
else
m =
Map(
'rclone',
translate('Rclone'),
translate('Rclone ("rsync for cloud storage") is a command line program to sync root/usr/bin and directories to and from different cloud storage providers.') ..
' <br/> <br/> ' .. translate('rclone state') .. ' : ' .. state_msg .. '<br/> <br/>'
.. address_msg
)
end
s = m:section(TypedSection, 'global', translate('global'))
s.addremove = false
s.anonymous = true
enable = s:option(Flag, 'enabled', translate('run Rclone as daemon'))
enable.rmempty = false
s = m:section(TypedSection, 'conf', translate('configure'))
s.addremove = false
s.anonymous = true
o = s:option(ListValue, 'addr_type', translate('listen address'))
o:value('local', translate('localhost address'))
o:value('lan', translate('local network address'))
o:value('all', translate('all address'))
o.default = 'lan'
o.rmempty = false
o = s:option(Value, 'port', translate('listen port'))
o.placeholder = 5572
o.default = 5572
o.datatype = 'port'
o.rmempty = false
o = s:option(Value, 'config_path', translate('rclone configuration file path'))
o.placeholder = '/etc/rclone/rclone.conf'
o.default = '/etc/rclone/rclone.conf'
o.rmempty = false
o.description = translate("Recommand: run ") ..
"<span style=\"background: lightgray;border-radius: 4px;padding-left: 4px;padding-right: 4px;\">rclone config --config rclone.conf</span>" ..
translate(" to setup configuration on pc,") .. "</br>" .. translate("than updaload configuration to here.")
o = s:option(Button,"config_download",translate("download configuration"))
o.inputtitle = translate("download")
o.inputstyle = "apply"
o.write = function()
Download()
end
function Download()
local t,e
t=nixio.open(uci:get('rclone', 'config', 'config_path'),"r")
luci.http.header('Content-Disposition','attachment; filename="rclone.conf"')
luci.http.prepare_content("application/octet-stream")
while true do
e=t:read(nixio.const.buffersize)
if(not e)or(#e==0)then
break
else
luci.http.write(e)
end
end
t:close()
luci.http.close()
end
o = s:option(Value, 'username', translate('username'))
o.placeholder = 'admin'
o.default = 'admin'
o.rmempty = false
o = s:option(Value, 'password', translate('password'))
o.password = true
o.placeholder = 'admin'
o.default = 'admin'
o.rmempty = false
s = m:section(TypedSection, 'proxy', translate('proxy'))
s.addremove = false
s.anonymous = true
s.description = "<a style=\"color:#fb6340;\" href=\"#\" onclick=\"window.open('https://rclone.org/faq/#can-i-use-rclone-with-an-http-proxy')\">"
..translate("FAQ").."</a>"
enable = s:option(Flag, 'enabled', translate('enable proxy'))
enable.rmempty = false
o = s:option(Value, 'proxy_addr', translate('proxy address'))
o.placeholder = 'socks5://127.0.0.1:1080'
o.default = 'socks5://127.0.0.1:1080'
o.rmempty = false
o.description = translate("The content of the variable is protocol://server:port. The protocol value is commonly either http or socks5.")
s = m:section(TypedSection, 'log', translate('log'))
s.addremove = false
s.anonymous = true
o = s:option(Value, 'path', translate('path'))
o.placeholder = '/var/log/rclone/output'
o.default = '/var/log/rclone/output'
o.rmempty = false
return m
+110
View File
@@ -0,0 +1,110 @@
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: PACKAGE VERSION\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: en\n"
"MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: luci-app-rclone/luasrc/model/cbi/rclone.lua:41
msgid "Installed Web Interface"
msgstr "Installed Web Interface"
#: luci-app-rclone/luasrc/controller/rclone.lua:7
#: luci-app-rclone/luasrc/model/cbi/rclone.lua:37
msgid "Rclone"
msgstr "Rclone"
#: luci-app-rclone/luasrc/model/cbi/rclone.lua:38
msgid ""
"Rclone (\"rsync for cloud storage\") is a command line program to sync root/"
"usr/bin and directories to and from different cloud storage providers."
msgstr ""
"Rclone (\"rsync for cloud storage\") is a command line program to sync root/"
"usr/bin and directories to and from different cloud storage providers."
#: luci-app-rclone/luasrc/model/cbi/rclone.lua:43
msgid "Webui React"
msgstr "Webui React"
#: luci-app-rclone/luasrc/model/cbi/rclone.lua:61
msgid "all address"
msgstr "all address"
#: luci-app-rclone/luasrc/model/cbi/rclone.lua:54
msgid "configure"
msgstr "configure"
#: luci-app-rclone/luasrc/model/cbi/rclone.lua:77
msgid "download"
msgstr "download"
#: luci-app-rclone/luasrc/model/cbi/rclone.lua:76
msgid "download configuration"
msgstr "download configuration"
#: luci-app-rclone/luasrc/model/cbi/rclone.lua:47
msgid "global"
msgstr "global"
#: luci-app-rclone/luasrc/model/cbi/rclone.lua:58
msgid "listen address"
msgstr "listen address"
#: luci-app-rclone/luasrc/model/cbi/rclone.lua:65
msgid "listen port"
msgstr "listen port"
#: luci-app-rclone/luasrc/model/cbi/rclone.lua:60
msgid "local network address"
msgstr "local network address"
#: luci-app-rclone/luasrc/model/cbi/rclone.lua:59
msgid "localhost address"
msgstr "localhost address"
#: luci-app-rclone/luasrc/model/cbi/rclone.lua:111
msgid "log"
msgstr "log"
#: luci-app-rclone/luasrc/model/cbi/rclone.lua:105
msgid "password"
msgstr "password"
#: luci-app-rclone/luasrc/model/cbi/rclone.lua:115
msgid "path"
msgstr "path"
#: luci-app-rclone/luasrc/model/cbi/rclone.lua:28
msgid "rclone address"
msgstr ""
#: luci-app-rclone/luasrc/model/cbi/rclone.lua:71
msgid "rclone configuration file path"
msgstr "rclone configuration file path"
#: luci-app-rclone/luasrc/model/cbi/rclone.lua:30
msgid "rclone not run"
msgstr "rclone not run"
#: luci-app-rclone/luasrc/model/cbi/rclone.lua:27
msgid "rclone running"
msgstr "rclone running"
#: luci-app-rclone/luasrc/model/cbi/rclone.lua:39
msgid "rclone state"
msgstr "rclone state"
#: luci-app-rclone/luasrc/model/cbi/rclone.lua:51
msgid "run Rclone as daemon"
msgstr "run Rclone as daemon"
#: luci-app-rclone/luasrc/model/cbi/rclone.lua:100
msgid "username"
msgstr "username"
#~ msgid "run Rclone in daeman"
#~ msgstr "run Rclone in daeman"
+1
View File
@@ -0,0 +1 @@
zh_Hans
@@ -0,0 +1,171 @@
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: \n"
"Last-Translator: ElonH <elonhhuang@gmail.com>\n"
"Language-Team: none\n"
"Language: zh-Hans\n"
"MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"X-Generator: Poedit 2.0.6\n"
#: luasrc/model/cbi/rclone.lua:121
msgid "FAQ"
msgstr "常见问题"
#: luasrc/model/cbi/rclone.lua:41
msgid "Installed Web Interface"
msgstr "已安装Web界面"
#: luasrc/controller/rclone.lua:5
msgid "NAS"
msgstr "存储"
#: luasrc/model/cbi/rclone.lua:37 luasrc/controller/rclone.lua:6
msgid "Rclone"
msgstr "Rclone"
#: luasrc/model/cbi/rclone.lua:38
msgid ""
"Rclone (\"rsync for cloud storage\") is a command line program to sync root/"
"usr/bin and directories to and from different cloud storage providers."
msgstr ""
"Rclone是一款的命令行工具,支持在不同对象存储、网盘间同步、上传、下载数据。"
#: luasrc/model/cbi/rclone.lua:46
msgid "RcloneNg"
msgstr "RcloneNg"
#: luasrc/model/cbi/rclone.lua:78
msgid "Recommand: run"
msgstr "建议: 在 PC 上运行"
#: luasrc/model/cbi/rclone.lua:130
msgid ""
"The content of the variable is protocol://server:port. The protocol value is "
"commonly either http or socks5."
msgstr ""
"内容格式为: protocol://server:port\n"
"protocol 通常为 http 或者 socks5"
#: luasrc/model/cbi/rclone.lua:43
msgid "Webui React"
msgstr "Webui React"
#: luasrc/model/cbi/rclone.lua:64
msgid "all address"
msgstr "全部地址"
#: luasrc/model/cbi/rclone.lua:57
msgid "configure"
msgstr "配置"
#: luasrc/model/cbi/rclone.lua:83
msgid "download"
msgstr "下载"
#: luasrc/model/cbi/rclone.lua:82
msgid "download configuration"
msgstr "下载配置文件"
#: luasrc/model/cbi/rclone.lua:123
msgid "enable proxy"
msgstr "启用代理"
#: luasrc/model/cbi/rclone.lua:50
msgid "global"
msgstr "全局"
#: luasrc/model/cbi/rclone.lua:61
msgid "listen address"
msgstr "监听地址"
#: luasrc/model/cbi/rclone.lua:68
msgid "listen port"
msgstr "监听端口"
#: luasrc/model/cbi/rclone.lua:63
msgid "local network address"
msgstr "局域网地址"
#: luasrc/model/cbi/rclone.lua:62
msgid "localhost address"
msgstr "本机地址"
#: luasrc/model/cbi/rclone.lua:132
msgid "log"
msgstr "日志"
#: luasrc/model/cbi/rclone.lua:111
msgid "password"
msgstr "密码"
#: luasrc/model/cbi/rclone.lua:136
msgid "path"
msgstr "路径"
#: luasrc/model/cbi/rclone.lua:117
msgid "proxy"
msgstr "代理"
#: luasrc/model/cbi/rclone.lua:126
msgid "proxy address"
msgstr "代理地址"
#: luasrc/model/cbi/rclone.lua:28
msgid "rclone address"
msgstr "rclone 地址"
#: luasrc/model/cbi/rclone.lua:74
msgid "rclone configuration file path"
msgstr "rclone 配置文件地址"
#: luasrc/model/cbi/rclone.lua:30
msgid "rclone not run"
msgstr "rclone未运行"
#: luasrc/model/cbi/rclone.lua:27
msgid "rclone running"
msgstr "rclone 运行中"
#: luasrc/model/cbi/rclone.lua:39
msgid "rclone state"
msgstr "rclone 状态"
#: luasrc/model/cbi/rclone.lua:54
msgid "run Rclone as daemon"
msgstr "启动 rclone 后台服务"
#: luasrc/model/cbi/rclone.lua:80
msgid "than updaload configuration to here."
msgstr "然后上传配置文件到这里"
#: luasrc/model/cbi/rclone.lua:80
msgid "to setup configuration on pc,"
msgstr "命令设置 rclone 配置文件,"
#: luasrc/model/cbi/rclone.lua:106
msgid "username"
msgstr "用户名"
#~ msgid "Hosts must be comma separated, and can contain domains or parts."
#~ msgstr "用逗号分隔地址,且地址必须包含(部分)域名"
#~ msgid "This allows you to disable the proxy for specific hosts."
#~ msgstr "这允许不代理特定的地址."
#~ msgid "How to proxy rclone"
#~ msgstr "如何代理rclone"
#~ msgid "disable proxy for specific hosts"
#~ msgstr "针对特定主机禁用代理"
#~ msgid ""
#~ "rclone will follow the standard environment variables for proxies, "
#~ "similar to cURL and other programs."
#~ msgstr "rclone 会使用代理的标准环境变量,类似于 cURL 及其他程序。"
#~ msgid "run Rclone in daeman"
#~ msgstr "启动 rclone 后台服务"
@@ -0,0 +1,19 @@
#!/bin/sh
[ ! -f "/usr/share/ucitrack/luci-app-rclone.json" ] && {
cat > /usr/share/ucitrack/luci-app-rclone.json << EEOF
{
"config": "rclone",
"init": "rclone"
}
EEOF
}
uci -q batch <<-EOF >/dev/null
delete ucitrack.@rclone[-1]
add ucitrack rclone
set ucitrack.@rclone[-1].init=rclone
commit ucitrack
EOF
rm -f /tmp/luci-indexcache
exit 0
@@ -0,0 +1,11 @@
{
"luci-app-rclone": {
"description": "Grant UCI access for luci-app-rclone",
"read": {
"uci": ["rclone"]
},
"write": {
"uci": ["rclone"]
}
}
}