RaspberryPi 搭建 Gogs Git 服务

RaspberryPi 搭建 Gogs Git 服务

树莓派搭建 Gogs Git 服务

安装 MySQL

1
sudo apt install mariadb-server mariadb-client

配置

1
2
3
sudo vi /etc/mysql/mariadb.conf.d/50-server.cnf 
注释掉
bind-address = 127.0.0.1
  • 修改 root 密码
1
sudo mysqladmin -u root -p password
  • 新建 gogs 数据库
1
2
mysql -h127.0.0.1 -uroot -p123456
create database gogs;
  • 重启 MySQL
1
sudo service mysql restart

golang

1
sudo apt install golang -y

gogs

1
wget https://cdn.gogs.io/0.11.79/gogs_0.11.79_raspi2_armv6.zip

解压

1
tar -xzvf gogs_0.11.79_raspi2_armv6.zip

安装

1
2
cd 解压后的目录
./gogs web

配置

  • 浏览器打开 http://ip:3000

后台运行

1
nohup ./gogs web > nohup.out 2>&1 &

Frp 内网穿透

下载安装

1
2
3
4
wget https://github.com/fatedier/frp/releases/download/v0.27.1/frp_0.27.1_linux_386.tar.gz

# 解压安装
tar -zxvf frp_0.27.1_linux_386.tar.gz

配置

1
2
cd frp_0.27.1_linux_386
vim frps.ini
1
2
3
4
5
6
7
8
9
10
11
12
[common]
server_addr = gogs.vitan.me
server_port = 8000
token =

[gogs]
type =http
privilege_mode = true
local_ip = localhost
locah_port = 3000

custom_domain = gogs.vitan.me

启动

1
./frps -c ./frps.ini

参考


评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×