Home
Packages
Forums
Wiki
GitLab
Security
AUR
Download
コンテンツにスキップ
メインメニュー
メインメニュー
サイドバーに移動
非表示
案内
メインページ
目次
コミュニティに貢献
最近の出来事
おまかせ表示
特別ページ
交流
ヘルプ
貢献
最近の更新
最近の議論
新しいページ
統計
リクエスト
ArchWiki
検索
検索
表示
アカウント作成
ログイン
個人用ツール
アカウント作成
ログイン
Cgitのソースを表示
ページ
議論
日本語
閲覧
ソースを閲覧
履歴を表示
ツール
ツール
サイドバーに移動
非表示
操作
閲覧
ソースを閲覧
履歴を表示
全般
リンク元
関連ページの更新状況
ページ情報
表示
サイドバーに移動
非表示
←
Cgit
あなたには「このページの編集」を行う権限がありません。理由は以下の通りです:
この操作は、次のグループに属する利用者のみが実行できます:
登録利用者
。
このページのソースの閲覧やコピーができます。
[[Category:バージョン管理システム]] [[en:Cgit]] [http://git.zx2c4.com/cgit/ Cgit] は [[git]] バージョン管理システムの高速なウェブインターフェイスです。キャッシュを使うことで git サーバーの負担を減らしています。 ==インストール== [[公式リポジトリ]]から {{Pkg|cgit}} をインストールしてください。 cgit を利用するには、システムに [[Apache]] などの[[:カテゴリ:ウェブサーバー|ウェブサーバー]]をインストールする必要があります。 ==ウェブサーバーの設定== ===Apache=== 以下を {{ic|/etc/httpd/conf/httpd.conf}} ファイルの末尾に追加するか {{ic|/etc/httpd/conf/extra/}} ディレクトリのファイルに記述します: ScriptAlias /cgit/ "/usr/lib/cgit/cgit.cgi/" Alias /cgit-css "/usr/share/webapps/cgit/" <Directory "/usr/share/webapps/cgit/"> AllowOverride None Options None Require all granted </Directory> <Directory "/usr/lib/cgit/"> AllowOverride None Options ExecCGI FollowSymlinks Require all granted </Directory> 次の行をアンコメントして {{ic|httpd.conf}} で cgi モジュールをロードするようにしてください: LoadModule cgi_module modules/mod_cgi.so {{ic|httpd.service}} を再起動することで変更が適用されます。 ===Lighttpd=== 以下の設定で http://your.server.com/cgit から cgit にアクセスできるようになります (http://your.server.com/git からリダイレクトします)。完璧ではありませんが動作はします (全てのリポジトリの url で "cgit.cgi" が見えてしまいます)。 {{ic|/etc/lighttpd/conf.d/cgit.conf}} ファイルを作成: server.modules += ("mod_redirect", "mod_alias", "mod_cgi", "mod_fastcgi", "mod_rewrite" ) var.webapps = "/usr/share/webapps/" $HTTP["url"] =~ "^/cgit" { server.document-root = webapps server.indexfiles = ("cgit.cgi") cgi.assign = ("cgit.cgi" => "") mimetype.assign = ( ".css" => "text/css" ) } url.redirect = ( "^/git/(.*)$" => "/cgit/cgit.cgi/$1", ) {{ic|/etc/lighttpd/lighttpd.conf}} からファイルを include: include "conf.d/cgit.conf" そして lighttpd を再起動してください。 ====Lighttpd サブドメイン==== SSL を有効にして git.example.com のようなサブドメインで Cgit をアクセスできるようにして、パーマリンクを作成する lighttpd 設定: # GIT repository browser #$SERVER["socket"] == "127.0.0.1:443" { $SERVER["socket"] == "127.0.0.1:80" { #ssl.engine = "enable" #ssl.pemfile = "/etc/lighttpd/ssl/git.example.com.pem" server.name = "git.example.com" server.document-root = "/usr/share/webapps/cgit" index-file.names = ( "cgit.cgi" ) cgi.assign = ( "cgit.cgi" => "/usr/share/webapps/cgit/cgit.cgi" ) url.rewrite-once = ( "^/([^?/]+/[^?]*)?(?:\?(.*))?$" => "/cgit.cgi?url=$1&$2", ) } ===Nginx=== ====fcgiwrap を使う==== 以下を設定することによって {{Pkg|fcgiwrap}} を使って {{ic|git.example.com}} のようなサブドメインで Cgit を表示できます。 Nginx の設定: {{hc|/etc/nginx/nginx.conf|2= worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; gzip on; # Cgit server { listen 80; server_name ''git.example.com;'' root /usr/share/webapps/cgit; try_files $uri @cgit; location @cgit { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root/cgit.cgi; fastcgi_param PATH_INFO $uri; fastcgi_param QUERY_STRING $args; fastcgi_param HTTP_HOST $server_name; fastcgi_pass unix:/run/fcgiwrap.sock; } } } }} ====uwsgi を使う==== 以下の例では uwsgi によってネイティブの cgi プラグインを使って cgit をセットアップします。 まず、{{Pkg|uwsgi}} と {{Pkg|uwsgi-plugin-cgi}} をインストールしてください。 以下の server ブロックを設定に追加: server { listen 80; server_name git.example.com; root /usr/share/webapps/cgit; # Serve static files with nginx location ~* ^.+(cgit.(css|png)|favicon.ico|robots.txt) { root /usr/share/webapps/cgit; expires 30d; } location / { try_files $uri @cgit; } location @cgit { gzip off; include uwsgi_params; uwsgi_modifier1 9; uwsgi_pass unix:/run/uwsgi/cgit.sock; } } cgit の uwsgi 設定を追加: {{hc|/etc/uwsgi/cgit.ini|2= [uwsgi] master = true plugins = cgi socket = /run/uwsgi/%n.sock uid = http gid = http procname-master = uwsgi cgit processes = 1 threads = 2 cgi = /usr/lib/cgit/cgit.cgi }} 適切なソケットを起動・有効化 (手動でサービスを起動・有効化することもできます): # systemctl enable uwsgi@cgit.socket # systemctl start uwsgi@cgit.socket ==Cgit の設定== ===基本設定=== リポジトリを追加する前に、先に {{ic|/etc/cgitrc}} に cgit の基本設定ファイルを作成してください。 # # cgit config # css=/cgit.css logo=/cgit.png # Following lines work with the above Apache config #css=/cgit-css/cgit.css #logo=/cgit-css/cgit.png # Following lines work with the above Lighttpd config #css=/cgit/cgit.css #logo=/cgit/cgit.png # if you do not want that webcrawler (like google) index your site robots=noindex, nofollow # if cgit messes up links, use a virtual-root. For example has cgit.example.org/ this value: virtual-root=/ ===リポジトリの追加=== リポジトリを追加: # # List of repositories. # This list could be kept in a different file (e.g. '/etc/cgitrepos') # and included like this: # include=/etc/cgitrepos # repo.url=MyRepo repo.path=/srv/git/MyRepo.git repo.desc=This is my git repository repo.url=MyOtherRepo repo.path=/srv/git/MyOtherRepo.git repo.desc=That's my other git repository リポジトリを手動で指定したくない場合、cgit に検索させるように設定することもできます: scan-path=/srv/git/ gitweb から移行して説明とオーナー情報を変更したくない場合: enable-git-config=1 設定ファイルで利用できる設定に関する詳細は man ページ (`man cgitrc`) を見て下さい。 ===シンタックスハイライト=== Cgit はソースコードを表示したときのシンタックスハイライトをサポートしています。シンタックスハイライトを有効にするには、{{Pkg|highlight}} パッケージをインストールする必要があります。 # pacman -S highlight Edit {{ic|/usr/lib/cgit/filters/syntax-highlighting.sh}}. Comment out version 2 and comment in version 3. You may want to add {{ic|--inline-css}} to the options of highlight for a more colorfull output without editing cgit's css file. {{bc| # This is for version 2 #exec highlight --force -f -I -X -S "$EXTENSION" 2>/dev/null # This is for version 3 exec highlight --force --inline-css -f -I -O xhtml -S "$EXTENSION" 2>/dev/null }} Enable the filter in {{ic|/etc/cgitrc}} source-filter=/usr/lib/cgit/filters/syntax-highlighting.sh Note: If you edit the {{ic|/usr/lib/cgit/filters/syntax-highlighting.sh}}, the changes will be lost the next time cgit is updated. To avoid this, copy {{ic|/usr/lib/cgit/filters/syntax-highlighting.sh}} to {{ic|/usr/lib/cgit/filters/syntax-highlighting-edited.sh}}, and change {{ic|/etc/cgitrc}} to use the copied file instead source-filter=/usr/lib/cgit/filters/syntax-highlighting-edited.sh Alternately you can prevent pacman from extracting the file by adding the following to {{ic|/etc/pacman.conf}}: NoExtract = usr/lib/cgit/filters/syntax-highlighting.sh ==統合== ===Gitosis=== [[en2:gitosis|gitosis]] と統合したい場合、以下の2つのコマンドを実行して apache にフォルダを閲覧する権限を与える必要があります: # chgrp http /srv/gitosis # chmod a+rx /srv/gitosis ===Gitolite=== [[gitolite]] によって管理されているリポジトリを追加する場合、ウェブサーバーがファイルにアクセスできるようにパーミッションを変更する必要があります。 * ''http'' ユーザーを ''gitolite'' グループに追加: ** {{ic|# usermod -aG gitolite http}} * 今後のリポジトリのパーミッションを変更: ** {{ic|/var/lib/gitolite/.gitolite.rc}} を編集して {{ic|UMASK}} を {{ic|0027}} に変更。 ** 参照: http://gitolite.com/gitolite/gitolite.html#umask * ''gitolite'' ホームディレクトリと既存のリポジトリのパーミッションを変更。以下のコマンドを実行してください: **{{ic|# chmod g+rX /var/lib/gitolite}} **{{ic|# chmod -R g+rX /var/lib/gitolite/repositories}} ==トラブルシューティング== ===''snapshots'' が正しく表示されない=== If you have enabled ''scan-path'' as well as ''snapshots'', the order in cgitrc matters. According to [http://comments.gmane.org/gmane.comp.version-control.cgit/917 cgit mailing list], ''snapshots'' should be specified before ''scan-path'' snapshots=tar.gz tar.bz2 zip scan-path=/path/to/your/repositories ===''source-filter'' が正しく機能しない=== If you have enabled ''scan-path'', again, the order in cgitrc matters. ''source-filter'' should be specified before ''scan-path'', otherwise it will have no effect. ==参照== * http://git.zx2c4.com/cgit/ * http://git.zx2c4.com/cgit/about/ * http://git.zx2c4.com/cgit/tree/README * http://git.zx2c4.com/cgit/tree/cgitrc.5.txt
このページで使用されているテンプレート:
テンプレート:AUR
(
ソースを閲覧
)
テンプレート:Aur
(
ソースを閲覧
)
テンプレート:Bc
(
ソースを閲覧
)
テンプレート:Hc
(
ソースを閲覧
)
テンプレート:Ic
(
ソースを閲覧
)
テンプレート:Lowercase title
(
ソースを閲覧
)
テンプレート:Man
(
ソースを閲覧
)
テンプレート:Note
(
ソースを閲覧
)
テンプレート:Pkg
(
ソースを閲覧
)
Cgit
に戻る。
検索
検索
Cgitのソースを表示
話題を追加