Background
- 需要托管一些自己的代码
- 这些代码可能要吃DMCA
- GitHub 无预警突然封号 - V2EX Github的连坐机制
就是想折腾
Steps
Install Git(Version >= 2.0)
Cent OS 7 Example
Add wandisco-git Repovim /etc/yum.repos.d/wandisco-git.repo
1 | [wandisco-git] |
Import repo GPG Keyrpm --import http://opensource.wandisco.com/RPM-GPG-KEY-WANdisco
Install latest version of gityum install git
Download
1 | wget -O gitea https://dl.gitea.io/gitea/1.16.4/gitea-1.16.4-linux-amd64`` |
Verify
1 | gpg --keyserver keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2 |
Create Git user
1 | adduser \ |
Preper Directory
1 | mkdir -p /opt/gitea/{custom,data,log} |
Install and Run
1 | su git && GITEA_WORK_DIR=/opt/gitea/ /opt/gitea/gitea web -c /opt/gitea/config/app.ini |
Mod the config
修改此处配置文件/opt/gitea/config/app.ini
1 | # 并不想让用户注册 |
Run with pm2
创建 start.sh
1 |
|
使用git用户启动
1 | sudo -u git pm2 start start.sh |