Sign inSign up

celforyon/gitlab-shell-proxy

By celforyon

Updated almost 8 years ago

Gitlab Shell proxy

Image
1

3.1K

celforyon/gitlab-shell-proxy repository overview

Gitlab Shell Proxy

If you are using Gitlab inside a container, you can use this container to help you setting up a proxy for Gitlab shell (allowing git fetch, git push, ... commands).

Setup

Steps:

  • have a running instance of Gitlab inside a docker
  • create an user (typically git) in the host
  • generate a SSH key for this user
  • add it in the Gitlab shell authorized_keys
  • run the gitlab-shell-proxy container
Create user
useradd -md /home/git git
Generate SSH key
su git -c 'ssh-keygen -t rsa -b 4096'
Add it in the Gitlab shell authorized_keys
sed -i -e '1i # gitlab-shell-proxy' -e "1i $(cat ~git/.ssh/id_rsa.pub)" gitlab/authorized_keys
Run the gitlab-shell-proxy container

See Container section for docker-compose.yml examples and available configuration

Container

example of docker-compose.yml
version: '2'
services:
  gitlab-shell-proxy:
    container_name: gitlab-shell-proxy
    image: celforyon/gitlab-shell-proxy
    restart: always
    volumes:
    - /.../gitlab/.ssh:/in:ro
    - /home/git/.ssh:/out
    - /home/git/bin:/proxy
    environment:
    - USER=git
    - USER_UID=1000
    - GITLAB_HOST=git.example.org.docker
    depends_on:
    - gitlab
Environment variables
NameValueDefault value
USERhost user namegit
USER_UIDhost user UID1000
GITLAB_HOSTIP or hostname of the Gitlab containergit.example.org.docker
GITLAB_SHELLthe gitlab-shell binary in the Gitlab container/opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-shell
IAUTHDIRthe path of input authorized_keys parent directory/in
OAUTHDIRthe path of output authorized_keys parent directory/out
COMMANDthe host location of gitlab-shell-proxy~/bin/gitlab-shell-proxy

Tag summary

Content type

Image

Digest

Size

3.6 MB

Last updated

almost 8 years ago

docker pull celforyon/gitlab-shell-proxy