My container images for Tangled self-hostable services
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: init repo

Hayden Young bd040011

+102
+6
Justfile
··· 1 + build target *args: 2 + docker buildx bake \ 3 + --allow 'fs.read={{ justfile_directory() / "knot" }}' \ 4 + --file "{{ justfile_directory() / "bake.hcl" }}" \ 5 + {{ target }} \ 6 + {{ args }}
+21
bake.hcl
··· 1 + variable "COMMIT" { 2 + value = "442e2ab1" 3 + } 4 + 5 + target "base" { 6 + contexts = { 7 + tangled = "https://tangled.org/tangled.org/core.git#${COMMIT}" 8 + } 9 + } 10 + 11 + target "knot" { 12 + inherits = ["base"] 13 + dockerfile = "./knot/Dockerfile" 14 + tags = ["atcr.io/hayden.moe/tngl-knot"] 15 + } 16 + 17 + # target "spindle" { 18 + # inherits = ["base"] 19 + # dockerfile = "./spindle/Dockerfile" 20 + # tags = ["atcr.io/hayden.moe/tngl-spindle"] 21 + # }
+30
knot/Dockerfile
··· 1 + FROM golang:1.24.4 AS build 2 + 3 + WORKDIR /src 4 + COPY --from=tangled . . 5 + ENV CGO_ENABLED=1 6 + RUN go build -o knot ./cmd/knot 7 + 8 + FROM rockylinux/rockylinux:10-ubi AS run 9 + 10 + RUN dnf update -y && \ 11 + dnf install -y openssh-server && \ 12 + dnf clean all && \ 13 + rm -rf /var/cache/dnf 14 + COPY --from=build --chown=root:root /src/knot /usr/local/bin/knot 15 + 16 + RUN adduser git --shell=/bin/false 17 + USER git 18 + 19 + WORKDIR /home/git 20 + VOLUME [ "/data" ] 21 + 22 + ENV KNOT_REPO_SCAN_PATH=/data/repos 23 + ENV KNOT_SERVER_DB_PATH=/data/knotserver.db 24 + ENV KNOT_SERVER_INTERNAL_LISTEN_ADDR=127.0.0.1:5444 25 + ENV KNOT_SERVER_LISTEN_ADDR=0.0.0.0:5555 26 + 27 + COPY --chmod=0755 knot/entrypoint.sh /usr/local/bin/entrypoint.sh 28 + COPY --chmod=0644 knot/sshd_config /etc/ssh/sshd_config.tpl 29 + 30 + CMD ["/usr/local/bin/entrypoint.sh"]
+31
knot/entrypoint.sh
··· 1 + #!/usr/bin/env bash 2 + set -euo pipefail 3 + 4 + data_root="$(dirname ${KNOT_REPO_SCAN_PATH:-/data/repos})" 5 + ssh_root="${data_root}/ssh" 6 + repos_root="${KNOT_REPO_SCAN_PATH:-$data_root/repos}" 7 + 8 + mkdir -p "$ssh_root" 9 + mkdir -p "$repos_root" 10 + 11 + if [[ ! -f "$ssh_root/ssh_host_rsa_key" ]]; then 12 + ssh-keygen -t rsa -f "$ssh_root/ssh_host_rsa_key" -N '' 13 + fi 14 + 15 + if [[ ! -f "$ssh_root/ssh_host_ecdsa_key" ]]; then 16 + ssh-keygen -t ecdsa -f "$ssh_root/ssh_host_ecdsa_key" -N '' 17 + fi 18 + 19 + if [[ ! -f "$ssh_root/ssh_host_ed25519_key" ]]; then 20 + ssh-keygen -t ed25519 -f "$ssh_root/ssh_host_ed25519_key" -N '' 21 + fi 22 + 23 + cat /etc/ssh/sshd_config.tpl \ 24 + | sed "s|__ssh_root__|${ssh_root}|g" \ 25 + > $ssh_root/sshd_config 26 + 27 + /usr/sbin/sshd -f "$ssh_root/sshd_config" -D & 28 + sshd_pid=$! 29 + trap "kill $sshd_pid" EXIT 30 + 31 + /usr/local/bin/knot server
+12
knot/sshd_config
··· 1 + Port 2222 2 + 3 + HostKey __ssh_root__/ssh_host_rsa_key 4 + HostKey __ssh_root__/ssh_host_ecdsa_key 5 + HostKey __ssh_root__/ssh_host_ed25519_key 6 + 7 + PasswordAuthentication no 8 + 9 + AllowUsers git@* 10 + Match User git 11 + AuthorizedKeysCommand /usr/local/bin/knot keys -o authorized_keys 12 + AuthorizedKeysCommandUser git
+2
mise.toml
··· 1 + [tools] 2 + just = "1.43.1"