rclone/docs/content/commands/rclone_rcd.md

190 lines
8.3 KiB
Markdown
Raw Normal View History

2018-11-24 13:44:25 +00:00
---
title: "rclone rcd"
description: "Run rclone listening to remote control commands only."
2018-11-24 13:44:25 +00:00
slug: rclone_rcd
url: /commands/rclone_rcd/
2023-08-02 09:02:38 +00:00
groups: RC
2022-12-20 17:16:14 +00:00
versionIntroduced: v1.45
# autogenerated - DO NOT EDIT, instead edit the source code in cmd/rcd/ and as part of making a release run "make commanddocs"
2018-11-24 13:44:25 +00:00
---
# rclone rcd
2018-11-24 13:44:25 +00:00
Run rclone listening to remote control commands only.
## Synopsis
2018-11-24 13:44:25 +00:00
2019-02-09 10:42:57 +00:00
This runs rclone so that it only listens to remote control commands.
2018-11-24 13:44:25 +00:00
This is useful if you are controlling rclone via the rc API.
If you pass in a path to a directory, rclone will serve that directory
for GET requests on the URL passed in. It will also open the URL in
the browser when rclone is run.
See the [rc documentation](/rc/) for more info on the rc flags.
2022-12-20 17:16:14 +00:00
## Server options
2023-06-30 13:11:17 +00:00
Use `--rc-addr` to specify which IP address and port the server should
listen on, eg `--rc-addr 1.2.3.4:8000` or `--rc-addr :8080` to listen to all
2022-12-20 17:16:14 +00:00
IPs. By default it only listens on localhost. You can use port
:0 to let the OS choose an available port.
2023-06-30 13:11:17 +00:00
If you set `--rc-addr` to listen on a public or LAN accessible IP address
2022-12-20 17:16:14 +00:00
then using Authentication is advised - see the next section for info.
You can use a unix socket by setting the url to `unix:///path/to/socket`
or just by using an absolute path name. Note that unix sockets bypass the
authentication - this is expected to be done with file system permissions.
2023-06-30 13:11:17 +00:00
`--rc-addr` may be repeated to listen on multiple IPs/ports/sockets.
2022-12-20 17:16:14 +00:00
2023-06-30 13:11:17 +00:00
`--rc-server-read-timeout` and `--rc-server-write-timeout` can be used to
2022-12-20 17:16:14 +00:00
control the timeouts on the server. Note that this is the total time
for a transfer.
2023-06-30 13:11:17 +00:00
`--rc-max-header-bytes` controls the maximum number of bytes the server will
2022-12-20 17:16:14 +00:00
accept in the HTTP header.
2023-06-30 13:11:17 +00:00
`--rc-baseurl` controls the URL prefix that rclone serves from. By default
rclone will serve from the root. If you used `--rc-baseurl "/rclone"` then
2022-12-20 17:16:14 +00:00
rclone would serve from a URL starting with "/rclone/". This is
useful if you wish to proxy rclone serve. Rclone automatically
2023-06-30 13:11:17 +00:00
inserts leading and trailing "/" on `--rc-baseurl`, so `--rc-baseurl "rclone"`,
`--rc-baseurl "/rclone"` and `--rc-baseurl "/rclone/"` are all treated
2022-12-20 17:16:14 +00:00
identically.
### TLS (SSL)
By default this will serve over http. If you want you can serve over
2023-06-30 13:11:17 +00:00
https. You will need to supply the `--rc-cert` and `--rc-key` flags.
2022-12-20 17:16:14 +00:00
If you wish to do client side certificate validation then you will need to
2023-06-30 13:11:17 +00:00
supply `--rc-client-ca` also.
2022-12-20 17:16:14 +00:00
2023-06-30 13:11:17 +00:00
`--rc-cert` should be a either a PEM encoded certificate or a concatenation
of that with the CA certificate. `--krc-ey` should be the PEM encoded
private key and `--rc-client-ca` should be the PEM encoded client
2022-12-20 17:16:14 +00:00
certificate authority certificate.
2023-06-30 13:11:17 +00:00
--rc-min-tls-version is minimum TLS version that is acceptable. Valid
2022-12-20 17:16:14 +00:00
values are "tls1.0", "tls1.1", "tls1.2" and "tls1.3" (default
"tls1.0").
### Template
2023-06-30 13:11:17 +00:00
`--rc-template` allows a user to specify a custom markup template for HTTP
2022-12-20 17:16:14 +00:00
and WebDAV serve functions. The server exports the following markup
to be used within the template to server pages:
| Parameter | Description |
| :---------- | :---------- |
| .Name | The full path of a file/directory. |
| .Title | Directory listing of .Name |
| .Sort | The current sort used. This is changeable via ?sort= parameter |
| | Sort Options: namedirfirst,name,size,time (default namedirfirst) |
| .Order | The current ordering used. This is changeable via ?order= parameter |
| | Order Options: asc,desc (default asc) |
| .Query | Currently unused. |
| .Breadcrumb | Allows for creating a relative navigation |
|-- .Link | The relative to the root link of the Text. |
|-- .Text | The Name of the directory. |
| .Entries | Information about a specific file/directory. |
|-- .URL | The 'url' of an entry. |
|-- .Leaf | Currently same as 'URL' but intended to be 'just' the name. |
|-- .IsDir | Boolean for if an entry is a directory or not. |
|-- .Size | Size in Bytes of the entry. |
|-- .ModTime | The UTC timestamp of an entry. |
2023-11-26 15:59:12 +00:00
The server also makes the following functions available so that they can be used within the
template. These functions help extend the options for dynamic rendering of HTML. They can
be used to render HTML based on specific conditions.
| Function | Description |
| :---------- | :---------- |
| afterEpoch | Returns the time since the epoch for the given time. |
| contains | Checks whether a given substring is present or not in a given string. |
| hasPrefix | Checks whether the given string begins with the specified prefix. |
| hasSuffix | Checks whether the given string end with the specified suffix. |
2022-12-20 17:16:14 +00:00
### Authentication
By default this will serve files without needing a login.
You can either use an htpasswd file which can take lots of users, or
2023-06-30 13:11:17 +00:00
set a single username and password with the `--rc-user` and `--rc-pass` flags.
2022-12-20 17:16:14 +00:00
2023-06-30 13:11:17 +00:00
If no static users are configured by either of the above methods, and client
certificates are required by the `--client-ca` flag passed to the server, the
client certificate common name will be considered as the username.
Use `--rc-htpasswd /path/to/htpasswd` to provide an htpasswd file. This is
2022-12-20 17:16:14 +00:00
in standard apache format and supports MD5, SHA1 and BCrypt for basic
authentication. Bcrypt is recommended.
To create an htpasswd file:
touch htpasswd
htpasswd -B htpasswd user
htpasswd -B htpasswd anotherUser
The password file can be updated while rclone is running.
2023-06-30 13:11:17 +00:00
Use `--rc-realm` to set the authentication realm.
2022-12-20 17:16:14 +00:00
2023-06-30 13:11:17 +00:00
Use `--rc-salt` to change the password hashing salt from the default.
2022-12-20 17:16:14 +00:00
2018-11-24 13:44:25 +00:00
```
rclone rcd <path to files to serve>* [flags]
```
## Options
2018-11-24 13:44:25 +00:00
```
-h, --help help for rcd
```
2023-08-02 09:02:38 +00:00
## RC Options
Flags to control the Remote Control API.
```
--rc Enable the remote control server
--rc-addr stringArray IPaddress:Port or :Port to bind server to (default [localhost:5572])
--rc-allow-origin string Origin which cross-domain request (CORS) can be executed from
--rc-baseurl string Prefix for URLs - leave blank for root
--rc-cert string TLS PEM key (concatenation of certificate and CA certificate)
--rc-client-ca string Client certificate authority to verify clients with
--rc-enable-metrics Enable prometheus metrics on /metrics
--rc-files string Path to local files to serve on the HTTP server
--rc-htpasswd string A htpasswd file - if not provided no authentication is done
--rc-job-expire-duration Duration Expire finished async jobs older than this value (default 1m0s)
--rc-job-expire-interval Duration Interval to check for expired async jobs (default 10s)
--rc-key string TLS PEM Private key
--rc-max-header-bytes int Maximum size of request header (default 4096)
--rc-min-tls-version string Minimum TLS version that is acceptable (default "tls1.0")
--rc-no-auth Don't require auth for certain methods
--rc-pass string Password for authentication
--rc-realm string Realm for authentication
--rc-salt string Password hashing salt (default "dlPL2MqE")
--rc-serve Enable the serving of remote objects
--rc-server-read-timeout Duration Timeout for server reading data (default 1h0m0s)
--rc-server-write-timeout Duration Timeout for server writing data (default 1h0m0s)
--rc-template string User-specified template
--rc-user string User name for authentication
--rc-web-fetch-url string URL to fetch the releases for webgui (default "https://api.github.com/repos/rclone/rclone-webui-react/releases/latest")
--rc-web-gui Launch WebGUI on localhost
--rc-web-gui-force-update Force update to latest version of web gui
--rc-web-gui-no-open-browser Don't open the browser automatically
--rc-web-gui-update Check and update to latest version of web gui
```
See the [global flags page](/flags/) for global options not listed here.
2023-08-02 09:02:38 +00:00
# SEE ALSO
2018-11-24 13:44:25 +00:00
* [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends.