用户工具

站点工具


linux:gogs

Gogs

Gogs是基于Go语言的自助Git服务,使用它可以快速搭建一个类似与GitHubGit仓库托管服务。类似的服务有GitLab

官方提供了二进制、Docker、Vagrant,以及包管理器等安装方式。得益于Golang的跨平台性,Gogs能跑在RaspberryPi

Install

1. 下载编译好的二进制包

2. 如果数据库使用的是PostgreSQL或者MySQL,则安装对应的数据库;

3. 使用systemd管理gogs进程;

/lib/systemd/system/gogs.service
[Unit]
Description=Gogs
After=syslog.target
After=network.target
After=postgresql.service redis-server.service
 
[Service]
# Modify these two values and uncomment them if you have
# repos with lots of files and get an HTTP error 500 because
# of that
###
#LimitMEMLOCK=infinity
#LimitNOFILE=65535
Type=simple
User=git
Group=git
WorkingDirectory=/home/git/gogs
ExecStart=/home/git/gogs/gogs web
Restart=always
Environment=USER=git HOME=/home/git
 
[Install]
WantedBy=multi-user.target

4. 重启 gogs 进程。

sudo systemctl restart gogs

Upgrade

  1. 下载最新版的压缩包;
  2. 删除当前的 templates 目录;
  3. 解压压缩包并将所有内容复制粘贴到相应(当前)的位置。

Reference

linux/gogs.txt · 最后更改: 2023/12/03 10:24 由 127.0.0.1