From d6eed49b7168c243e58ff8d50fd49b28057d1378 Mon Sep 17 00:00:00 2001 From: Anirudh Oppiliappan Date: Sun, 1 Jun 2025 13:41:21 +0300 Subject: [PATCH] docs/knot-hosting.md: update to reflect latest knot cli change Change-Id: qkkmntrmxqlyrwyqrtklsuusqoyvossq Signed-off-by: Anirudh Oppiliappan --- docs/knot-hosting.md | 78 +++++++++++++++++--------------------------- 1 file changed, 30 insertions(+), 48 deletions(-) diff --git a/docs/knot-hosting.md b/docs/knot-hosting.md index c5ba1dd..5b88eba 100644 --- a/docs/knot-hosting.md +++ b/docs/knot-hosting.md @@ -34,56 +34,53 @@ First, clone this repository: git clone https://tangled.sh/@tangled.sh/core ``` -Then, build our binaries (you need to have Go installed): -* `knotserver`: the main server program -* `keyfetch`: utility to fetch ssh pubkeys -* `repoguard`: enforces repository access control +Then, build the `knot` CLI. This is the knot administration and operation tool. +For the purpose of this guide, we're only concerned with these subcommands: + +* `knot server`: the main knot server process, typically run as a +supervised service +* `knot guard`: handles role-based access control for git over SSH +(you'll never have to run this yourself) +* `knot keys`: fetches SSH keys associated with your knot; we'll use +this to generate the SSH `AuthorizedKeysCommand` ``` cd core export CGO_ENABLED=1 -go build -o knot ./cmd/knotserver -go build -o keyfetch ./cmd/keyfetch -go build -o repoguard ./cmd/repoguard +go build -o knot ./cmd/knot ``` -Next, move the `keyfetch` binary to a location owned by `root` -- -`/usr/local/libexec/tangled-keyfetch` is a good choice: +Next, move the `knot` binary to a location owned by `root` -- +`/usr/local/bin/knot` is a good choice: ``` -sudo mv keyfetch /usr/local/libexec/tangled-keyfetch -sudo chown root:root /usr/local/libexec/tangled-keyfetch -sudo chmod 755 /usr/local/libexec/tangled-keyfetch +sudo mv knot /usr/local/bin/knot ``` -This is necessary because SSH `AuthorizedKeysCommand` requires [really specific -permissions](https://stackoverflow.com/a/27638306). Let's set that up: +This is necessary because SSH `AuthorizedKeysCommand` requires [really +specific permissions](https://stackoverflow.com/a/27638306). The +`AuthorizedKeysCommand` specifies a command that is run by `sshd` to +retrieve a user's public SSH keys dynamically for authentication. Let's +set that up. ``` sudo tee /etc/ssh/sshd_config.d/authorized_keys_command.conf <