mirror of
https://github.com/rclone/rclone.git
synced 2025-12-12 06:24:14 +01:00
docs: fix markdown lint issues in command docs
This commit is contained in:
@@ -123,7 +123,7 @@ default "rclone (hostname)".
|
||||
Use ` + "`--log-trace` in conjunction with `-vv`" + ` to enable additional debug
|
||||
logging of all UPNP traffic.
|
||||
|
||||
` + vfs.Help(),
|
||||
` + strings.TrimSpace(vfs.Help()),
|
||||
Annotations: map[string]string{
|
||||
"versionIntroduced": "v1.46",
|
||||
"groups": "Filter",
|
||||
|
||||
@@ -59,7 +59,7 @@ func init() {
|
||||
var Command = &cobra.Command{
|
||||
Use: "docker",
|
||||
Short: `Serve any remote on docker's volume plugin API.`,
|
||||
Long: help() + vfs.Help(),
|
||||
Long: help() + strings.TrimSpace(vfs.Help()),
|
||||
Annotations: map[string]string{
|
||||
"versionIntroduced": "v1.56",
|
||||
"groups": "Filter",
|
||||
|
||||
@@ -8,7 +8,8 @@ docker daemon and runs the corresponding code when necessary.
|
||||
Docker plugins can run as a managed plugin under control of the docker daemon
|
||||
or as an independent native service. For testing, you can just run it directly
|
||||
from the command line, for example:
|
||||
```
|
||||
|
||||
```sh
|
||||
sudo rclone serve docker --base-dir /tmp/rclone-volumes --socket-addr localhost:8787 -vv
|
||||
```
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import (
|
||||
"os/user"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
@@ -140,7 +141,7 @@ By default this will serve files without needing a login.
|
||||
|
||||
You can set a single username and password with the --user and --pass flags.
|
||||
|
||||
` + vfs.Help() + proxy.Help,
|
||||
` + strings.TrimSpace(vfs.Help()+proxy.Help),
|
||||
Annotations: map[string]string{
|
||||
"versionIntroduced": "v1.44",
|
||||
"groups": "Filter",
|
||||
|
||||
@@ -110,7 +110,7 @@ The server will log errors. Use ` + "`-v`" + ` to see access logs.
|
||||
` + "`--bwlimit`" + ` will be respected for file transfers. Use ` + "`--stats`" + ` to
|
||||
control the stats printing.
|
||||
|
||||
` + libhttp.Help(flagPrefix) + libhttp.TemplateHelp(flagPrefix) + libhttp.AuthHelp(flagPrefix) + vfs.Help() + proxy.Help,
|
||||
` + strings.TrimSpace(libhttp.Help(flagPrefix)+libhttp.TemplateHelp(flagPrefix)+libhttp.AuthHelp(flagPrefix)+vfs.Help()+proxy.Help),
|
||||
Annotations: map[string]string{
|
||||
"versionIntroduced": "v1.39",
|
||||
"groups": "Filter",
|
||||
|
||||
@@ -125,7 +125,7 @@ var Command = &cobra.Command{
|
||||
Use: "nfs remote:path",
|
||||
Short: `Serve the remote as an NFS mount`,
|
||||
Long: strings.ReplaceAll(`Create an NFS server that serves the given remote over the network.
|
||||
|
||||
|
||||
This implements an NFSv3 server to serve any rclone remote via NFS.
|
||||
|
||||
The primary purpose for this command is to enable the [mount
|
||||
@@ -179,12 +179,16 @@ cache.
|
||||
|
||||
To serve NFS over the network use following command:
|
||||
|
||||
rclone serve nfs remote: --addr 0.0.0.0:$PORT --vfs-cache-mode=full
|
||||
|||sh
|
||||
rclone serve nfs remote: --addr 0.0.0.0:$PORT --vfs-cache-mode=full
|
||||
|||
|
||||
|
||||
This specifies a port that can be used in the mount command. To mount
|
||||
the server under Linux/macOS, use the following command:
|
||||
|
||||
mount -t nfs -o port=$PORT,mountport=$PORT,tcp $HOSTNAME:/ path/to/mountpoint
|
||||
|
||||
|||sh
|
||||
mount -t nfs -o port=$PORT,mountport=$PORT,tcp $HOSTNAME:/ path/to/mountpoint
|
||||
|||
|
||||
|
||||
Where |$PORT| is the same port number used in the |serve nfs| command
|
||||
and |$HOSTNAME| is the network address of the machine that |serve nfs|
|
||||
@@ -198,7 +202,7 @@ is desired.
|
||||
|
||||
This command is only available on Unix platforms.
|
||||
|
||||
`, "|", "`") + vfs.Help(),
|
||||
`, "|", "`") + strings.TrimSpace(vfs.Help()),
|
||||
Annotations: map[string]string{
|
||||
"versionIntroduced": "v1.65",
|
||||
"groups": "Filter",
|
||||
|
||||
@@ -46,41 +46,43 @@ options - it is the job of the proxy program to make a complete
|
||||
config.
|
||||
|
||||
This config generated must have this extra parameter
|
||||
|
||||
- |_root| - root to use for the backend
|
||||
|
||||
And it may have this parameter
|
||||
|
||||
- |_obscure| - comma separated strings for parameters to obscure
|
||||
|
||||
If password authentication was used by the client, input to the proxy
|
||||
process (on STDIN) would look similar to this:
|
||||
|
||||
|||
|
||||
|||json
|
||||
{
|
||||
"user": "me",
|
||||
"pass": "mypassword"
|
||||
"user": "me",
|
||||
"pass": "mypassword"
|
||||
}
|
||||
|||
|
||||
|
||||
If public-key authentication was used by the client, input to the
|
||||
proxy process (on STDIN) would look similar to this:
|
||||
|
||||
|||
|
||||
|||json
|
||||
{
|
||||
"user": "me",
|
||||
"public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDuwESFdAe14hVS6omeyX7edc...JQdf"
|
||||
"user": "me",
|
||||
"public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDuwESFdAe14hVS6omeyX7edc...JQdf"
|
||||
}
|
||||
|||
|
||||
|
||||
And as an example return this on STDOUT
|
||||
|
||||
|||
|
||||
|||json
|
||||
{
|
||||
"type": "sftp",
|
||||
"_root": "",
|
||||
"_obscure": "pass",
|
||||
"user": "me",
|
||||
"pass": "mypassword",
|
||||
"host": "sftp.example.com"
|
||||
"type": "sftp",
|
||||
"_root": "",
|
||||
"_obscure": "pass",
|
||||
"user": "me",
|
||||
"pass": "mypassword",
|
||||
"host": "sftp.example.com"
|
||||
}
|
||||
|||
|
||||
|
||||
@@ -102,7 +104,7 @@ password or public-key is changed the cache will need to expire (which takes 5 m
|
||||
before it takes effect.
|
||||
|
||||
This can be used to build general purpose proxies to any kind of
|
||||
backend that rclone supports.
|
||||
backend that rclone supports.
|
||||
|
||||
`, "|", "`")
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ The server will log errors. Use -v to see access logs.
|
||||
` + "`--bwlimit`" + ` will be respected for file transfers.
|
||||
Use ` + "`--stats`" + ` to control the stats printing.
|
||||
|
||||
### Setting up rclone for use by restic ###
|
||||
### Setting up rclone for use by restic
|
||||
|
||||
First [set up a remote for your chosen cloud provider](/docs/#configure).
|
||||
|
||||
@@ -119,7 +119,9 @@ following instructions.
|
||||
|
||||
Now start the rclone restic server
|
||||
|
||||
rclone serve restic -v remote:backup
|
||||
` + "```sh" + `
|
||||
rclone serve restic -v remote:backup
|
||||
` + "```" + `
|
||||
|
||||
Where you can replace "backup" in the above by whatever path in the
|
||||
remote you wish to use.
|
||||
@@ -133,7 +135,7 @@ Adding ` + "`--cache-objects=false`" + ` will cause rclone to stop caching objec
|
||||
returned from the List call. Caching is normally desirable as it speeds
|
||||
up downloading objects, saves transactions and uses very little memory.
|
||||
|
||||
### Setting up restic to use rclone ###
|
||||
### Setting up restic to use rclone
|
||||
|
||||
Now you can [follow the restic
|
||||
instructions](http://restic.readthedocs.io/en/latest/030_preparing_a_new_repo.html#rest-server)
|
||||
@@ -147,38 +149,43 @@ the URL for the REST server.
|
||||
|
||||
For example:
|
||||
|
||||
$ export RESTIC_REPOSITORY=rest:http://localhost:8080/
|
||||
$ export RESTIC_PASSWORD=yourpassword
|
||||
$ restic init
|
||||
created restic backend 8b1a4b56ae at rest:http://localhost:8080/
|
||||
` + "```sh" + `
|
||||
$ export RESTIC_REPOSITORY=rest:http://localhost:8080/
|
||||
$ export RESTIC_PASSWORD=yourpassword
|
||||
$ restic init
|
||||
created restic backend 8b1a4b56ae at rest:http://localhost:8080/
|
||||
|
||||
Please note that knowledge of your password is required to access
|
||||
the repository. Losing your password means that your data is
|
||||
irrecoverably lost.
|
||||
$ restic backup /path/to/files/to/backup
|
||||
scan [/path/to/files/to/backup]
|
||||
scanned 189 directories, 312 files in 0:00
|
||||
[0:00] 100.00% 38.128 MiB / 38.128 MiB 501 / 501 items 0 errors ETA 0:00
|
||||
duration: 0:00
|
||||
snapshot 45c8fdd8 saved
|
||||
Please note that knowledge of your password is required to access
|
||||
the repository. Losing your password means that your data is
|
||||
irrecoverably lost.
|
||||
$ restic backup /path/to/files/to/backup
|
||||
scan [/path/to/files/to/backup]
|
||||
scanned 189 directories, 312 files in 0:00
|
||||
[0:00] 100.00% 38.128 MiB / 38.128 MiB 501 / 501 items 0 errors ETA 0:00
|
||||
duration: 0:00
|
||||
snapshot 45c8fdd8 saved
|
||||
|
||||
#### Multiple repositories ####
|
||||
` + "```" + `
|
||||
|
||||
#### Multiple repositories
|
||||
|
||||
Note that you can use the endpoint to host multiple repositories. Do
|
||||
this by adding a directory name or path after the URL. Note that
|
||||
these **must** end with /. Eg
|
||||
|
||||
$ export RESTIC_REPOSITORY=rest:http://localhost:8080/user1repo/
|
||||
# backup user1 stuff
|
||||
$ export RESTIC_REPOSITORY=rest:http://localhost:8080/user2repo/
|
||||
# backup user2 stuff
|
||||
` + "```sh" + `
|
||||
$ export RESTIC_REPOSITORY=rest:http://localhost:8080/user1repo/
|
||||
# backup user1 stuff
|
||||
$ export RESTIC_REPOSITORY=rest:http://localhost:8080/user2repo/
|
||||
# backup user2 stuff
|
||||
` + "```" + `
|
||||
|
||||
#### Private repositories ####
|
||||
#### Private repositories
|
||||
|
||||
The` + "`--private-repos`" + ` flag can be used to limit users to repositories starting
|
||||
with a path of ` + "`/<username>/`" + `.
|
||||
|
||||
` + libhttp.Help(flagPrefix) + libhttp.AuthHelp(flagPrefix),
|
||||
` + strings.TrimSpace(libhttp.Help(flagPrefix)+libhttp.AuthHelp(flagPrefix)),
|
||||
Annotations: map[string]string{
|
||||
"versionIntroduced": "v1.40",
|
||||
},
|
||||
|
||||
@@ -105,7 +105,7 @@ var Command = &cobra.Command{
|
||||
},
|
||||
Use: "s3 remote:path",
|
||||
Short: `Serve remote:path over s3.`,
|
||||
Long: help() + httplib.AuthHelp(flagPrefix) + httplib.Help(flagPrefix) + vfs.Help(),
|
||||
Long: help() + strings.TrimSpace(httplib.AuthHelp(flagPrefix)+httplib.Help(flagPrefix)+vfs.Help()),
|
||||
RunE: func(command *cobra.Command, args []string) error {
|
||||
var f fs.Fs
|
||||
if proxy.Opt.AuthProxy == "" {
|
||||
|
||||
@@ -33,20 +33,20 @@ cause problems for S3 clients which rely on the Etag being the MD5.
|
||||
For a simple set up, to serve `remote:path` over s3, run the server
|
||||
like this:
|
||||
|
||||
```
|
||||
```sh
|
||||
rclone serve s3 --auth-key ACCESS_KEY_ID,SECRET_ACCESS_KEY remote:path
|
||||
```
|
||||
|
||||
For example, to use a simple folder in the filesystem, run the server
|
||||
with a command like this:
|
||||
|
||||
```
|
||||
```sh
|
||||
rclone serve s3 --auth-key ACCESS_KEY_ID,SECRET_ACCESS_KEY local:/path/to/folder
|
||||
```
|
||||
|
||||
The `rclone.conf` for the server could look like this:
|
||||
|
||||
```
|
||||
```ini
|
||||
[local]
|
||||
type = local
|
||||
```
|
||||
@@ -59,7 +59,7 @@ will be visible as a warning in the logs. But it will run nonetheless.
|
||||
This will be compatible with an rclone (client) remote configuration which
|
||||
is defined like this:
|
||||
|
||||
```
|
||||
```ini
|
||||
[serves3]
|
||||
type = s3
|
||||
provider = Rclone
|
||||
@@ -116,20 +116,20 @@ metadata which will be set as the modification time of the file.
|
||||
`serve s3` currently supports the following operations.
|
||||
|
||||
- Bucket
|
||||
- `ListBuckets`
|
||||
- `CreateBucket`
|
||||
- `DeleteBucket`
|
||||
- `ListBuckets`
|
||||
- `CreateBucket`
|
||||
- `DeleteBucket`
|
||||
- Object
|
||||
- `HeadObject`
|
||||
- `ListObjects`
|
||||
- `GetObject`
|
||||
- `PutObject`
|
||||
- `DeleteObject`
|
||||
- `DeleteObjects`
|
||||
- `CreateMultipartUpload`
|
||||
- `CompleteMultipartUpload`
|
||||
- `AbortMultipartUpload`
|
||||
- `CopyObject`
|
||||
- `UploadPart`
|
||||
- `HeadObject`
|
||||
- `ListObjects`
|
||||
- `GetObject`
|
||||
- `PutObject`
|
||||
- `DeleteObject`
|
||||
- `DeleteObjects`
|
||||
- `CreateMultipartUpload`
|
||||
- `CompleteMultipartUpload`
|
||||
- `AbortMultipartUpload`
|
||||
- `CopyObject`
|
||||
- `UploadPart`
|
||||
|
||||
Other operations will return error `Unimplemented`.
|
||||
|
||||
@@ -19,10 +19,11 @@ var Command = &cobra.Command{
|
||||
Long: `Serve a remote over a given protocol. Requires the use of a
|
||||
subcommand to specify the protocol, e.g.
|
||||
|
||||
rclone serve http remote:
|
||||
` + "```sh" + `
|
||||
rclone serve http remote:
|
||||
` + "```" + `
|
||||
|
||||
Each subcommand has its own options which you can see in their help.
|
||||
`,
|
||||
Each subcommand has its own options which you can see in their help.`,
|
||||
Annotations: map[string]string{
|
||||
"versionIntroduced": "v1.39",
|
||||
},
|
||||
|
||||
@@ -6,6 +6,7 @@ package sftp
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/rclone/rclone/cmd"
|
||||
"github.com/rclone/rclone/cmd/serve"
|
||||
@@ -146,11 +147,13 @@ reachable externally then supply ` + "`--addr :2022`" + ` for example.
|
||||
This also supports being run with socket activation, in which case it will
|
||||
listen on the first passed FD.
|
||||
It can be configured with .socket and .service unit files as described in
|
||||
https://www.freedesktop.org/software/systemd/man/latest/systemd.socket.html
|
||||
<https://www.freedesktop.org/software/systemd/man/latest/systemd.socket.html>.
|
||||
|
||||
Socket activation can be tested ad-hoc with the ` + "`systemd-socket-activate`" + `command:
|
||||
|
||||
systemd-socket-activate -l 2222 -- rclone serve sftp :local:vfs/
|
||||
` + "```sh" + `
|
||||
systemd-socket-activate -l 2222 -- rclone serve sftp :local:vfs/
|
||||
` + "```" + `
|
||||
|
||||
This will socket-activate rclone on the first connection to port 2222 over TCP.
|
||||
|
||||
@@ -160,7 +163,9 @@ sftp backend, but it may not be with other SFTP clients.
|
||||
If ` + "`--stdio`" + ` is specified, rclone will serve SFTP over stdio, which can
|
||||
be used with sshd via ~/.ssh/authorized_keys, for example:
|
||||
|
||||
restrict,command="rclone serve sftp --stdio ./photos" ssh-rsa ...
|
||||
` + "```text" + `
|
||||
restrict,command="rclone serve sftp --stdio ./photos" ssh-rsa ...
|
||||
` + "```" + `
|
||||
|
||||
On the client you need to set ` + "`--transfers 1`" + ` when using ` + "`--stdio`" + `.
|
||||
Otherwise multiple instances of the rclone server are started by OpenSSH
|
||||
@@ -173,7 +178,7 @@ used. Omitting "restrict" and using ` + "`--sftp-path-override`" + ` to enable
|
||||
checksumming is possible but less secure and you could use the SFTP server
|
||||
provided by OpenSSH in this case.
|
||||
|
||||
` + vfs.Help() + proxy.Help,
|
||||
` + strings.TrimSpace(vfs.Help()+proxy.Help),
|
||||
Annotations: map[string]string{
|
||||
"versionIntroduced": "v1.48",
|
||||
"groups": "Filter",
|
||||
|
||||
@@ -107,7 +107,7 @@ browser, or you can make a remote of type WebDAV to read and write it.
|
||||
|
||||
### WebDAV options
|
||||
|
||||
#### --etag-hash
|
||||
#### --etag-hash
|
||||
|
||||
This controls the ETag header. Without this flag the ETag will be
|
||||
based on the ModTime and Size of the object.
|
||||
@@ -119,44 +119,58 @@ to see the full list.
|
||||
|
||||
### Access WebDAV on Windows
|
||||
|
||||
WebDAV shared folder can be mapped as a drive on Windows, however the default settings prevent it.
|
||||
Windows will fail to connect to the server using insecure Basic authentication.
|
||||
It will not even display any login dialog. Windows requires SSL / HTTPS connection to be used with Basic.
|
||||
If you try to connect via Add Network Location Wizard you will get the following error:
|
||||
WebDAV shared folder can be mapped as a drive on Windows, however the default
|
||||
settings prevent it. Windows will fail to connect to the server using insecure
|
||||
Basic authentication. It will not even display any login dialog. Windows
|
||||
requires SSL / HTTPS connection to be used with Basic. If you try to connect
|
||||
via Add Network Location Wizard you will get the following error:
|
||||
"The folder you entered does not appear to be valid. Please choose another".
|
||||
However, you still can connect if you set the following registry key on a client machine:
|
||||
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters\BasicAuthLevel to 2.
|
||||
The BasicAuthLevel can be set to the following values:
|
||||
0 - Basic authentication disabled
|
||||
1 - Basic authentication enabled for SSL connections only
|
||||
2 - Basic authentication enabled for SSL connections and for non-SSL connections
|
||||
However, you still can connect if you set the following registry key on a
|
||||
client machine:
|
||||
` + "`HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\WebClient\\Parameters\\BasicAuthLevel`" + `
|
||||
to 2. The BasicAuthLevel can be set to the following values:
|
||||
|
||||
` + "```text" + `
|
||||
0 - Basic authentication disabled
|
||||
1 - Basic authentication enabled for SSL connections only
|
||||
2 - Basic authentication enabled for SSL connections and for non-SSL connections
|
||||
` + "```" + `
|
||||
|
||||
If required, increase the FileSizeLimitInBytes to a higher value.
|
||||
Navigate to the Services interface, then restart the WebClient service.
|
||||
|
||||
### Access Office applications on WebDAV
|
||||
|
||||
Navigate to following registry HKEY_CURRENT_USER\Software\Microsoft\Office\[14.0/15.0/16.0]\Common\Internet
|
||||
Navigate to following registry
|
||||
` + "`HKEY_CURRENT_USER\\Software\\Microsoft\\Office\\[14.0/15.0/16.0]\\Common\\Internet`" + `
|
||||
Create a new DWORD BasicAuthLevel with value 2.
|
||||
0 - Basic authentication disabled
|
||||
1 - Basic authentication enabled for SSL connections only
|
||||
2 - Basic authentication enabled for SSL and for non-SSL connections
|
||||
|
||||
https://learn.microsoft.com/en-us/office/troubleshoot/powerpoint/office-opens-blank-from-sharepoint
|
||||
` + "```text" + `
|
||||
0 - Basic authentication disabled
|
||||
1 - Basic authentication enabled for SSL connections only
|
||||
2 - Basic authentication enabled for SSL and for non-SSL connections
|
||||
` + "```" + `
|
||||
|
||||
<https://learn.microsoft.com/en-us/office/troubleshoot/powerpoint/office-opens-blank-from-sharepoint>
|
||||
|
||||
### Serving over a unix socket
|
||||
|
||||
You can serve the webdav on a unix socket like this:
|
||||
|
||||
rclone serve webdav --addr unix:///tmp/my.socket remote:path
|
||||
` + "```sh" + `
|
||||
rclone serve webdav --addr unix:///tmp/my.socket remote:path
|
||||
` + "```" + `
|
||||
|
||||
and connect to it like this using rclone and the webdav backend:
|
||||
|
||||
rclone --webdav-unix-socket /tmp/my.socket --webdav-url http://localhost lsf :webdav:
|
||||
` + "```sh" + `
|
||||
rclone --webdav-unix-socket /tmp/my.socket --webdav-url http://localhost lsf :webdav:
|
||||
` + "```" + `
|
||||
|
||||
Note that there is no authentication on http protocol - this is expected to be
|
||||
done by the permissions on the socket.
|
||||
|
||||
` + libhttp.Help(flagPrefix) + libhttp.TemplateHelp(flagPrefix) + libhttp.AuthHelp(flagPrefix) + vfs.Help() + proxy.Help,
|
||||
` + strings.TrimSpace(libhttp.Help(flagPrefix)+libhttp.TemplateHelp(flagPrefix)+libhttp.AuthHelp(flagPrefix)+vfs.Help()+proxy.Help),
|
||||
Annotations: map[string]string{
|
||||
"versionIntroduced": "v1.39",
|
||||
"groups": "Filter",
|
||||
|
||||
Reference in New Issue
Block a user