Browse Source

modified to "share" ssh host port

tags/v1.0.0
Robin Thoni 6 years ago
parent
commit
bbf48c0cdd
4 changed files with 23 additions and 1 deletions
  1. 17
    0
      README
  2. 1
    1
      docker-compose.yml
  3. 3
    0
      env
  4. 2
    0
      gogs/Dockerfile

+ 17
- 0
README View File

@@ -0,0 +1,17 @@
1
+Configure real git user
2
+=======================
3
+
4
+Create user and SSH key:
5
+```
6
+. ./env
7
+groupadd -g "${PUID}" git
8
+useradd -g git -u "${PGID}" git -d "$(pwd)"/data/gogs/git
9
+sudo -u git ssh-keygen -f ~git/.ssh/id_rsa -N ''
10
+echo -n 'no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ' | sudo -u git cat - ~git/.ssh/id_rsa.pub | sudo -u git tee ~git/.ssh/authorized_real_keys
11
+```
12
+
13
+/app/gogs/gogs:
14
+```
15
+#!/bin/sh
16
+ssh -p 35021 -o StrictHostKeyChecking=no git@127.0.0.1 "SSH_ORIGINAL_COMMAND=\"$SSH_ORIGINAL_COMMAND\" $0 $@"
17
+```

+ 1
- 1
docker-compose.yml View File

@@ -26,9 +26,9 @@ services:
26 26
                 aliases:
27 27
                     - gogs.gogs.internal.docker
28 28
         volumes:
29
-            - ./data/gogs/repositories:/data/git/gogs-repositories
30 29
             - ./data/gogs/logs:/app/gogs/log
31 30
             - ./data/gogs/conf:/data/gogs/conf
31
+            - ./data/gogs/git:/data/git
32 32
         ports:
33 33
             - "127.0.0.1:35021:22"
34 34
             - "127.0.0.1:35022:3000"

+ 3
- 0
env View File

@@ -8,3 +8,6 @@ POSTGRES_REP_PASSWORD=change_it
8 8
 POSTGRES_REP_ALLOWED_HOST=127.0.0.1/32
9 9
 POSTGRES_RO_USER=gogs_ro
10 10
 POSTGRES_RO_PASSWORD=change_it
11
+
12
+PUID=1100
13
+PGID=1100

+ 2
- 0
gogs/Dockerfile View File

@@ -1 +1,3 @@
1 1
 FROM gogs/gogs:0.11.43
2
+
3
+RUN sed -i '/AuthorizedKeysFile/ s/$/ .ssh\/authorized_real_keys/' /app/gogs/docker/sshd_config

Loading…
Cancel
Save