changes for ssh passthough
This commit is contained in:
parent
6ef41656dd
commit
6dafbf8f91
@ -11,13 +11,15 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
- USER_UID=895
|
- USER_UID=895
|
||||||
- USER_GID=895
|
- USER_GID=895
|
||||||
|
- GITEA__server__ROOT_URL=https://blacka.com/git
|
||||||
restart: always
|
restart: always
|
||||||
networks:
|
networks:
|
||||||
- gitea
|
- gitea
|
||||||
volumes:
|
volumes:
|
||||||
- ./data:/data
|
- ./data:/data
|
||||||
|
- /var/lib/gitea/.ssh:/data/git/.ssh
|
||||||
- /etc/timezone:/etc/timezone:ro
|
- /etc/timezone:/etc/timezone:ro
|
||||||
- /etc/localtime:/etc/localtime:ro
|
- /etc/localtime:/etc/localtime:ro
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "3000:3000"
|
||||||
- "222:22"
|
- "2222:22"
|
||||||
|
7
httpd.conf.snippet
Normal file
7
httpd.conf.snippet
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<Proxy *>
|
||||||
|
Order allow,deny
|
||||||
|
Allow from all
|
||||||
|
</Proxy>
|
||||||
|
AllowEncodedSlashes NoDecode
|
||||||
|
# Note: no trailing slash after either /git or port
|
||||||
|
ProxyPass /git http://localhost:3000 nocanon
|
12
setup.sh
12
setup.sh
@ -1,11 +1,19 @@
|
|||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
|
|
||||||
GITEA_HOME=/var/lib/gitea
|
GITEA_HOME=/var/lib/gitea
|
||||||
|
HOST_GIT_USER=git # this will be the user in the ssh git urls, e.g. git@blacka.com/org/repo.git
|
||||||
|
|
||||||
# create the 'gitea' user to run and own this thing
|
# create the 'gitea' user to run and own this thing
|
||||||
if ! id -u 985 >/dev/null 2>&1; then
|
if ! id -u 985 >/dev/null 2>&1; then
|
||||||
groupadd -g 895 gitea
|
groupadd -g 895 "$HOST_GIT_USER"
|
||||||
useradd -u 895 -g gitea -d "$GITEA_HOME" -m gitea
|
useradd -u 895 -g "$HOST_GIT_USER" -G docker -d "$GITEA_HOME" -m gitea
|
||||||
fi
|
fi
|
||||||
|
|
||||||
install -d "$GITEA_HOME/data"
|
install -d "$GITEA_HOME/data"
|
||||||
|
|
||||||
|
cat <<"EOF" | sudo tee $GITEA_HOME/docker-shell
|
||||||
|
#!/bin/sh
|
||||||
|
/usr/bin/docker exec -i -u git --env SSH_ORIGINAL_COMMAND="$SSH_ORIGINAL_COMMAND" gitea sh "$@"
|
||||||
|
EOF
|
||||||
|
sudo chmod +x $GITEA_HOME/docker-shell
|
||||||
|
sudo usermod -s $GITEA_HOME/docker-shell git
|
||||||
|
Loading…
Reference in New Issue
Block a user