···11# pkgs
2233-PKGBUILDs for [@tangled.sh](https://tangled.sh/@tangled.sh/core) on [Arch](https://archlinux.org).
33+PKGBUILDs for running [@tangled.sh](https://tangled.sh/@tangled.sh/core) on [Arch](https://archlinux.org).
44+55+> [!NOTE]
66+> I use these packages to deploy to my knot server.
77+>
88+> These are **not** official tangled packages. **DO NOT** direct issues using these packages to the core tangled.sh repository.
99+1010+## Packages:
1111+1212+### [appview](appview)
1313+1414+Builds `appview` from tag [v1.3.0-alpha](https://tangled.sh/@tangled.sh/core/tree/v1.3.0-alpha).
1515+1616+### [knotserver](knotserver)
1717+1818+Builds `knotserver`, `keyfetch`, and `repoguard` from tag [v1.3.0-alpha](https://tangled.sh/@tangled.sh/core/tree/v1.3.0-alpha).
1919+2020+### [knotserver-git](knotserver-git)
2121+2222+Builds `knotserver`, `keyfetch`, and `repoguard` from branch [master](https://tangled.sh/@tangled.sh/core/tree/master).
423
+3-7
conf.sh
···11+tag=1.3.0-alpha
12knotserver_user=git
23knotserver_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-44+knotserver_path=/var/lib/tangled
55+knotserver_repo_path=/var/lib/tangled/repositories
106knotserver_log_directory=/var/log/knotserver
···11+# knotserver
22+33+Builds and packages `knotserver`, `keyfetch`, and `repoguard`.
44+55+When installed, knotserver's database files will be stored in `/var/lib/tangled`. Repositories will
66+be stored in `/var/lib/tangled/repositories`.
77+88+## SSH
99+1010+SSH access is required to push to repositories. To enable, use the sshd_config.d drop-in, and give the
1111+`git` user a shell and a home directory:
1212+1313+```bash
1414+ln -s /usr/lib/systemd/sshd_config.d/knotserver.conf /etc/ssh/sshd_config.d/30-knotserver.conf
1515+usermod -s /usr/bin/bash -d /var/lib/tangled/repositories git
1616+```
1717+
···11+#!/usr/bin/bash
22+cat << EOF > ${pkgbuild_path}/README.md
33+# pkgs
44+55+PKGBUILDs for running [@tangled.sh](https://tangled.sh/@tangled.sh/core) on [Arch](https://archlinux.org).
66+77+> [!NOTE]
88+> I use these packages to deploy to my knot server.
99+>
1010+> These are **not** official tangled packages. **DO NOT** direct issues using these packages to the core tangled.sh repository.
1111+1212+## Packages:
1313+1414+### [appview](appview)
1515+1616+Builds \`appview\` from tag [v${tag}](https://tangled.sh/@tangled.sh/core/tree/v${tag}).
1717+1818+### [knotserver](knotserver)
1919+2020+Builds \`knotserver\`, \`keyfetch\`, and \`repoguard\` from tag [v${tag}](https://tangled.sh/@tangled.sh/core/tree/v${tag}).
2121+2222+### [knotserver-git](knotserver-git)
2323+2424+Builds \`knotserver\`, \`keyfetch\`, and \`repoguard\` from branch [master](https://tangled.sh/@tangled.sh/core/tree/master).
2525+2626+EOF
+3-3
src/common/install.sh
···22cat << EOF > ${pkgbuild_path}/knotserver.install
33post_install() {
44 echo
55- echo knotserver installed, with repositories stored in: $knotserver_repo_path
55+ echo knotserver installed, with repositories stored in: ${knotserver_repo_path:-/var/lib/tangled/repositories}
66 echo
77- echo Remember to set 'KNOT_SERVER_SECRET="..."' in /etc/tangled/knotserver
77+ echo Set 'KNOT_SERVER_SECRET="..."' in /etc/tangled/knotserver
88 echo and 'KNOT_SERVER_HOSTNAME' if 'hostname' does not return the FQDN
99 echo of your knot.
1010 echo
1111 echo To enable git push over ssh for tangled repositories, run:
1212 echo " ln -s /usr/lib/systemd/sshd_config.d/knotserver.conf /etc/ssh/sshd_config.d/30-knotserver.conf"
1313- echo " usermod -s /usr/bin/bash -d $knotserver_repo_path $knotserver_user"
1313+ echo " usermod -s /usr/bin/bash -d ${knotserver_repo_path:-/var/lib/tangled/repositories} ${knotserver_user:-git}"
1414 echo
1515 echo and reload sshd
1616 echo
···11+#!/usr/bin/bash
22+cat << EOF > ${pkgbuild_path}/README.md
33+# knotserver
44+55+Builds and packages \`knotserver\`, \`keyfetch\`, and \`repoguard\`.
66+77+When installed, knotserver's database files will be stored in \`${knotserver_path}\`. Repositories will
88+be stored in \`${knotserver_repo_path}\`.
99+1010+## SSH
1111+1212+SSH access is required to push to repositories. To enable, use the sshd_config.d drop-in, and give the
1313+\`${knotserver_user:-git}\` user a shell and a home directory:
1414+1515+\`\`\`bash
1616+ln -s /usr/lib/systemd/sshd_config.d/knotserver.conf /etc/ssh/sshd_config.d/30-knotserver.conf
1717+usermod -s /usr/bin/bash -d ${knotserver_repo_path} ${knotserver_user:-git}
1818+\`\`\`
1919+2020+EOF
+6
update.sh
···2233source ./conf.sh
4455+pkgbuild_path="."
66+source src/README.md.sh
77+58for pkgbuild_path in knotserver knotserver-git; do
69 source src/common/sshd.conf.sh
710 source src/common/tmpfiles.conf.sh
811 source src/common/service.sh
912 source src/common/install.sh
1313+ for src in src/${pkgbuild_path}/*.sh; do
1414+ source ${src}
1515+ done
10161117 cd $pkgbuild_path
1218 updpkgsums