···11# pkgs
2233-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.
33+PKGBUILDs for [@tangled.sh](https://tangled.sh/@tangled.sh/core) on [Arch](https://archlinux.org).
4644747-```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-```
+10
conf.sh
···11+knotserver_user=git
22+knotserver_group=git
33+44+# Path knotserver database files will be stored.
55+knotserver_db_path=/var/lib/knotserver
66+77+# Path knotserver hosted git repositories will be stored.
88+knotserver_repo_path=/var/lib/tangled
99+1010+knotserver_log_directory=/var/log/knotserver
···11post_install() {
22- echo
33- echo Remember to set 'KNOT_SERVER_SECRET="..."' in /etc/tangled/knotserver
44- echo and 'KNOT_SERVER_HOSTNAME' if `hostname` does not return the FQDN
55- echo of your knot.
66- echo
77- echo You will need to setup a reverse proxy to http://localhost:5555
88- echo
99- echo To enable git push over ssh for tangled repositories, run:
1010- echo " ln -s /usr/lib/systemd/sshd_config.d/knotserver.conf /etc/ssh/sshd_config.d/30-knotserver.conf"
1111- echo " usermod -s /usr/bin/bash -d /home/git git"
1212- echo
1313- echo and reload sshd
1414- echo
22+ echo
33+ echo knotserver installed, with repositories stored in: /var/lib/tangled
44+ echo
55+ echo Remember to set 'KNOT_SERVER_SECRET="..."' in /etc/tangled/knotserver
66+ echo and 'KNOT_SERVER_HOSTNAME' if 'hostname' does not return the FQDN
77+ echo of your knot.
88+ echo
99+ echo To enable git push over ssh for tangled repositories, run:
1010+ echo " ln -s /usr/lib/systemd/sshd_config.d/knotserver.conf /etc/ssh/sshd_config.d/30-knotserver.conf"
1111+ echo " usermod -s /usr/bin/bash -d /var/lib/tangled git"
1212+ echo
1313+ echo and reload sshd
1414+ echo
1515}