Arch PKGBUILDs for https://tangled.org/@tangled.org/core
arch pkgbuild

arch pkgbuild for tangled.sh knotserver

tjh.dev 9c4c3ba1

+4
.gitignore
···
··· 1 + core 2 + src 3 + pkg 4 + *.zst
+21
knotserver/.SRCINFO
···
··· 1 + pkgbase = knotserver-git 2 + pkgdesc = git collaboration platform built on ATproto 3 + pkgver = 1.0.6.alpha.r22.gc91caee 4 + pkgrel = 1 5 + url = https://tangled.sh/@tangled.sh/core 6 + install = knotserver.install 7 + arch = x86_64 8 + license = MIT 9 + makedepends = go 10 + depends = git 11 + options = strip 12 + source = core::git+https://tangled.sh/@tangled.sh/core 13 + source = knotserver.service 14 + source = knotserver-sshd.conf 15 + source = knotserver-tmpfiles.conf 16 + sha256sums = SKIP 17 + sha256sums = 23029fea7d15f2cb50e62500dd4fe22b67cd08bdc2d37adc58b757aed9dadea4 18 + sha256sums = 390f95baa6d14da5cdff94b681fdb03e94fbd838b2d6cc0146ac84ade4dad9d5 19 + sha256sums = dfded1e9026fe755c77185cc2c17d0381c3e6e446d317695497d4f71f7eff08e 20 + 21 + pkgname = knotserver-git
+51
knotserver/PKGBUILD
···
··· 1 + _pkgname=knotserver 2 + pkgname=${_pkgname}-git 3 + pkgdesc='git collaboration platform built on ATproto' 4 + pkgver=1.0.6.alpha.r22.gc91caee 5 + pkgrel=1 6 + license=(MIT) 7 + arch=(x86_64) 8 + url=https://tangled.sh/@tangled.sh/core 9 + depends=(git) 10 + makedepends=(go) 11 + options=(strip) 12 + install=${_pkgname}.install 13 + source=("core::git+$url" 14 + ${_pkgname}.service 15 + ${_pkgname}-sshd.conf 16 + ${_pkgname}-tmpfiles.conf) 17 + sha256sums=('SKIP' 18 + '23029fea7d15f2cb50e62500dd4fe22b67cd08bdc2d37adc58b757aed9dadea4' 19 + '390f95baa6d14da5cdff94b681fdb03e94fbd838b2d6cc0146ac84ade4dad9d5' 20 + 'dfded1e9026fe755c77185cc2c17d0381c3e6e446d317695497d4f71f7eff08e') 21 + 22 + pkgver() { 23 + cd ${srcdir}/core 24 + git describe --long --tags --abbrev=7 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' 25 + } 26 + 27 + build() { 28 + mkdir -p ${srcdir}/build 29 + 30 + export CGO_ENABLED=1 31 + export CGO_CPPFLAGS="${CPPFLAGS}" 32 + export CGO_CFLAGS="${CFLAGS}" 33 + export CGO_CXXFLAGS="${CXXFLAGS}" 34 + export CGO_LDFLAGS="${LDFLAGS}" 35 + export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw" 36 + 37 + cd ${srcdir}/core 38 + go build -o "${srcdir}/build/knotserver" ./cmd/knotserver 39 + go build -o "${srcdir}/build/repoguard" ./cmd/repoguard 40 + go build -o "${srcdir}/build/keyfetch" ./cmd/keyfetch 41 + } 42 + 43 + package() { 44 + install -Dm644 "${srcdir}/${_pkgname}.service" "${pkgdir}/usr/lib/systemd/system/${_pkgname}.service" 45 + install -Dm644 "${srcdir}/${_pkgname}-tmpfiles.conf" "${pkgdir}/usr/lib/tmpfiles.d/${_pkgname}.conf" 46 + install -Dm644 "${srcdir}/${_pkgname}-sshd.conf" "${pkgdir}/usr/lib/systemd/sshd_config.d/${_pkgname}.conf" 47 + install -Dm755 "${srcdir}/build/knotserver" "${pkgdir}/usr/bin/knotserver" 48 + install -Dm755 "${srcdir}/build/repoguard" "${pkgdir}/usr/bin/repoguard" 49 + install -Dm755 "${srcdir}/build/keyfetch" "${pkgdir}/usr/bin/keyfetch" 50 + install -Dm644 "${srcdir}/core/license" "${pkgdir}/usr/share/licenses/knotserver/LICENSE" 51 + }
+3
knotserver/knotserver-sshd.conf
···
··· 1 + Match User git 2 + AuthorizedKeysCommand /usr/bin/keyfetch -repoguard-path /usr/bin/repoguard -git-dir /var/lib/tangled/repositories -log-path /var/log/tangled/keyfetch.log 3 + AuthorizedKeysCommandUser nobody
+2
knotserver/knotserver-tmpfiles.conf
···
··· 1 + d /var/lib/tangled 755 git git - 2 + d /var/lib/tangled/repositories 755 git git -
+15
knotserver/knotserver.install
···
··· 1 + post_install() { 2 + echo 3 + echo Remember to set 'KNOT_SERVER_SECRET="..."' in /etc/tangled/knotserver 4 + echo and 'KNOT_SERVER_HOSTNAME' if `hostname` does not return the FQDN 5 + echo of your knot. 6 + echo 7 + echo You will need to setup a reverse proxy to http://localhost:5555 8 + echo 9 + echo To enable git push over ssh for tangled repositories, run: 10 + echo " ln -s /usr/lib/systemd/sshd_config.d/knotserver.conf /etc/ssh/sshd_config.d/30-knotserver.conf" 11 + echo " usermod -s /usr/bin/bash -d /var/lib/tangled git" 12 + echo 13 + echo and reload sshd 14 + echo 15 + }
+28
knotserver/knotserver.service
···
··· 1 + [Unit] 2 + Description=tangled knot server 3 + After=network.target network-online.target 4 + Wants=network-online.target 5 + AssertPathExists=/var/lib/tangled 6 + 7 + [Service] 8 + Environment="KNOT_SERVER_HOSTNAME=%H" 9 + Environment="KNOT_SERVER_LISTEN_ADDR=[::1]:5555" 10 + Environment="KNOT_SERVER_INTERNAL_LISTEN_ADDR=[::1]:5444" 11 + Environment="KNOT_REPO_SCAN_PATH=/var/lib/tangled/repositories" 12 + EnvironmentFile=-/etc/tangled/knotserver 13 + 14 + WorkingDirectory=/var/lib/tangled 15 + ExecStart=/usr/bin/knotserver 16 + Restart=always 17 + User=git 18 + Group=git 19 + 20 + StandardOutput=journal 21 + StandardError=journal 22 + LimitNOFILE=65536 23 + 24 + # Create /var/log/tangled for the repoguard log. 25 + LogsDirectory=tangled 26 + 27 + [Install] 28 + WantedBy=multi-user.target