2
0
Эх сурвалжийг харах

Merge pull request #7 from ThomasWaldmann/improve-docs

Documentation for 'attic serve'
TW 10 жил өмнө
parent
commit
f392ed6a25

+ 12 - 4
docs/quickstart.rst

@@ -138,17 +138,25 @@ Remote repositories
 host is accessible using SSH.  This is fastest and easiest when |project_name|
 host is accessible using SSH.  This is fastest and easiest when |project_name|
 is installed on the remote host, in which case the following syntax is used::
 is installed on the remote host, in which case the following syntax is used::
 
 
-  $ borg init user@hostname:backup
+  $ borg init user@hostname:/mnt/backup
 
 
 or::
 or::
 
 
-  $ borg init ssh://user@hostname:port/backup
+  $ borg init ssh://user@hostname:port//mnt/backup
 
 
-If it is not possible to install |project_name| on the remote host, 
+Remote operations over SSH can be automated with SSH keys. You can restrict the
+use of the SSH keypair by prepending a forced command to the SSH public key in
+the remote server's authorized_keys file. Only the forced command will be run
+when the key authenticates a connection. This example will start attic in server
+mode, and limit the attic server to a specific filesystem path::
+
+  command="attic serve --restrict-to-path /mnt/backup" ssh-rsa AAAAB3[...]
+
+If it is not possible to install |project_name| on the remote host,
 it is still possible to use the remote host to store a repository by
 it is still possible to use the remote host to store a repository by
 mounting the remote filesystem, for example, using sshfs::
 mounting the remote filesystem, for example, using sshfs::
 
 
-  $ sshfs user@hostname:/path/to/folder /mnt
+  $ sshfs user@hostname:/mnt /mnt
   $ borg init /mnt/backup
   $ borg init /mnt/backup
   $ fusermount -u /mnt
   $ fusermount -u /mnt
 
 

+ 1 - 1
docs/update_usage.sh

@@ -2,7 +2,7 @@
 if [ ! -d usage ]; then
 if [ ! -d usage ]; then
   mkdir usage
   mkdir usage
 fi
 fi
-for cmd in change-passphrase check create delete extract info init list mount prune; do
+for cmd in change-passphrase check create delete extract info init list mount prune serve; do
   FILENAME="usage/$cmd.rst.inc"
   FILENAME="usage/$cmd.rst.inc"
   LINE=`echo -n borg $cmd | tr 'a-z- ' '-'`
   LINE=`echo -n borg $cmd | tr 'a-z- ' '-'`
   echo -e ".. _borg_$cmd:\n" > $FILENAME
   echo -e ".. _borg_$cmd:\n" > $FILENAME

+ 12 - 0
docs/usage.rst

@@ -168,3 +168,15 @@ Examples
     Enter same passphrase again: 
     Enter same passphrase again: 
     Key file "/home/USER/.borg/keys/mnt_backup" updated
     Key file "/home/USER/.borg/keys/mnt_backup" updated
 
 
+
+.. include:: usage/serve.rst.inc
+
+Examples
+~~~~~~~~
+::
+
+    # Allow an SSH keypair to only run attic, and only have access to /mnt/backup.
+    # This will help to secure an automated remote backup system.
+    $ cat ~/.ssh/authorized_keys
+    command="attic serve --restrict-to-path /mnt/backup" ssh-rsa AAAAB3[...]
+