From 73420b3ecf32b537e490661d398aa13858284412 Mon Sep 17 00:00:00 2001 From: Anarkrypto Date: Sat, 4 Sep 2021 00:13:24 -0300 Subject: [PATCH 1/2] Resets authorized_keys on startup Without this functionality, even deleting the keys from the host's "keys" directory, they will not be deleted from the Docker container server, which represents both technical limitations and security flaws. --- start.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/start.sh b/start.sh index 6000392..48d17c0 100644 --- a/start.sh +++ b/start.sh @@ -1,5 +1,8 @@ #!/bin/sh +# Clear authorized_keys file +: > /home/git/.ssh/authorized_keys + # If there is some public key in keys folder # then it copies its contain in authorized_keys file if [ "$(ls -A /git-server/keys/)" ]; then From f3dca8414db8e556b7994a663a36bb1c21225c5b Mon Sep 17 00:00:00 2001 From: Anarkrypto Date: Sat, 4 Sep 2021 00:22:55 -0300 Subject: [PATCH 2/2] Update docker-compose.yml --- docker-compose.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index cded791..2ca2679 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,12 +1,14 @@ -version: '2' +version: '3.7' services: git-server: - image: jkarlos/git-server-docker - #build: . - restart: always + image: anarkrypto/git-server-docker + build: + context: . # Build Dockerfile from current directory + restart: unless-stopped container_name: git-server + image: anarkrypto/git-server-docker ports: - "2222:22" volumes: