Gitea 是一个用 Go 语言写的代码托管软件。

配置

  • 禁止注册: 在 [service] section 中添加 DISABLE_REGISTRATION = true
  • 本地监听: 在 [server] section 中添加 HTTP_ADDR = 127.0.0.1
  • 更改默认主题为暗色主题: 在 [ui] section 中添加 DEFAULT_THEME = arc-green 1
  • 延长 remember me 的时间: 在 [security] section 中添加 LOGIN_REMEMBER_DAYS = 100 2
  • robots.txt: 将 robots.txt 的内容写入 /var/lib/gitea/custom/robots.txt 3

Ubuntu Server 中安装 4

添加 key

curl -sL -o /etc/apt/trusted.gpg.d/morph027-gitea.asc https://packaging.gitlab.io/gitea/gpg.key

添加 repo

echo "deb [arch=amd64] https://packaging.gitlab.io/gitea gitea main" | sudo tee /etc/apt/sources.list.d/morph027-gitea.list

安装

sudo apt update
sudo apt install gitea

Footnotes

  1. https://docs.gitea.io/en-us/customizing-gitea/#customizing-the-look-of-gitea

  2. https://github.com/go-gitea/gitea/issues/778#issuecomment-459977284

  3. https://docs.gitea.io/en-us/search-engines-indexation/

  4. https://landchad.net/gitea