Skip to content

Commit ee0a290

Browse files
authoredDec 30, 2024
docker: add push support by default (bug 1864902) (#1)
1 parent 7228dd6 commit ee0a290

File tree

5 files changed

+14
-1
lines changed

5 files changed

+14
-1
lines changed
 

‎.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
**
2+
!auth-example/**
23
!rootfs/**
34
!cgit_build.conf

‎Dockerfile

+6
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ RUN make && make install
3131

3232
FROM nginx:${NGINX_VERSION}-alpine${ALPINE_VERSION}
3333

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'
3438

3539
# mailcap - provides /etc/mime.types
3640
RUN apk add --no-cache \
@@ -52,6 +56,8 @@ RUN apk add --no-cache \
5256
ENV CGIT_APP_USER=nginx
5357

5458
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
5561
COPY --from=build /opt/cgit /opt/cgit
5662

5763
VOLUME ["/opt/git"]

‎README.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# This is a mirror
2+
3+
This repo is a mirror of [Upstream], with local modifications to enable authenticated push by default.
4+
15
# Cgit Docker
26

37
[![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
6771
* [Cgit README](https://git.zx2c4.com/cgit/tree/README)
6872
* [Cgit configuration](https://git.zx2c4.com/cgit/tree/cgitrc.5.txt)
6973
* [cgit - ArchWiki](https://wiki.archlinux.org/title/Cgit)
74+
* [Upstream](https://github.com/LuqueDaniel/cgit-docker)
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
auth_basic "closed site";
2-
auth_basic_user_file .htpasswd;
2+
auth_basic_user_file conf.d/htpasswd;
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$GIT_USER:$GIT_PASSWORD

0 commit comments

Comments
 (0)
Failed to load comments.