diff options
| author | Mitchell Riedstra <mitch@riedstra.dev> | 2022-12-28 23:52:07 -0500 |
|---|---|---|
| committer | Mitchell Riedstra <mitch@riedstra.dev> | 2022-12-28 23:52:07 -0500 |
| commit | c5017fb5f5d5ff3d438f6a07403ac0590554a8db (patch) | |
| tree | d85d027ea1f5f273aece22868fc437e541b99be7 | |
| parent | df50ddfe09ef3176972998e6aca3482da5f22427 (diff) | |
| download | alpine-cgit-c5017fb5f5d5ff3d438f6a07403ac0590554a8db.tar.gz alpine-cgit-c5017fb5f5d5ff3d438f6a07403ac0590554a8db.tar.xz | |
Update to the latest Alpine Linux. Few tweaks to scripts and entrypoint.
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | Dockerfile | 2 | ||||
| -rwxr-xr-x | entrypoint.sh | 3 | ||||
| -rwxr-xr-x | home/install_keys.sh | 17 | ||||
| -rwxr-xr-x | home/list.sh | 3 | ||||
| -rwxr-xr-x | home/update.sh | 2 |
6 files changed, 23 insertions, 5 deletions
@@ -1,2 +1,3 @@ hostkeys homedir +docker-compose.yml @@ -1,4 +1,4 @@ -FROM docker.io/alpine:3.14 +FROM docker.io/alpine:3.17 COPY repositories /etc/apk/ diff --git a/entrypoint.sh b/entrypoint.sh index bf09d91..bc46d2b 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -134,7 +134,8 @@ run_sshd() { fi cat > /etc/ssh/sshd_config <<SSH_CONFIG -Port $SSHD_PORT +ListenAddress 0.0.0.0:$SSHD_PORT +ListenAddress [::]:$SSHD_PORT ChallengeResponseAuthentication no PasswordAuthentication no AuthorizedKeysFile /etc/ssh/keys/%u .ssh/authorized_keys diff --git a/home/install_keys.sh b/home/install_keys.sh new file mode 100755 index 0000000..b722038 --- /dev/null +++ b/home/install_keys.sh @@ -0,0 +1,17 @@ +#!/bin/sh +# Useful for generating git-only authorized keys. +# If say you don't want to enable shell access for all of your git users. +# Note, that this doesn't prevent people from deleting branches, force +# pushing and such. +boiler='no-port-forwarding,no-agent-forwarding,command="git-shell -c \"$SSH_ORIGINAL_COMMAND\""' + +if [ -z "$1" ] ; then + echo "You need to supply an argument which contains a set of authorized_keys files" + exit 1; +fi + +IFS=" +" +for key in $(cat "$@" | sed -e'/^#/d' ) ; do + printf "%s %s\n" "$boiler" "$key" +done diff --git a/home/list.sh b/home/list.sh index b3b8bd9..592a4a3 100755 --- a/home/list.sh +++ b/home/list.sh @@ -1,10 +1,9 @@ #!/bin/sh #shellcheck disable=SC2038 -find . -type f -name HEAD \ +find * -type f -name HEAD \ | xargs -n1 dirname \ | while read -r repo ; do if ! [ "$(basename "$repo")" = ".git" ] ; then echo "$repo"; fi done - diff --git a/home/update.sh b/home/update.sh index a51490f..a484fcc 100755 --- a/home/update.sh +++ b/home/update.sh @@ -6,6 +6,6 @@ set -x $HOME/list.sh \ | while read -r repo ; do cd "$repo" - git repack + git update-server-info cd - done |
