5 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 1
1
**
2
+ ! auth-example /**
2
3
! rootfs /**
3
4
! cgit_build.conf
Original file line number Diff line number Diff line change @@ -31,6 +31,10 @@ RUN make && make install
31
31
32
32
FROM nginx:${NGINX_VERSION}-alpine${ALPINE_VERSION}
33
33
34
+ ENV GIT_USER=lando
35
+ # 'password'
36
+ # generate with `htpasswd -n user | cut -d: -f2`
37
+ ENV GIT_PASSWORD='$apr1$syi9IAPx$lGAixLm5WXtzEWR.fA.cS0'
34
38
35
39
# mailcap - provides /etc/mime.types
36
40
RUN apk add --no-cache \
@@ -52,6 +56,8 @@ RUN apk add --no-cache \
52
56
ENV CGIT_APP_USER=nginx
53
57
54
58
COPY ./rootfs/ /
59
+ COPY ./auth-example/etc/nginx/git-http-backend_write.conf /etc/nginx/git-http-backend_write.conf
60
+ COPY ./auth-example/etc/nginx/htpasswd.template /etc/nginx/templates/htpasswd.template
55
61
COPY --from=build /opt/cgit /opt/cgit
56
62
57
63
VOLUME ["/opt/git" ]
Original file line number Diff line number Diff line change
1
+ # This is a mirror
2
+
3
+ This repo is a mirror of [ Upstream] , with local modifications to enable authenticated push by default.
4
+
1
5
# Cgit Docker
2
6
3
7
[ ![ GitHub] ( https://img.shields.io/github/license/LuqueDaniel/cgit-docker?style=flat-square )] ( https://github.com/LuqueDaniel/cgit-docker/blob/main/LICENSE )
@@ -67,3 +71,4 @@ echo "CHANGED" >> /tmp/nginx-cloned/README.md
67
71
* [Cgit README](https://git.zx2c4.com/cgit/tree/README)
68
72
* [Cgit configuration](https://git.zx2c4.com/cgit/tree/cgitrc.5.txt)
69
73
* [cgit - ArchWiki](https://wiki.archlinux.org/title/Cgit)
74
+ * [Upstream](https://github.com/LuqueDaniel/cgit-docker)
Original file line number Diff line number Diff line change 1
1
auth_basic "closed site";
2
- auth_basic_user_file . htpasswd;
2
+ auth_basic_user_file conf.d/ htpasswd;
Original file line number Diff line number Diff line change
1
+ $GIT_USER:$GIT_PASSWORD
0 commit comments