Initial commit

+3
10-tangled.conf
···
···
+
Match User git
+
AuthorizedKeysCommand /usr/libexec/keyfetch -repoguard-path /usr/libexec/repoguard
+
AuthorizedKeysCommandUser nobody
+26
Containerfile
···
···
+
FROM registry.fedoraproject.org/fedora:41 AS build
+
+
RUN dnf install --assumeyes git go && \
+
git clone https://tangled.sh/@tangled.sh/core
+
+
WORKDIR /core
+
ENV CGO_ENABLED=1
+
RUN go build -o knot ./cmd/knotserver && \
+
go build -o keyfetch ./cmd/keyfetch && \
+
go build -o repoguard ./cmd/repoguard
+
+
FROM registry.fedoraproject.org/fedora:41 AS run
+
+
RUN dnf install --assumeyes git openssh-server && \
+
dnf clean all
+
+
COPY --from=build /core/keyfetch /usr/libexec/keyfetch
+
COPY --from=build /core/knot /usr/libexec/knot
+
COPY --from=build /core/repoguard /usr/libexec/repoguard
+
+
COPY ./10-tangled.conf /etc/ssh/sshd_config.d/10-tangled.conf
+
+
RUN useradd -m git
+
+
COPY ./entrypoint.sh /usr/libexec/entrypoint
+
ENTRYPOINT [ "/usr/libexec/entrypoint" ]
+17
entrypoint.sh
···
···
+
#!/usr/bin/env sh
+
+
mkdir --parents /keys
+
+
if [ ! -f /keys/ssh_host_ed25519_key ]
+
then
+
ssh-keygen -t ed25519 -f /keys/ssh_host_ed25519_key -N ""
+
fi
+
+
chmod 600 /keys/ssh_host_ed25519_key
+
chmod 644 /keys/ssh_host_ed25519_key.pub
+
chown root:root /keys/ssh_host_ed25519_key /keys/ssh_host_ed25519_key.pub
+
+
/usr/sbin/sshd -D -h /keys/ssh_host_ed25519_key &
+
+
chown git:git /home/git
+
exec sudo -u git -E /usr/bin/sh -c "cd /home/git && /usr/libexec/knot \"$@\""