File tree 4 files changed +21
-0
lines changed
4 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -42,8 +42,22 @@ test_srv:
42
42
volumes :
43
43
- /srv/git:/srv/git
44
44
- logs:/var/log/nginx
45
+ # add your custom username and password (default is: admin, admin)
46
+ - ./htpasswd:/srv/htpasswd
45
47
# if you want to use a custom configuration
46
48
- ./default.conf:/etc/nginx/conf.d/default.conf
47
49
environment :
48
50
GIT_POSTBUFFER : 1048576
49
51
` ` `
52
+
53
+ Test it:
54
+
55
+ ` ` ` shell
56
+ git clone http://localhost:8180/myrepo.git
57
+ ```
58
+
59
+ Default username and password are admin/admin. I strongly suggest you to update the htpasswd file with your password, like so:
60
+
61
+ ``` shell
62
+ htpasswd htpasswd admin
63
+ ```
Original file line number Diff line number Diff line change @@ -20,6 +20,10 @@ server {
20
20
fastcgi_param GIT_HTTP_EXPORT_ALL "";
21
21
fastcgi_param GIT_PROJECT_ROOT /srv/git/;
22
22
23
+ auth_basic "Restricted";
24
+ auth_basic_user_file /srv/htpasswd;
25
+ fastcgi_param REMOTE_USER $remote_user;
26
+
23
27
fastcgi_pass unix:/var/run/fcgiwrap.socket;
24
28
}
25
29
Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ test_srv:
5
5
volumes :
6
6
- /srv/git:/srv/git
7
7
- logs:/var/log/nginx
8
+ # add your custom username and password (default is admin, admin)
9
+ - ./htpasswd:/srv/htpasswd
8
10
# if you want to use a custom configuration
9
11
- ./default.conf:/etc/nginx/conf.d/default.conf
10
12
environment :
Original file line number Diff line number Diff line change
1
+ admin:$apr1$SU8d4HhK$n.3vMyw23lJ82sxFQAQzF.
You can’t perform that action at this time.
0 commit comments