From d67840fa8defc5b46f184665b1fc3e0dbad1dc77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A2=D0=B0=D1=82=D1=8C=D1=8F=D0=BD=D0=B0=20=D0=A4=D0=B0?= =?UTF-8?q?=D1=80=D0=B1=D0=B5=D1=80?= Date: Wed, 21 Oct 2026 14:50:10 +0400 Subject: readme --- README.md | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 73 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5d985f3..bb0707e 100644 --- a/README.md +++ b/README.md @@ -58,8 +58,80 @@ git init git add . git commit -m "Initial commit" -git-create private new-api +git-create private new git push -u origin --all ``` + +## Установка cgit + +``` +sudo apt update +sudo apt install cgit spawn-fcgi fcgiwrap +sudo systemctl status fcgiwrap.socket + +``` + +``` +sudo chown -R git:www-data /home/git/repositories/public +sudo find /home/git/repositories/public -type d -exec chmod 750 {} \; +sudo find /home/git/repositories/public -type f -exec chmod 640 {} \; +sudo chmod +x /home/git +sudo chmod +x /home/git/repositories +sudo chmod +x /home/git/repositories/public + +``` + + +Для запуска из корня: + +``` +sudo nano /etc/cgitrc + +virtual-root=/ +css=/cgit-css/cgit.css +logo=/cgit-css/cgit.png +favicon=/cgit-css/favicon.ico +enable-git-config=1 +remove-suffix=1 +scan-path=/home/git/repositories/public +main-title=Asustem.ru +snapshots=tar.gz zip + + + +sudo chmod -R 755 /usr/share/cgit/ + +``` +Тест: + +``` +CGIT_CONFIG=/etc/cgitrc /usr/lib/cgit/cgit.cgi + +``` + +Конфигурация nginx: + +``` + location /cgit-css/ { + alias /usr/share/cgit/; + try_files $uri =404; + } + + location / { + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME /usr/lib/cgit/cgit.cgi; + fastcgi_param PATH_INFO $uri; + fastcgi_param QUERY_STRING $args; + fastcgi_pass unix:/run/fcgiwrap.socket; + } +``` + +``` +.git/config + +[gitweb] + description = Мой тестовый репозиторий + owner = user +``` -- cgit v1.2.3