1. GO 语言:

1.1 介绍

1.1.1 官方介绍:

The Go programming language is an open source project to make programmers more productive.

Go is expressive, concise, clean, and efficient. Its concurrency mechanisms make it easy to write programs that get the most out of multicore and networked machines, while its novel type system enables flexible and modular program construction. Go compiles quickly to machine code yet has the convenience of garbage collection and the power of run-time reflection. It's a fast, statically typed, compiled language that feels like a dynamically typed, interpreted language.

1.1.2 简单说:

Go 是 Google 家的一门速度快,体验好的新语言。可以在不损失应用程序性能的情况下降低代码的复杂性。

由于专门针对多处理器系统应用程序的编程进行了优化,Go 程序在速度上可以媲美 C 或 C++,而且安全、支持并行。

1.2 安装

1.2.1 下载:
go1.9.2.linux-amd64.tar.gz
1.2.2 安装:
/usr/local/go
sudo tar -C /usr/local/ -zxvf go1.9.2.linux-amd64.tar.gz
/etc/profile
# /etc/profile

export GOROOT=/usr/local/go
export PATH=$GOROOT/bin:$PATH

使配置生效:

source /etc/profile
go version
$ go version
go1.9.2 linux/amd64

到此,GO 语言的环境就安装好了。接下来是 Gogs.

2. Gogs

2.1 介绍

2.1.1 官方介绍
一款极易搭建的自助 Git 服务。
2.1.2 简单说:

Gogs 是个极轻的基于 Git 的版本控制工具,类似于Github, Gitlab.

Raspberry PiNAS

所谓的:易安装 + 跨平台 + 轻量级

项目所有的源代码均通过 MIT 授权协议 托管在 GitHub 上。免费使用!

到目前为止已经 2w 多 Stars 了,可见一斑。

2.2 安装:

2.2.1 下载:

直接官网下载:(国人产品,是中文的官网)

2.2.2 安装:
linux_amd64-gogs.zip/www/gogs
conf/app.inicustom/conf/app.ini

程序本身提供了多种部署和启动的方式,这里我们选择最简单的:直接运行:

run_gogs
nohup /www/gogs/gogs web &
sh ./run_gogs
supervisor
[program:gogs]
directory=/www/gogs/
command=/www/gogs/gogs web
autostart=true
autorestart=true
startsecs=10
stdout_logfile=/var/log/gogs/stdout.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10
stdout_capture_maxbytes=1MB
stderr_logfile=/var/log/gogs/stderr.log
stderr_logfile_maxbytes=1MB
stderr_logfile_backups=10
stderr_capture_maxbytes=1MB
user = git
environment = HOME="/home/git", USER="git"