docker: fix config #198

closed
opened by knotbin.com targeting master from [deleted fork]: fix-docker

(i be traumatized) fixes knotguard options, along with some more config improvements and fixes in docker compose and dockerfile

Changed files
+3 -2
docker
rootfs
etc
ssh
sshd_config.d
+2 -1
docker/Dockerfile
···
FROM docker.io/golang:1.24-alpine3.21 AS build
ENV CGO_ENABLED=1
+
ENV KNOT_REPO_SCAN_PATH=/home/git/repositories
WORKDIR /usr/src/app
COPY go.mod go.sum ./
···
EXPOSE 22
EXPOSE 5555
-
ENTRYPOINT ["/bin/sh", "-c", "chown git:git /app && chown git:git /home/git/repositories && /init"]
+
ENTRYPOINT ["/bin/sh", "-c", "chown git:git /app && chown -R git:git \"$KNOT_REPO_SCAN_PATH\" && /init"]
+1 -1
docker/rootfs/etc/ssh/sshd_config.d/tangled_sshd.conf
···
PasswordAuthentication no
Match User git
-
AuthorizedKeysCommand /usr/local/bin/knot keys -o authorized-keys
+
AuthorizedKeysCommand /usr/local/bin/knot keys -output authorized-keys -internal-api http://$(echo ${KNOT_SERVER_INTERNAL_LISTEN_ADDR:-localhost:5444}) -git-dir ${KNOT_REPO_SCAN_PATH:-/home/git/repositories} -log-path /tmp/knotguard.log
AuthorizedKeysCommandUser nobody