this string has no description
tangled-knot-nogit.md edited
43 lines 1.5 kB view raw view code

To get tangled.org's knot server/knotserver working without using the git user on a host, i.e because it's already taken by another piece of software (think forgejo), we have to do some additional steps in addition to their configuration guide.

First off, when it tells you to create a new user, replace git with another user like tangled in the useradd command. I.e:

# useradd tangled

Then, when you're told to add a bit of configuration to your SSH Daemon Config, be sure to use something like this:

sudo tee /etc/ssh/sshd_config.d/authorized_keys_command.conf <<EOF
Match User tangled
  AuthorizedKeysCommand /usr/local/bin/knot keys -o authorized-keys -git-dir /home/tangled -log-dir /home/tangled/log
  AuthorizedKeysCommandUser nobody
EOF

Of course, making sure that /home/tangled and User tangled is replaced by your username of choice.

Then, reload sshd as per usual. On systemd-powered systems this is done via sudo systemctl reload sshd or sudo systemctl reload ssh depending on what the service is named.

Then, in your $HOME/.knot.env (with $HOME being from your preferred username), be sure to set KNOT_REPO_SCAN_PATH=/home/git accordingly.

From there, also edit the systemd service to use your preferred user, i.e just replace User=git and any mention of /home/git.

This should give you a working knotserver without using the git user.

NOTES#

Do note that you must use tangled@knot.example.com... or whatever your username is to push/pull.