镜像git存储库并检索cgit的元数据。
giternit的Python项目详细描述
数
VersionpyversionsDownloadsLicense
giternity是一个从github镜像git存储库的工具。你可以 指定要镜像其所有存储库的用户名/组织,或 只是个别回购。它检索一些repo元数据,以便它们可以 与cgit一起享用。跑步 giternity定期更新镜像。
一个示例结果是git.cpu.re。跟随 tutorial 来招待你自己。
安装
安装giternity:
sudo pip3 install giternity
您还需要安装git。
配置
配置文件位于/etc/giternity.toml:
# path for the git mirrorsgit_data_path="/srv/git/"# path for checkouts of the git mirrors (optional)# checkout_path = "/srv/git_checkout/"# public URL of your cgit instance (optional)# cgit_url = "https://git.cpu.re/"[github]repositories=[ "rahiel", "sunsistemo", "TeMPOraL/nyan-mode",]
将git_data_path设置为要存储git的路径 储存库。它将包含裸git存储库:您 通常可以在项目的.git目录中看到。同时拥有 回购协议的实际工作文件,将checkout_path设置为 留着它们。如果要用cgit托管回购协议,请将cgit_url设置为 公共url。
在[github]部分中,指定要镜像的存储库。 列出用户名("rahiel")或组织("sunsistemo") 镜像所有非fork存储库。个人回购 ("TeMPOraL/nyan-mode")可以像owner/repo那样指定它们。
配置就绪后,您只需运行giternity。
为了方便起见,有一个自动配置可以设置 单独的系统用户,将此用户权限授予git_data_path (和checkout_path如果指定)并在 /etc/cron.d/giternity每小时更新一次镜像。应用这些 默认值为:
sudo giternity --configure
cgit
您的git镜像现在适合与cgit一起使用。自定义 /etc/cgitrc根据您的喜好,在底部添加以下内容:
agefile=info/web/last-modifiedsection-from-path=1scan-path=/srv/git/
将/srv/git/替换为 /etc/giternity.toml。