64707c920e8a5b2de7626e3cc394d4615fdd91e6

Author
Ayman Bagabas <ayman.bagabas@gmail.com>
Committer
Ayman Bagabas <ayman.bagabas@gmail.com>
Date

Message

docs: add ssh config note and fix admin keys env variable

Diff

This diff is truncated to protect this page.

  1diff --git a/Dockerfile b/Dockerfile
  2index ec3a5f728be3b36013570ff5e0243fadaa5a9a8a..b82dd514877b2b24b9f3614618db6bf6794c0db4 100644
  3--- a/Dockerfile
  4+++ b/Dockerfile
  5@@ -11,7 +11,7 @@ VOLUME /soft-serve
  6 
  7 # Environment variables
  8 ENV SOFT_SERVE_DATA_PATH "/soft-serve"
  9-ENV SOFT_SERVE_INITIAL_ADMIN_KEY ""
 10+ENV SOFT_SERVE_INITIAL_ADMIN_KEYS ""
 11 
 12 # Expose ports
 13 # SSH
 14diff --git a/README.md b/README.md
 15index c2179ba41926f951224e3e8efe7e79da303c1b42..d2bb3df495dc6849863e99f4ecffd4b37599599e 100644
 16--- a/README.md
 17+++ b/README.md
 18@@ -88,6 +88,10 @@ Or just install it with `go`:
 19 go install github.com/charmbracelet/soft-serve/cmd/soft@latest
 20 ```
 21 
 22+A [Docker image][docker] is also available.
 23+
 24+[docker]: https://github.com/charmbracelet/soft-serve/blob/main/docker.md
 25+
 26 ## Setting up a server
 27 
 28 Make sure `git` is installed, then run `soft serve`. That’s it.
 29@@ -102,7 +106,7 @@ SOFT_SERVE_DATA_PATH=/var/lib/soft-serve soft serve
 30 ```
 31 
 32 When you run Soft Serve for the first time, make sure you have the
 33-`SOFT_SERVE_INITIAL_ADMIN_KEY` environment variable is set to your ssh
 34+`SOFT_SERVE_INITIAL_ADMIN_KEYS` environment variable is set to your ssh
 35 authorized key. Any added key to this variable will be treated as admin with
 36 full privileges.
 37 
 38@@ -202,18 +206,37 @@ name all in uppercase. Here are some examples:
 39 - `SOFT_SERVE_HTTP_PUBLIC_URL`: HTTP public URL used for cloning
 40 - `SOFT_SERVE_GIT_MAX_CONNECTIONS`: The number of simultaneous connections to git daemon
 41 
 42-A [Docker image][docker] is also available.
 43-
 44-[docker]: https://github.com/charmbracelet/soft-serve/blob/main/docker.md
 45-
 46 ## Configuration
 47 
 48 Configuring Soft Serve is simple and straightforward. Use the SSH command-line
 49 interface to manage access settings, users, and repos.
 50 
 51-For more info try `ssh localhost -i ~/.ssh/id_ed25519 -p 23231 help`. Make sure
 52+Try `ssh localhost -i ~/.ssh/id_ed25519 -p 23231 help` for more info. Make sure
 53 you use your key here.
 54 
 55+For ease of use, instead of specifying the key, port, and hostname every time
 56+you SSH into Soft Serve, add your own Soft Serve instance entry to your SSH
 57+config. For instance, to use `ssh soft` instead of typing `ssh localhost -i
 58+~/.ssh/id_ed25519 -p 23231`, we can define a `soft` entry in our SSH config
 59+file `~/.ssh/config`.
 60+
 61+```conf
 62+Host soft
 63+  HostName localhost
 64+  Port 23231
 65+  IdentityFile ~/.ssh/id_ed25519
 66+```
 67+
 68+Now, we can do `ssh soft` to SSH into Soft Serve. Since `git` is also aware of
 69+this config, you can use `soft` as the hostname for your clone commands.
 70+
 71+```sh
 72+git clone ssh://soft/dotfiles
 73+# make changes
 74+# add & commit
 75+git push origin main
 76+```
 77+
 78 > **Note** The `-i` part will be omitted in the examples below for brevity. You
 79 > can add your server settings to your sshconfig for quicker access.
 80 
 81@@ -232,7 +255,8 @@ no-access, read-only, read-write, and admin-access.
 82 
 83 ### Authentication
 84 
 85-Everything that needs authentication is done using SSH.
 86+Everything that needs authentication is done using SSH. Make sure you have
 87+added an entry for your Soft Serve instance in your `~/.ssh/config` file.
 88 
 89 By default, Soft Serve gives ready-only permission to anonymous connections to
 90 any of the above protocols. This is controlled by two settings `anon-access`
 91@@ -246,7 +270,7 @@ and `allow-keyless`.
 92   HTTP, and Git protocol connections. Default is `true`.
 93 
 94 ```sh
 95-$ ssh localhost settings
 96+$ ssh -p 23231 localhost settings
 97 Manage server settings
 98 
 99 Usage:
100@@ -273,10 +297,14 @@ use SSH Public Key authentication but are not registered users. The default
101 setting for this is `read-only`. This will grant anonymous connections that use
102 SSH Public Key authentication `read-only` access to public repos.
103 
104+`anon-access` is also used in combination with `allow-keyless` to determine the
105+access level for HTTP(s) and git:// clone requests.
106+
107 ## Authorization
108 
109-Admins can manage users and manage their keys. Once a user is created and has
110-access to the server, they can manage their own keys and settings.
111+Admins can manage users and their keys using the `user` command. Once a user is
112+created and has access to the server, they can manage their own keys and
113+settings.
114 
115 To create a new user simply use `user create`:
116 
117@@ -295,10 +323,10 @@ ssh -p 23231 localhost user create frankie '-k "ssh-ed25519 AAAATzN..."'