···11+# pkgs
22+33+PKGBUILD for my [@tangled.sh](https://tangled.sh/@tangled.sh/core) knotserver setup on [Arch Linux](https://archlinux.org) (because I just can't get my head around nix).
44+55+## Install
66+77+```bash
88+makepkg -D knotserver --install
99+```
1010+1111+Yay!
1212+1313+## Additional steps ...
1414+1515+### Secrets
1616+Obtain a server secret from [/knots](https://tangled.sh/knots), and set `KNOT_SERVER_SECRET` in `/etc/tangled/knotserver`.
1717+1818+```bash
1919+echo 'KNOT_SERVER_SECRET="..."' > /etc/tangled/knotserver
2020+```
2121+2222+### Hostname
2323+2424+Either set `/etc/hostname` to the host's FQDN, or override `KNOT_SERVER_HOSTNAME` in `knotserver.service`
2525+2626+```bash
2727+systemctl edit knotserver.service <<EOF
2828+[Service]
2929+Environment="KNOT_SERVER_HOSTNAME=..."
3030+EOF
3131+````
3232+3333+### Reverse Proxy
3434+3535+Setup a reverse-proxy to forward `https` requests to `http://localhost:5555`, with a valid SSL certificate.
3636+3737+## Running
3838+3939+```bash
4040+systemctl enable --now knotserver.service
4141+```
4242+4343+## SSH
4444+4545+To permit `git` pushes over SSH, enable the `sshd_config.d` drop-in, and modify the `git` user created by the [extra/git](https://archlinux.org/packages/extra/x86_64/git/) package.
4646+4747+```bash
4848+ln -s /usr/lib/systemd/sshd_config.d/knotserver.conf /etc/ssh/sshd_config.d/30-knotserver.conf
4949+usermod -s /usr/bin/bash -d /var/lib/tangled git
5050+```