Notes of Using Gogs


Gogs 使用方法

服务启动方式

设置

gogs/script/init/debian/gogs 复制到/etc/init.d/gogs

为保证http方式下文件推送大小权限,需要调整http服务器设置:

参考来源

Solution for nginx

Just load your nginx.conf and add:

client_max_body_size 1024m;

(changing the value to your needs) in the http block.

Reload nginx to accept the new config by executing sudo service nginx reload and try again to push your commit over http.

Solution for Apache

In your httpd.conf add:

LimitRequestBody 52428800

(changing the value to your needs ) inside a block. Doing this you can limit the request of the whole server filesystem, just a single Virtual Host or a directory.

使用

sudo /etc/init.d/gogs restart|stop|start

权限设置

组织(Organization)

  • http://git.drwater.net创建organization,如:ORGAN1
  • 如有必要,在系统中创建group: ORGAN1
  • $GOGS_HOME文件夹下执行:
sudo chmod -R 2770  ORGAN1
sudo chown -R git:[ORGAN1]  ORGAN1

用户

  • http://git.drwater.net创建个人仓库,如:PROJ1
  • 如有必要,在系统中创建用户: USERNAME
  • $GOGS_HOME/$USERNAME文件夹下执行:
sudo chmod -R 2770  ORGAN1
sudo chown -R git:[USERNAME]  PROJ1
Ming Su
Ming Su
Associate Professor of Environmental Engneering

My research interest is water quality problems in drinking water bodies, with a focus on harmful algal blooms and associated taste & odor problems.