Reputation: 1
I'm using cgit as web front-end of git, showing my git repos. But I couldn't find out how to add/delete repos by cgit itself. Each time I want to create a new remote repo, I have to log in to my server, create it manually. It's so inconvenient.
I've read cgitrc.5.txt, but it seems to has no relative function. Hope that there's some easy way to add/delete/manage repos in cgit, otherwise I'm thinking about write it myself, but it may be too hard to a basic user...
Is there any way or projects to work with cgit and help managing repos? By the way, how could i find some groups of cgit users, so that I could discuss with them, not asking such a foolish question here......
Additional Information:
My cgit version is commit 09d24d7, current master branch. Global cgit config(/etc/cgitrc
):
css=/cgit.css
logo=/cgit.png
favicon=/favicon.ico
#footer=
virtual-root=/
enable-http-clone=0
# Smart HTTP
clone-url=https://git.qin-juan-ge-zhu.top/$CGIT_REPO_URL
root-title=勤倦阁的 Git 存储室
root-desc=Good good study, day day up!
root-readme=/var/www/cgit/README.md
enable-index-owner=1
enable-index-links=1
enable-blame=1
enable-log-filecount=1
enable-log-linecount=1
enable-commit-graph=1
enable-follow-links=1
enable-html-serving=1
enable-remote-branches=1
local-time=1
robots=noindex, nofollow
branch-sort=age
commit-sort=date
max-stats=quarter
snapshots=tar.gz zip
cache-size=1024
source-filter=/usr/local/share/cgit/filters/syntax-highlighting.py
email-filter=lua:/usr/local/share/cgit/filters/email-libravatar-korg.lua
about-filter=/usr/local/share/cgit/filters/about-formatting.sh
readme=:README.md
readme=:readme.md
readme=:README.txt
readme=:readme.txt
readme=:README
readme=:readme
mimetype.html=text/html
mimetype.gif=image/gif
mimetype.jpg=image/jpeg
mimetype.jpeg=image/jpeg
mimetype.png=image/png
mimetype.webp=image/webp
mimetype.pdf=application/pdf
mimetype.svg=image/svg+xml
remove-suffix=1
scan-path=/home/git
Besides, I'm using nginx to proxy the web page, below is my nginx configure relative to cgit:
server {
listen 80;
server_name git.mydomain.com;
return 301 https://$server_name$request_uri;
}
server {
server_name git.mydomain.com;
listen 443 ssl http2;
ssl_certificate somewhere;
ssl_certificate_key somewhere;
root /var/www/cgit;
try_files $uri @cgit;
client_max_body_size 10m;
location @cgit {
include fastcgi_params;
# cgit's CGI script path
fastcgi_param SCRIPT_FILENAME /var/www/cgit/cgit.cgi;
fastcgi_param DOCUMENT_ROOT /usr/lib/git-core;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
fastcgi_param PATH_INFO $uri;
fastcgi_param QUERY_STRING $args;
fastcgi_param HTTP_HOST $server_name;
fastcgi_param GIT_HTTP_EXPORT_ALL "";
fastcgi_param GIT_PROJECT_ROOT /home/git;
if ($arg_service = git-receive-pack) {
rewrite (/.*) /git_write/$1 last;
}
if ($uri ~ ^/.*/git-receive-pack$) {
rewrite (/.*) /git_write/$1 last;
}
if ($arg_service = git-upload-pack) {
rewrite (/.*) /git_read/$1 last;
}
if ($uri ~ ^/.*/git-upload-pack$) {
rewrite (/.*) /git_read/$1 last;
}
}
location ~ /git_read/(.*) {
include git-http-backend.conf;
}
location ~ /git_write/(.*) {
# HTTP Basic Authentication
auth_basic "Authentication Required To Push";
auth_basic_user_file /etc/nginx/conf.d/git.htpasswd;
add_header Cache-Control "no-store";
include git-http-backend.conf;
}
}
Upvotes: 0
Views: 45