Better Git SSH passthru system for Gitea server running in Docker container.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
497B

  1. #!/bin/bash
  2. # Path to home directory of 'git' user on host
  3. GIT_HOME=$HOME
  4. # Path to Gitea 'git' home directory mounted on host
  5. GITEA_HOME=$GIT_HOME/data/git
  6. # Path to 'passthru' script on host
  7. PASSTHRU_SCRIPT=$GIT_HOME/passthru
  8. while read file; do
  9. if [ "$file" == "authorized_keys" ]; then
  10. sed "s#/app/gitea/gitea#$PASSTHRU_SCRIPT#g" $GITEA_HOME/.ssh/authorized_keys >$GIT_HOME/.ssh/authorized_keys
  11. fi
  12. done < <(exec inotifywait -mq -e close_write --format %f $GITEA_HOME/.ssh)