Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker: add push support by default (bug 1864902) #1

Merged
merged 1 commit into from
Dec 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
**
!auth-example/**
!rootfs/**
!cgit_build.conf
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -31,6 +31,10 @@ RUN make && make install

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

ENV GIT_USER=lando
# 'password'
# generate with `htpasswd -n user | cut -d: -f2`
ENV GIT_PASSWORD='$apr1$syi9IAPx$lGAixLm5WXtzEWR.fA.cS0'

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

COPY ./rootfs/ /
COPY ./auth-example/etc/nginx/git-http-backend_write.conf /etc/nginx/git-http-backend_write.conf
COPY ./auth-example/etc/nginx/htpasswd.template /etc/nginx/templates/htpasswd.template
COPY --from=build /opt/cgit /opt/cgit

VOLUME ["/opt/git"]
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This is a mirror

This repo is a mirror of [Upstream], with local modifications to enable authenticated push by default.

# Cgit Docker

[![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
* [Cgit README](https://git.zx2c4.com/cgit/tree/README)
* [Cgit configuration](https://git.zx2c4.com/cgit/tree/cgitrc.5.txt)
* [cgit - ArchWiki](https://wiki.archlinux.org/title/Cgit)
* [Upstream](https://github.com/LuqueDaniel/cgit-docker)
2 changes: 1 addition & 1 deletion auth-example/etc/nginx/git-http-backend_write.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
auth_basic "closed site";
auth_basic_user_file .htpasswd;
auth_basic_user_file conf.d/htpasswd;
1 change: 1 addition & 0 deletions auth-example/etc/nginx/htpasswd.template
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$GIT_USER:$GIT_PASSWORD