I've opened a PR to openwrt/packages:
Excellent - great work! Thank you. I think this is a great addition to OpenWrt. I'm surprised it hasn't been done earlier. Perhaps people don't know what rclone can do.
I would be happy to test for latest snapshot on RT3200 but I'm clueless as to how to build package from the new source. Normally I just add @ElonH's source into custom feeds in the SDK and then compile package from that.
You may download the prebuilt binaries from GitHub Actions directly
See https://github.com/openwrt/packages/actions/runs/1332182043
What about for MediaTek MT7622B?
It's aarch64_cortex-a53.
Please download this one: https://github.com/openwrt/packages/suites/4026615938/artifacts/101840724
Will do! Do you use rclone too then? It's great.
To be honest, it's been a long time since I last used it, also for @ElonH.
We mainly maintain this package for our friends and users.
@1715173329 @ElonH had /etc/rclone/rclone.conf the main location for the config file. Shouldn't we include that here too?
Include?
What do you mean about "include"?
In the 1.52, I have hacked the rclone default conf file path as /etc/rclone/rclone.conf
. And this path is used in luci
Yes, sorry, that is what I meant. Shouldn't the rclone default conf file in 1.56 also be set to /etc/rclone/rclone.conf?
Also what is the purpose of the rclone service file in /etc/init.d?
!/bin/sh /etc/rc.common
# Copyright (C) 2019 ElonH <elonhhuang@gmail.com>
USE_PROCD=1
START=95
STOP=10
APP=rclone
CONFIGURATION=rclone
_info() {
logger -p daemon.info -t "$APP" "$*"
}
_err() {
logger -p daemon.err -t "$APP" "$*"
}
init_config() {
config_load "${CONFIGURATION}"
# Create rclone dirs
local config_path
local config_dir
local log_path
local log_dir
config_get config_path config config_path
config_get log_path log path
config_dir=${config_path%/*}
[ -d "$config_dir" ] || mkdir -p "$config_dir" 2>/dev/null
[ -f "$config_path" ] || touch "$config_path"
[ -d "/lib/upgrade/keep.d" ] || mkdir -p /lib/upgrade/keep.d/luci-app-rclone 2>/dev/null
echo "$config_path" > /lib/upgrade/keep.d/luci-app-rclone
log_dir=${log_path%/*}
[ -d "$log_dir" ] || mkdir -p "$log_dir" 2>/dev/null && echo /dev/null > "$log_path"
}
start_service() {
init_config
local enabled
local config_path
local addr_type
local port
local username
local password
local proxy_enable
local proxy_addr
local log_path
config_get enabled global enabled
config_get config_path config config_path
config_get addr_type config addr_type
config_get port config port
config_get username config username
config_get password config password
config_get proxy_enable proxy enabled
config_get proxy_addr proxy proxy_addr
config_get log_path log path
if [[ "${addr_type}" == "local" ]]; then
addr="$(uci get network.loopback.ipaddr)"
elif [[ "${addr_type}" == "lan" ]]; then
addr="$(uci get network.lan.ipaddr)"
elif [[ "${addr_type}" == "all" ]]; then
addr=""
fi
[ "$enabled" == "1" ] || { _info "Instance \"rclone\" disabled."; return 1; }
_info "Instance \"rclone\" start."
procd_open_instance
procd_set_param command /usr/bin/$APP rcd -vv
procd_append_param command "--rc-addr=$addr:$port"
procd_append_param command "--rc-user=$username" "--rc-pass=$password"
procd_append_param command "--config=$config_path"
procd_append_param command "--rc-allow-origin=*"
procd_append_param command "--log-file=${log_path}"
if [[ "${proxy_enable}" == "1" ]]; then
procd_set_param env all_proxy="$proxy_addr" https_proxy="$proxy_addr" http_proxy="$proxy_addr"
procd_append_param env ALL_PROXY="$proxy_addr" HTTPS_PROXY="$proxy_addr" HTTP_PROXY="$proxy_addr"
fi
procd_set_param stdout 1
procd_set_param stderr 1
procd_set_param file /etc/config/rclone
# procd_set_param pidfile /var/run/rclone.pid
procd_set_param user rclone
procd_set_param group rclone
procd_set_param respawn retry=60
procd_close_instance
}
service_triggers() {
procd_add_reload_trigger "rclone"
}
Also what is the purpose of the rclone service file in /etc/init.d?
This is for webui, and you may notice there're 2 packages called rclone-webui-react and rclone-ng.
So you can manage files via them.
Aria2 in OpenWrt does the same thing.
Shouldn't the rclone default conf file in 1.56 also be set to /etc/rclone/rclone.conf?
This hack is pointless anyway.
You won't need change the default config path for cli usage, on the other hand, when you start a service for webui, init script will pass config path to rclone.
OK thanks. Should the service file perhaps only get installed by rclone-webui-react or rclone-ng if it is not used by rclone alone?
well, it makes sense. Thanks for your advice.
Not at all - I am no expert; on behalf of all the OpenWrt users that end up using these packages a huge thank you to you and @ElonH for making this possible.
It's my plasure
Hi there, PR #16871 was merged into master branch just now.
Excellent news!
And it is in:
Woohoo! I can now do encrypted, append-only incremental backups to an OpenWrt-based backup box! Rejoice.
And I just enjoyed snapshot upgrade without having to build from SDK. Profit!
The cumulative benefit of OpenWrt on my RT3200 consumer router is astounding. So much added functionality.
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.