소스 검색

Migration

Thomas Fanninger 10 년 전
커밋
3b52448f19
9개의 변경된 파일1082개의 추가작업 그리고 0개의 파일을 삭제
  1. 38 0
      .SRCINFO
  2. 68 0
      PKGBUILD
  3. 31 0
      README.md
  4. 32 0
      app.ini.patch
  5. 295 0
      app_new.ini
  6. 295 0
      app_old.ini
  7. 267 0
      gogs.changelog
  8. 42 0
      gogs.install
  9. 14 0
      gogs.service

+ 38 - 0
.SRCINFO

@@ -0,0 +1,38 @@
+pkgbase = gogs
+	pkgdesc = Gogs(Go Git Service) is a Self Hosted Git Service in the Go Programming Language.
+	pkgver = 0.6.1
+	pkgrel = 1
+	epoch = 1
+	url = http://gogs.io/
+	install = gogs.install
+	changelog = gogs.changelog
+	arch = i686
+	arch = x86_64
+	arch = armv6h
+	arch = armv7h
+	license = MIT
+	makedepends = go>=1.2
+	makedepends = git
+	makedepends = patch
+	depends = git
+	optdepends = sqlite: SQLite support
+	optdepends = mariadb: MariaDB support
+	optdepends = postgresql: PostgreSQL support
+	optdepends = redis: Redis support
+	optdepends = memcached: MemCached support
+	optdepends = openssh: GIT over SSH support
+	conflicts = gogs-bin
+	conflicts = gogs-git
+	conflicts = gogs-git-dev
+	options = !strip
+	options = !emptydirs
+	backup = srv/gogs/conf/app.ini
+	source = gogs.service
+	source = app.ini.patch
+	source = gogs::git+https://github.com/gogits/gogs.git#tag=v0.6.1
+	sha512sums = 2b4303f850e3b13b2fc3c9f0bc5820dae431d228002b35f01be0d4bfbcf05de8dcec2a559a85e318b609e4a4d492d44306eadf5f6508fd72333b198661bb0bb7
+	sha512sums = 3653d8461c83213fb1fa588fcd99ddc259ab8d5f12c116f2cffcd4ec80248eb955a80c534edfe78b494cd80443e664e1018b7a13645a28ac7d39e119d11de89f
+	sha512sums = SKIP
+
+pkgname = gogs
+

+ 68 - 0
PKGBUILD

@@ -0,0 +1,68 @@
+# Contributor: Thomas Laroche <tho.laroche@gmail.com>
+# Contributor: Kristian Klausen <klausenbusk@hotmail.com>
+# Maintainer: Thomas Fanninger <thomas@fanninger.at>
+
+pkgname=gogs
+_pkgname=${pkgname}
+pkgver=0.6.1
+pkgrel=1
+epoch=1
+pkgdesc="Gogs(Go Git Service) is a Self Hosted Git Service in the Go Programming Language."
+arch=('i686' 'x86_64' 'armv6h' 'armv7h')
+changelog=$pkgname.changelog
+url="http://gogs.io/"
+license=('MIT')
+depends=('git')
+optdepends=('sqlite: SQLite support'
+            'mariadb: MariaDB support'
+            'postgresql: PostgreSQL support'
+            'redis: Redis support'
+            'memcached: MemCached support'
+            'openssh: GIT over SSH support')
+makedepends=('go>=1.2' 'git' 'patch')
+conflicts=('gogs-bin' 'gogs-git' 'gogs-git-dev')
+options=('!strip' '!emptydirs')
+backup=('srv/gogs/conf/app.ini')
+
+install=gogs.install
+
+_gourl=github.com/gogits
+source=('gogs.service'
+        'app.ini.patch'
+        "${_pkgname}::git+https://${_gourl}/${_pkgname}.git#tag=v${pkgver}")
+
+sha512sums=('2b4303f850e3b13b2fc3c9f0bc5820dae431d228002b35f01be0d4bfbcf05de8dcec2a559a85e318b609e4a4d492d44306eadf5f6508fd72333b198661bb0bb7'
+            '3653d8461c83213fb1fa588fcd99ddc259ab8d5f12c116f2cffcd4ec80248eb955a80c534edfe78b494cd80443e664e1018b7a13645a28ac7d39e119d11de89f'
+            'SKIP')
+
+
+prepare() {
+  mkdir -p "${srcdir}/src/${_gourl}"
+  mv "${_pkgname}" "${srcdir}/src/${_gourl}/${_pkgname}"
+  msg2 "go get"
+  GOPATH="${srcdir}" go get -tags "sqlite redis memcache" "${_gourl}/${_pkgname}"
+  
+  msg2 "Patch: GOGS app.ini"
+  patch -Np1 -i "${srcdir}/app.ini.patch" "${srcdir}/src/${_gourl}/${_pkgname}/conf/app.ini"
+}
+
+build() {
+  msg2 "Build program"
+  cd ${srcdir}/src/${_gourl}/${_pkgname}
+  GOPATH="${srcdir}" go fix
+  GOPATH="${srcdir}" go build -tags "sqlite redis memcache cert"
+}
+
+package() {
+  install -D -m 0755 "${srcdir}/src/${_gourl}/${_pkgname}/${_pkgname}" "${pkgdir}/usr/share/${_pkgname}/${_pkgname}"
+
+  cp -r "${srcdir}/src/${_gourl}/${_pkgname}/conf" "${pkgdir}/usr/share/${_pkgname}"
+  install -d "${pkgdir}/usr/share/themes/gogs/default/"
+  cp -r "${srcdir}/src/${_gourl}/${_pkgname}/public" "${pkgdir}/usr/share/themes/gogs/default"
+  cp -r "${srcdir}/src/${_gourl}/${_pkgname}/templates" "${pkgdir}/usr/share/themes/gogs/default"
+
+  install -D -m 0600 "${pkgdir}/usr/share/${_pkgname}/conf/app.ini" "$pkgdir/srv/${_pkgname}/conf/app.ini"
+  install -D -m 0644 "${srcdir}/gogs.service" "$pkgdir/usr/lib/systemd/system/gogs.service"
+  install -d "${pkgdir}/var/log/gogs"
+  install -D -m 0644 "${srcdir}/src/${_gourl}/${_pkgname}/LICENSE" "${pkgdir}/usr/share/licenses/$_pkgname"
+}

+ 31 - 0
README.md

@@ -0,0 +1,31 @@
+# Gogs
+PKGBUILD files for different versions of Gogs (Go Git Service).
+
+## Open points
+* ~~Systemd service support~~
+* better file structure
+* ~~Publishing on https://aur.archlinux.org~~
+* Test MariaDB and PostgreSQL installation
+* ~~Test on armv6h (Raspberry Pi), armv7h (Cubieboard 2) and on x86_64~~
+* Documentation for usage and configuration
+
+## Install
+```
+$ tar -xvzf /<path to Tarball>/gogs-*.tar.gz
+$ cd <package-name>
+$ makepkg
+$ pacman -U gogs-*.tgz
+```
+
+## Configuration
+Enable and start systemd servicd
+```
+$ systemctl enable gogs.service
+$ systemctl start gogs.service
+```
+
+## Logging
+After start of the service every log entry is over journalctl displayable.
+```
+$ journalctl -f -u gogs.service
+```

+ 32 - 0
app.ini.patch

@@ -0,0 +1,32 @@
+7c7
+< RUN_USER = git
+---
+> RUN_USER = gogs
+12c12
+< ROOT =
+---
+> ROOT = /srv/gogs/repo
+39c39
+< STATIC_ROOT_PATH =
+---
+> STATIC_ROOT_PATH = /usr/share/themes/gogs/default
+55c55
+< PATH = data/gogs.db
+---
+> PATH = /srv/gogs/sqlite/gogs.db
+176c176
+< PROVIDER_CONFIG = data/sessions
+---
+> PROVIDER_CONFIG = /srv/gogs/sessions
+191c191
+< AVATAR_UPLOAD_PATH = data/avatars
+---
+> AVATAR_UPLOAD_PATH = /srv/gogs/data/avatars
+200c200
+< PATH = data/attachments
+---
+> PATH = /srv/gogs/data/attachments
+215c215
+< ROOT_PATH =
+---
+> ROOT_PATH = /var/log/gogs

+ 295 - 0
app_new.ini

@@ -0,0 +1,295 @@
+# NEVER EVER MODIFY THIS FILE
+# PLEASE MAKE CHANGES ON CORRESPONDING CUSTOM CONFIG FILE
+
+; App name that shows on every page title
+APP_NAME = Gogs: Go Git Service
+; Change it if you run locally
+RUN_USER = gogs
+; Either "dev", "prod" or "test", default is "dev"
+RUN_MODE = dev
+
+[repository]
+ROOT = /srv/gogs/repo
+SCRIPT_TYPE = bash
+
+[server]
+PROTOCOL = http
+DOMAIN = localhost
+ROOT_URL = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s/
+HTTP_ADDR =
+HTTP_PORT = 3000
+; Disable SSH feature when not available
+DISABLE_SSH = false
+SSH_PORT = 22
+; Disable CDN even in "prod" mode
+OFFLINE_MODE = false
+DISABLE_ROUTER_LOG = false
+; Generate steps:
+; $ cd path/to/gogs/custom/https
+; $ ./gogs cert -ca=true -duration=8760h0m0s -host=myhost.example.com
+;
+; Or from a .pfx file exported from the Windows certificate store (do
+; not forget to export the private key):
+; $ openssl pkcs12 -in cert.pfx -out cert.pem -nokeys
+; $ openssl pkcs12 -in cert.pfx -out key.pem -nocerts -nodes
+CERT_FILE = custom/https/cert.pem
+KEY_FILE = custom/https/key.pem
+; Upper level of template and static file path
+; default is the path where Gogs is executed
+STATIC_ROOT_PATH = /usr/share/themes/gogs/default
+; Application level GZIP support
+ENABLE_GZIP = false
+; Landing page for non-logged users, can be "home" or "explore"
+LANDING_PAGE = home
+
+[database]
+; Either "mysql", "postgres" or "sqlite3", it's your choice
+DB_TYPE = mysql
+HOST = 127.0.0.1:3306
+NAME = gogs
+USER = root
+PASSWD =
+; For "postgres" only, either "disable", "require" or "verify-full"
+SSL_MODE = disable
+; For "sqlite3" only
+PATH = /srv/gogs/sqlite/gogs.db
+
+[admin]
+
+[security]
+INSTALL_LOCK = false
+; !!CHANGE THIS TO KEEP YOUR USER DATA SAFE!!
+SECRET_KEY = !#@FDEWREWR&*(
+; Auto-login remember days
+LOGIN_REMEMBER_DAYS = 7
+COOKIE_USERNAME = gogs_awesome
+COOKIE_REMEMBER_NAME = gogs_incredible
+; Reverse proxy authentication header name of user name
+REVERSE_PROXY_AUTHENTICATION_USER = X-WEBAUTH-USER
+
+[service]
+ACTIVE_CODE_LIVE_MINUTES = 180
+RESET_PASSWD_CODE_LIVE_MINUTES = 180
+; User need to confirm e-mail for registration
+REGISTER_EMAIL_CONFIRM = false
+; Does not allow register and admin create account only
+DISABLE_REGISTRATION = false
+; User must sign in to view anything.
+REQUIRE_SIGNIN_VIEW = false
+; Cache avatar as picture
+ENABLE_CACHE_AVATAR = false
+; Mail notification
+ENABLE_NOTIFY_MAIL = false
+; More detail: https://github.com/gogits/gogs/issues/165
+ENABLE_REVERSE_PROXY_AUTHENTICATION = false
+ENABLE_REVERSE_PROXY_AUTO_REGISTRATION = false
+; Do not check minimum key size with corresponding type
+DISABLE_MINIMUM_KEY_SIZE_CHECK = false
+
+[webhook]
+; Cron task interval in minutes
+TASK_INTERVAL = 1
+; Deliver timeout in seconds
+DELIVER_TIMEOUT = 5
+; Allow insecure certification
+SKIP_TLS_VERIFY = false
+
+[mailer]
+ENABLED = false
+; Buffer length of channel, keep it as it is if you don't know what it is.
+SEND_BUFFER_LEN = 10
+; Name displayed in mail title
+SUBJECT = %(APP_NAME)s
+; Mail server
+; Gmail: smtp.gmail.com:587
+; QQ: smtp.qq.com:25
+; Note, if the port ends with "465", SMTPS will be used. Using STARTTLS on port 587 is recommended per RFC 6409. If the server supports STARTTLS it will always be used.
+HOST =
+; Do not verify the certificate of the server. Only use this for self-signed certificates
+SKIP_VERIFY = 
+; Use client certificate
+USE_CERTIFICATE = false
+CERT_FILE = custom/mailer/cert.pem
+KEY_FILE = custom/mailer/key.pem
+; Mail from address, RFC 5322. This can be just an email address, or the "Name" <email@example.com> format 
+FROM =
+; Mailer user name and password
+USER =
+PASSWD =
+
+[oauth]
+ENABLED = false
+
+[oauth.github]
+ENABLED = false
+CLIENT_ID =
+CLIENT_SECRET =
+SCOPES = https://api.github.com/user
+AUTH_URL = https://github.com/login/oauth/authorize
+TOKEN_URL = https://github.com/login/oauth/access_token
+
+; Get client id and secret from
+; https://console.developers.google.com/project
+[oauth.google]
+ENABLED = false
+CLIENT_ID =
+CLIENT_SECRET =
+SCOPES = https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile
+AUTH_URL = https://accounts.google.com/o/oauth2/auth
+TOKEN_URL = https://accounts.google.com/o/oauth2/token
+
+[oauth.qq]
+ENABLED = false
+CLIENT_ID =
+CLIENT_SECRET =
+SCOPES = get_user_info
+; QQ 互联
+AUTH_URL = https://graph.qq.com/oauth2.0/authorize
+TOKEN_URL = https://graph.qq.com/oauth2.0/token
+
+[oauth.weibo]
+ENABLED = false
+CLIENT_ID =
+CLIENT_SECRET =
+SCOPES = all
+AUTH_URL = https://api.weibo.com/oauth2/authorize
+TOKEN_URL = https://api.weibo.com/oauth2/access_token
+
+[cache]
+; Either "memory", "redis", or "memcache", default is "memory"
+ADAPTER = memory
+; For "memory" only, GC interval in seconds, default is 60
+INTERVAL = 60
+; For "redis" and "memcache", connection host address
+; redis: network=tcp,addr=:6379,password=macaron,db=0,pool_size=100,idle_timeout=180
+; memcache: `127.0.0.1:11211`
+HOST =
+
+[session]
+; Either "memory", "file", "redis" or "mysql", default is "memory"
+PROVIDER = memory
+; Provider config options
+; memory: not have any config yet
+; file: session file path, e.g. `data/sessions`
+; redis: network=tcp,addr=:6379,password=macaron,db=0,pool_size=100,idle_timeout=180
+; mysql: go-sql-driver/mysql dsn config string, e.g. `root:password@/session_table`
+PROVIDER_CONFIG = /srv/gogs/sessions
+; Session cookie name
+COOKIE_NAME = i_like_gogits
+; If you use session in https only, default is false
+COOKIE_SECURE = false
+; Enable set cookie, default is true
+ENABLE_SET_COOKIE = true
+; Session GC time interval, default is 86400
+GC_INTERVAL_TIME = 86400
+; Session life time, default is 86400
+SESSION_LIFE_TIME = 86400
+
+[picture]
+; The place to picture data, either "server" or "qiniu", default is "server"
+SERVICE = server
+AVATAR_UPLOAD_PATH = /srv/gogs/data/avatars
+; Chinese users can choose "duoshuo"
+GRAVATAR_SOURCE = gravatar
+DISABLE_GRAVATAR = false
+
+[attachment]
+; Whether attachments are enabled. Defaults to `true`
+ENABLE = true
+; Path for attachments. Defaults to `data/attachments`
+PATH = /srv/gogs/data/attachments
+; One or more allowed types, e.g. image/jpeg|image/png
+ALLOWED_TYPES = image/jpeg|image/png
+; Max size of each file. Defaults to 32MB
+MAX_SIZE = 32
+; Max number of files per upload. Defaults to 10
+MAX_FILES = 10
+
+[time]
+; Specifies the format for fully outputed dates. Defaults to RFC1123
+; Special supported values are ANSIC, UnixDate, RubyDate, RFC822, RFC822Z, RFC850, RFC1123, RFC1123Z, RFC3339, RFC3339Nano, Kitchen, Stamp, StampMilli, StampMicro and StampNano
+; For more information about the format see http://golang.org/pkg/time/#pkg-constants
+FORMAT =
+
+[log]
+ROOT_PATH = /var/log/gogs
+; Either "console", "file", "conn", "smtp" or "database", default is "console"
+; Use comma to separate multiple modes, e.g. "console, file"
+MODE = console
+; Buffer length of channel, keep it as it is if you don't know what it is.
+BUFFER_LEN = 10000
+; Either "Trace", "Debug", "Info", "Warn", "Error", "Critical", default is "Trace"
+LEVEL = Trace
+
+; For "console" mode only
+[log.console]
+LEVEL =
+
+; For "file" mode only
+[log.file]
+LEVEL =
+; This enables automated log rotate(switch of following options), default is true
+LOG_ROTATE = true
+; Max line number of single file, default is 1000000
+MAX_LINES = 1000000
+; Max size shift of single file, default is 28 means 1 << 28, 256MB
+MAX_SIZE_SHIFT = 28
+; Segment log daily, default is true
+DAILY_ROTATE = true
+; Expired days of log file(delete after max days), default is 7
+MAX_DAYS = 7
+
+; For "conn" mode only
+[log.conn]
+LEVEL =
+; Reconnect host for every single message, default is false
+RECONNECT_ON_MSG = false
+; Try to reconnect when connection is lost, default is false
+RECONNECT = false
+; Either "tcp", "unix" or "udp", default is "tcp"
+PROTOCOL = tcp
+; Host address
+ADDR =
+
+; For "smtp" mode only
+[log.smtp]
+LEVEL =
+; Name displayed in mail title, default is "Diagnostic message from serve"
+SUBJECT = Diagnostic message from serve
+; Mail server
+HOST =
+; Mailer user name and password
+USER =
+PASSWD =
+; Receivers, can be one or more, e.g. ["1@example.com","2@example.com"]
+RECEIVERS =
+
+; For "database" mode only
+[log.database]
+LEVEL =
+; Either "mysql" or "postgres"
+DRIVER =
+; Based on xorm, e.g.: root:root@localhost/gogs?charset=utf8
+CONN =
+
+[git]
+MAX_GIT_DIFF_LINES = 10000
+; Arguments for command 'git gc', e.g.: "--aggressive --auto"
+; see more on http://git-scm.com/docs/git-gc/1.7.5
+GC_ARGS = 
+
+; Git health check.
+[git.fsck]
+ENABLE = true
+; Execution interval in hours. Default is 24.
+INTERVAL = 24
+; Arguments for command 'git fsck', e.g.: "--unreachable --tags"
+; see more on http://git-scm.com/docs/git-fsck/1.7.5
+ARGS = 
+
+[i18n]
+LANGS = en-US,zh-CN,zh-HK,de-DE,fr-FR,nl-NL,lv-LV,ru-RU,ja-JP,es-ES,pt-BR,pl-PL
+NAMES = English,简体中文,繁體中文,Deutsch,Français,Nederlands,Latviešu,Русский,日本语,Español,Português,Polski
+
+[other]
+SHOW_FOOTER_BRANDING = false

+ 295 - 0
app_old.ini

@@ -0,0 +1,295 @@
+# NEVER EVER MODIFY THIS FILE
+# PLEASE MAKE CHANGES ON CORRESPONDING CUSTOM CONFIG FILE
+
+; App name that shows on every page title
+APP_NAME = Gogs: Go Git Service
+; Change it if you run locally
+RUN_USER = git
+; Either "dev", "prod" or "test", default is "dev"
+RUN_MODE = dev
+
+[repository]
+ROOT =
+SCRIPT_TYPE = bash
+
+[server]
+PROTOCOL = http
+DOMAIN = localhost
+ROOT_URL = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s/
+HTTP_ADDR =
+HTTP_PORT = 3000
+; Disable SSH feature when not available
+DISABLE_SSH = false
+SSH_PORT = 22
+; Disable CDN even in "prod" mode
+OFFLINE_MODE = false
+DISABLE_ROUTER_LOG = false
+; Generate steps:
+; $ cd path/to/gogs/custom/https
+; $ ./gogs cert -ca=true -duration=8760h0m0s -host=myhost.example.com
+;
+; Or from a .pfx file exported from the Windows certificate store (do
+; not forget to export the private key):
+; $ openssl pkcs12 -in cert.pfx -out cert.pem -nokeys
+; $ openssl pkcs12 -in cert.pfx -out key.pem -nocerts -nodes
+CERT_FILE = custom/https/cert.pem
+KEY_FILE = custom/https/key.pem
+; Upper level of template and static file path
+; default is the path where Gogs is executed
+STATIC_ROOT_PATH =
+; Application level GZIP support
+ENABLE_GZIP = false
+; Landing page for non-logged users, can be "home" or "explore"
+LANDING_PAGE = home
+
+[database]
+; Either "mysql", "postgres" or "sqlite3", it's your choice
+DB_TYPE = mysql
+HOST = 127.0.0.1:3306
+NAME = gogs
+USER = root
+PASSWD =
+; For "postgres" only, either "disable", "require" or "verify-full"
+SSL_MODE = disable
+; For "sqlite3" only
+PATH = data/gogs.db
+
+[admin]
+
+[security]
+INSTALL_LOCK = false
+; !!CHANGE THIS TO KEEP YOUR USER DATA SAFE!!
+SECRET_KEY = !#@FDEWREWR&*(
+; Auto-login remember days
+LOGIN_REMEMBER_DAYS = 7
+COOKIE_USERNAME = gogs_awesome
+COOKIE_REMEMBER_NAME = gogs_incredible
+; Reverse proxy authentication header name of user name
+REVERSE_PROXY_AUTHENTICATION_USER = X-WEBAUTH-USER
+
+[service]
+ACTIVE_CODE_LIVE_MINUTES = 180
+RESET_PASSWD_CODE_LIVE_MINUTES = 180
+; User need to confirm e-mail for registration
+REGISTER_EMAIL_CONFIRM = false
+; Does not allow register and admin create account only
+DISABLE_REGISTRATION = false
+; User must sign in to view anything.
+REQUIRE_SIGNIN_VIEW = false
+; Cache avatar as picture
+ENABLE_CACHE_AVATAR = false
+; Mail notification
+ENABLE_NOTIFY_MAIL = false
+; More detail: https://github.com/gogits/gogs/issues/165
+ENABLE_REVERSE_PROXY_AUTHENTICATION = false
+ENABLE_REVERSE_PROXY_AUTO_REGISTRATION = false
+; Do not check minimum key size with corresponding type
+DISABLE_MINIMUM_KEY_SIZE_CHECK = false
+
+[webhook]
+; Cron task interval in minutes
+TASK_INTERVAL = 1
+; Deliver timeout in seconds
+DELIVER_TIMEOUT = 5
+; Allow insecure certification
+SKIP_TLS_VERIFY = false
+
+[mailer]
+ENABLED = false
+; Buffer length of channel, keep it as it is if you don't know what it is.
+SEND_BUFFER_LEN = 10
+; Name displayed in mail title
+SUBJECT = %(APP_NAME)s
+; Mail server
+; Gmail: smtp.gmail.com:587
+; QQ: smtp.qq.com:25
+; Note, if the port ends with "465", SMTPS will be used. Using STARTTLS on port 587 is recommended per RFC 6409. If the server supports STARTTLS it will always be used.
+HOST =
+; Do not verify the certificate of the server. Only use this for self-signed certificates
+SKIP_VERIFY = 
+; Use client certificate
+USE_CERTIFICATE = false
+CERT_FILE = custom/mailer/cert.pem
+KEY_FILE = custom/mailer/key.pem
+; Mail from address, RFC 5322. This can be just an email address, or the "Name" <email@example.com> format 
+FROM =
+; Mailer user name and password
+USER =
+PASSWD =
+
+[oauth]
+ENABLED = false
+
+[oauth.github]
+ENABLED = false
+CLIENT_ID =
+CLIENT_SECRET =
+SCOPES = https://api.github.com/user
+AUTH_URL = https://github.com/login/oauth/authorize
+TOKEN_URL = https://github.com/login/oauth/access_token
+
+; Get client id and secret from
+; https://console.developers.google.com/project
+[oauth.google]
+ENABLED = false
+CLIENT_ID =
+CLIENT_SECRET =
+SCOPES = https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile
+AUTH_URL = https://accounts.google.com/o/oauth2/auth
+TOKEN_URL = https://accounts.google.com/o/oauth2/token
+
+[oauth.qq]
+ENABLED = false
+CLIENT_ID =
+CLIENT_SECRET =
+SCOPES = get_user_info
+; QQ 互联
+AUTH_URL = https://graph.qq.com/oauth2.0/authorize
+TOKEN_URL = https://graph.qq.com/oauth2.0/token
+
+[oauth.weibo]
+ENABLED = false
+CLIENT_ID =
+CLIENT_SECRET =
+SCOPES = all
+AUTH_URL = https://api.weibo.com/oauth2/authorize
+TOKEN_URL = https://api.weibo.com/oauth2/access_token
+
+[cache]
+; Either "memory", "redis", or "memcache", default is "memory"
+ADAPTER = memory
+; For "memory" only, GC interval in seconds, default is 60
+INTERVAL = 60
+; For "redis" and "memcache", connection host address
+; redis: network=tcp,addr=:6379,password=macaron,db=0,pool_size=100,idle_timeout=180
+; memcache: `127.0.0.1:11211`
+HOST =
+
+[session]
+; Either "memory", "file", "redis" or "mysql", default is "memory"
+PROVIDER = memory
+; Provider config options
+; memory: not have any config yet
+; file: session file path, e.g. `data/sessions`
+; redis: network=tcp,addr=:6379,password=macaron,db=0,pool_size=100,idle_timeout=180
+; mysql: go-sql-driver/mysql dsn config string, e.g. `root:password@/session_table`
+PROVIDER_CONFIG = data/sessions
+; Session cookie name
+COOKIE_NAME = i_like_gogits
+; If you use session in https only, default is false
+COOKIE_SECURE = false
+; Enable set cookie, default is true
+ENABLE_SET_COOKIE = true
+; Session GC time interval, default is 86400
+GC_INTERVAL_TIME = 86400
+; Session life time, default is 86400
+SESSION_LIFE_TIME = 86400
+
+[picture]
+; The place to picture data, either "server" or "qiniu", default is "server"
+SERVICE = server
+AVATAR_UPLOAD_PATH = data/avatars
+; Chinese users can choose "duoshuo"
+GRAVATAR_SOURCE = gravatar
+DISABLE_GRAVATAR = false
+
+[attachment]
+; Whether attachments are enabled. Defaults to `true`
+ENABLE = true
+; Path for attachments. Defaults to `data/attachments`
+PATH = data/attachments
+; One or more allowed types, e.g. image/jpeg|image/png
+ALLOWED_TYPES = image/jpeg|image/png
+; Max size of each file. Defaults to 32MB
+MAX_SIZE = 32
+; Max number of files per upload. Defaults to 10
+MAX_FILES = 10
+
+[time]
+; Specifies the format for fully outputed dates. Defaults to RFC1123
+; Special supported values are ANSIC, UnixDate, RubyDate, RFC822, RFC822Z, RFC850, RFC1123, RFC1123Z, RFC3339, RFC3339Nano, Kitchen, Stamp, StampMilli, StampMicro and StampNano
+; For more information about the format see http://golang.org/pkg/time/#pkg-constants
+FORMAT =
+
+[log]
+ROOT_PATH =
+; Either "console", "file", "conn", "smtp" or "database", default is "console"
+; Use comma to separate multiple modes, e.g. "console, file"
+MODE = console
+; Buffer length of channel, keep it as it is if you don't know what it is.
+BUFFER_LEN = 10000
+; Either "Trace", "Debug", "Info", "Warn", "Error", "Critical", default is "Trace"
+LEVEL = Trace
+
+; For "console" mode only
+[log.console]
+LEVEL =
+
+; For "file" mode only
+[log.file]
+LEVEL =
+; This enables automated log rotate(switch of following options), default is true
+LOG_ROTATE = true
+; Max line number of single file, default is 1000000
+MAX_LINES = 1000000
+; Max size shift of single file, default is 28 means 1 << 28, 256MB
+MAX_SIZE_SHIFT = 28
+; Segment log daily, default is true
+DAILY_ROTATE = true
+; Expired days of log file(delete after max days), default is 7
+MAX_DAYS = 7
+
+; For "conn" mode only
+[log.conn]
+LEVEL =
+; Reconnect host for every single message, default is false
+RECONNECT_ON_MSG = false
+; Try to reconnect when connection is lost, default is false
+RECONNECT = false
+; Either "tcp", "unix" or "udp", default is "tcp"
+PROTOCOL = tcp
+; Host address
+ADDR =
+
+; For "smtp" mode only
+[log.smtp]
+LEVEL =
+; Name displayed in mail title, default is "Diagnostic message from serve"
+SUBJECT = Diagnostic message from serve
+; Mail server
+HOST =
+; Mailer user name and password
+USER =
+PASSWD =
+; Receivers, can be one or more, e.g. ["1@example.com","2@example.com"]
+RECEIVERS =
+
+; For "database" mode only
+[log.database]
+LEVEL =
+; Either "mysql" or "postgres"
+DRIVER =
+; Based on xorm, e.g.: root:root@localhost/gogs?charset=utf8
+CONN =
+
+[git]
+MAX_GIT_DIFF_LINES = 10000
+; Arguments for command 'git gc', e.g.: "--aggressive --auto"
+; see more on http://git-scm.com/docs/git-gc/1.7.5
+GC_ARGS = 
+
+; Git health check.
+[git.fsck]
+ENABLE = true
+; Execution interval in hours. Default is 24.
+INTERVAL = 24
+; Arguments for command 'git fsck', e.g.: "--unreachable --tags"
+; see more on http://git-scm.com/docs/git-fsck/1.7.5
+ARGS = 
+
+[i18n]
+LANGS = en-US,zh-CN,zh-HK,de-DE,fr-FR,nl-NL,lv-LV,ru-RU,ja-JP,es-ES,pt-BR,pl-PL
+NAMES = English,简体中文,繁體中文,Deutsch,Français,Nederlands,Latviešu,Русский,日本语,Español,Português,Polski
+
+[other]
+SHOW_FOOTER_BRANDING = false

+ 267 - 0
gogs.changelog

@@ -0,0 +1,267 @@
+2015-03-26
+
+	* V0.6.1
+	Bug fix: Inline code markdown with leading hash is rendered as issue index #637
+	Bug fix: Non-logged users can view organization page when REQUIRE_SIGNIN_VIEW = true #1101
+	Bug fix: New release button is always available to everyone #1114
+	Bug fix: Cannot update mirror repository after transfer ownership #1120
+	Bug fix: Other member of teams in same organization get access to repository when teams do not have relations to the repository 
+	Bug fix: LDAP add and edit forms are misleading #1124
+	Bug fix: Team member access lost when adding repository collaborator #1143
+	Improvement: Hide Gravatar e-mail setting field when Gravatar is disabled #1098
+	Improvement: Allow to migrate through git:// protocol #1105
+	Improvement: Add config option [service] DISABLE_MINIMUM_KEY_SIZE_CHECK to not check minimum key size with corresponding type #1133
+	Improvement: Do not exposure database password when it's not first time launch installation #1140
+	Others: Use fake@gogs.local as default Git user.email setting rather than private e-mail #1089
+
+2015-03-19
+
+	* V0.6.0
+	Bug fix: Edit Account does not take into consideration password rules #851
+	Bug fix: Person in multiple teams has incorrect access #858
+	Bug fix: Issue label amount not updated on issue removal #933
+	Bug fix: Can push to mirror repository #948
+	Bug fix: Check template version before loading custom configuration #954
+	Bug fix: Didn't check if attachments and avatars path in configuration is a absolutely path
+	Bug fix: Duplicated suburl prefix in feeds #988
+	Bug fix: Cannot delete repository with LDAP account #1006
+	Bug fix: Cannot handle SubModule without a .gitmodules entry #1023
+	Bug fix: HTTP/HTTPS push update function call panic #1037
+	Bug fix: Missing suburl prefix on admin panel #1043
+	Bug fix: Landing page setting does not consider suburl prefix #1055
+	Bug fix: Missing link in bare repository page for Help #1082
+	Improvement: Allow MySQL socket connection instead of TCP #872
+	Improvement: Able to use TLS client certificate for SMTP #943
+	Improvement: Fix: 504 5.5.2 : Helo command rejected #973
+	Feature: Able to import local Git repositories #99
+	Feature: Allow multiple e-mail addresses #755
+
+2015-01-05
+
+	* V0.5.11
+	Bug fix: Git SubModules result 500 error #741
+	Bug fix: Showing activities for private repositories in user profile #751
+	Bug fix: User who made activities no longer exists result 500 error #754
+	Bug fix: Auto-input username in organization invite page includes full name
+	Bug fix: Mirror repository does not work with SQLite3 #805
+	Bug fix: Wrong image address when rendering Markdown files #808
+	Bug fix: Improvements
+	Bug fix: Able to skip verification when send mails and use TLS when port is 465 #761
+	Bug fix: Optmize git-fsck config options #820
+	Feature: Able to send mails with CRAM-MD5 authentication #762
+
+2014-12-13
+
+	* V0.5.9
+	Bug fix: Invalid links to user profile page in admin panel
+	Bug fix: Templating error on settings page of bare repository #643
+	Bug fix: Panic when no SSH authorized_keys file exists for command gogs fix location #659
+	Bug fix: Commits list doesn’t show the oldest page #664
+	Bug fix: User home links in issue page no longer invalid #682
+	Bug fix: Avatar email addresses with uppercase resolve to wrong Gravatar hash #700
+	Bug fix: Markdown table requires padding #703
+	Bug fix: Cannot display GBK content in diff page #711
+	Bug fix: HTTP basic authentication failed when password contains : #723
+	Improvement: Expose full_name in user search API #677
+	Improvement: Added issue link rendering in commit messages #712
+	Feature: Able to upload custom avatar #139
+	Feature: Able to set explore page as non-logged users’ landing page through config option [server] LANDING_PAGE #543
+	Feature: Run git fsck as cron job and git gc as admin operation #580
+	Feature: Able to view public key list of user by /:username.keys #652
+	Feature: Add Latvian languages.
+
+2014-11-19
+
+	* V0.5.8
+	Bug fix: Fix vulnerabilities CVE-2014-8681 CVE-2014-8682 CVE-2014-8683
+	Bug fix: Branch/tag name cannot contain / #101 #255
+	Bug fix: ENABLE_GZIP options does not work #412
+	Bug fix: Line numbers are misaligned on Firefox #457
+	Bug fix: Git hook does’t filter \r character #546
+	Bug fix: File view raw and history buttons don’t show #550
+	Bug fix: Some small problems about the alignment #554
+	Bug fix: Redis as cache adapter does not work
+	Bug fix: Cannot show relative path image in Markdown files
+	Bug fix: UI break when commit message is very long #570
+	Bug fix: HTTP/HTTPS clone does not handle GZIP encoding #572
+	Bug fix: Cannot see private repositories when view own profile page #605
+	Bug fix: Wrong MIT LICENSE content file #608
+	Improvement: Allow collaborators to see private repositories in profile page
+	Feature: Able to fork repository #5
+	Feature: Drone CI integration #12
+	Feature: Able to view comparison page for 2 commits
+	Feature: Able to set [picture] GRAVATAR_SOURCE = duoshuo to use Chinese mirror of Gravatar
+	Feature: Able to delete all repositories archives through admin panel #635
+
+2014-10-10
+
+	* V0.5.5
+	Bug fix: Cannot download repository archive #495
+	Bug fix: Cannot view repository by tag
+	Bug fix: Cannot transfer repository from organization to individual
+	Bug fix: Error occurs when owner transfers repository to its collaborator
+	Bug fix: Does not support annotated tag #515
+	Bug fix: Broken authentication logic
+	Improvement: Improve e-mail security #249
+	Improvement: Fix missing inline code Markdown style #491
+	Improvement: Add directory level commit message in repository list view
+	Improvement: Change issue title length limitation to 255 characters #522
+	Improvement: Allow mail with self-signed certificates
+	Improvement: Allow custom locale files
+	Feature: Add support for Git hooks #264
+	Feature: Allow Gogs to run from a suburl behind a reverse proxy #463
+	Feature: Add gogs cert command to generate files for self-signed HTTPS #487
+	Feature: Add support for custom robots.txt
+	Feature: Add basic support for submodule
+	Feature: Add French, Dutch and Traditional Chinese languages.
+	Feature: Add system notices for admin.
+
+2014-09-18
+
+	* V0.5.2
+	Bug fix: Incorrect permission check of ~/.ssh/ #458
+	Bug fix: Can access some pages without signin with REQUIRE_SIGNIN_VIEW=true #464
+	Bug fix: Templating error html/template: "user/activate" is undefined #465
+	Bug fix: Missing arguments in TimeSince #473
+	Bug fix: Wrong action permission check in organization dashboard #474
+	Bug fix: Cannot add new SSH Key in Windows #475
+	Bug fix: Cannot transfer repository ownership #481
+	Improvement: Downgrade Git requirement to 1.7.1 #476
+	Improvement: Add French translation #479
+	Improvement: Add git -> MAX_GITDIFF_LINES option to set max show line numbers of Git Diff page
+	Other: Demo site use HTTPS with new domain https://try.gogs.io
+
+2014-09-15
+
+	* V0.5.0
+	Bug fix: Panic when view releases that were created by Gogs #197
+	Bug fix: Content lost if user changes milestone or assignee #216
+	Bug fix: Webhook doesn’t deliver for SSH pushes #242
+	Bug fix: Mirror repositories are not updated at all #258
+	Bug fix: Not able to serve static files in Windows #271
+	Bug fix: Dashboard issue link is incomplete #273
+	Bug fix: Collaborators are able to change repository settings
+	Bug fix: Edit issue label does not require repository owner or collaborator #303
+	Bug fix: Milestone issue stats not update when reopening/closing issue #340
+	Bug fix: Incorrect max/min limitation error message #340
+	Bug fix: Missing trailing ‘/’ in ROOT_URL causes problems #367
+	Bug fix: SSH keys that include new lines can’t be deleted from authorized_keys #370
+	Improvement: Add webhook section for configuring web hook task interval and deliver timeout
+	Improvement: Add download TAR.GZ button in repository viewer
+	Improvement: Sort releases by created time if they have same number of commits #199
+	Improvement: Add Git installation and version check in start
+	Improvement: Able to show precise time on commit page #281
+	Improvement: Make possible for administrators to change user’s password #291
+	Improvement: Add more SSH key type verification support #293
+	Improvement: Allow clickable links in the repository description #300
+	Improvement: Allow /:username as user home page route
+	Improvement: Change passoword length limitation to 255 #340
+	Improvement: Add .mkd as Markdown file extension #362
+	Improvement: Allow . in repository name #453
+	Feature: Add command gogs fix location <old path> to handle Gogs app location change
+	Feature: Support edit release and save as draft
+	Feature: Add cron task and running process monitor panel
+	Feature: Add database adapter for logging
+	Feature: Add delete all inactivate accounts operation in admin panel
+	Feature: Add reverse proxy authentication support #165
+	Feature: Add application level GZIP support by server -> ENABLE_GZIP config option.
+	Feature: Closing issues through commits #302
+	Feature: Able to star/unstar a repository
+	Feature: Ability to attach files to issues (attachments) #307
+	Feature: Able to create/manage/delete organization with team management
+	Feature: Add Slack webhook integration #379
+	Feature: Add Organization-level Webhooks #442
+	Other: Official website brand new design(gogs.io)
+	Other: Whole site new UI design
+	Other: Most of pages implement multiple languages
+	Other: Add Ubuntu install package #455
+
+2014-06-02
+
+	* V0.4.1:
+	Bug fix: Cannot clone through SSH with non-default port(22) #94
+	Bug fix: Cannot migrate repository when use PostgreSQL #141
+	Bug fix: Show private repository activities on public activities list #148
+	Bug fix: Does not verify admin user name in install page #149
+	Bug fix: Does not update all accesses when change user name #150
+	Bug fix: Panic when no master branch
+	Bug fix: Panic when delete a branch #155
+	Bug fix: Redirect to 404 page when commenter is not the repository owner #159
+	Bug fix: Show 500 page when poster of issue no longer exists #167
+	Bug fix: Using @ in code block tries to make a mention #178
+	Improvement: Able to unbind social account from database
+	Improvement: Add mail notification for new comment and mentioned in new comment
+	Improvement: Add comment on issue activity
+	Improvement: Add clean unbind OAuthes operation in admin panel
+	Improvement: Underlying system of issue tracker
+	Improvement: Able to log message to different adapters by level at same time
+	Improvement: Show collaborative repositories in dashboard
+	Improvement: Able to preview option for editing of issue #204
+	Improvement: Able to set GOGS_CUSTOM envrionment variable to set global custom path #209
+	Improvement: Add log -> ROOT_PATH option for custom log file path #209
+	Feature: Support SMTP authentication #8
+	Feature: Support user name contains dot . #91
+	Feature: Support add/remove repository collaborators
+	Feature: Add server -> DISABLE_ROUTER_LOG option for disabling router log
+	Feature: Add picture -> DISABLE_GRAVATAR option for disabling Gravatar
+	Feature: Add command gogs dump for dumping files and database
+	Feature: Support webhook services #98
+	Feature: Add read/unread status to issue
+	Feature: Add assignee to issue
+	Feature: Add history page for file #166
+	Feature: Support add custom .gitignore and license files by adding them to custom/conf/gitignore and custom/conf/license #174
+	Feature: Add milestone to issue tracker
+	Feature: Support download tar.gz for releases #186
+	Feature: Add server -> STATIC_ROOT_PATH option for indicating custom template and static file path #209
+	Other: Official website online(gogs.io)
+	Other: Support install with Vagrant(note)
+	Other: Support install from AUR packages #176
+
+2014-04-28
+
+	* V0.3.1 :
+	Bug fix: Panic when try to get author of tag when there isn’t one #92
+	Bug fix: Problems with Docker setup scripts #124 #129
+	Bug fix: Picture overflows when size is extremely large in single file page
+	Improvement: Remember database option status in install page
+	Feature: Basic support for LDAP/Microsoft Active Directory #112
+	Feature: Offline mode to disable fetch static resources from CDN
+	Feature: Support log in by e-mail
+	Other: Batch of typo and grammar fix
+	Other: Solution for MySQL initialization error when use wrong engine(note)
+	Other: Make SQLite3 as default database option when enabled
+
+2014-04-23
+
+	* V0.3.0 :
+	Bug fix: One-click copy button of clone URL in repository viewer doesn’t work(note)
+	Bug fix: Doesn’t delete corresponding accesses, watches when delete user
+	Bug fix: Server log doesn’t log into correct file
+	Improvement: Add corresponding issue link to create issue notify mail
+	Improvement: Add salt for every single user
+	Improvement: Use PBKDF2 and user salt for encoding user password(note)
+	Improvement: Huge time, CPU and memory reduction of getting repository files
+	Improvement: Show commits list by page, not all at once
+	Improvement: Use build tag to enable SQLite3 support(note)
+	Feature: Support rename repository/user
+	Feature: Support transfer repository
+	Feature: Support reset user password
+	Feature: Support detect @someone, #issueNum, SHA1 and issue link in markdown render
+	Feature: Support mail notify for someone is mentioned in creating issue
+	Feature: Support go get in meta block
+	Feature: Support setting default branch
+	Feature: Support HTTP(S) push
+	Feature: Support search commits by keyword in specific branch
+	Feature: Support private repository
+	Feature: Support migrate and mirror public/private repository
+	Feature: Support social account login(GitHub, Google, QQ, Weibo)
+	Feature: Support view and add new release(use existing tag or create a new one)
+	Feature: Support download zip archive from any given commit
+	Feature: Support browse code by tag
+	Other: Support deploy with Docker(note)
+	Other: Git version requirement for both server and client sides become v1.6.6(Smart HTTP support).
+
+2014-04-01
+
+	* V0.2.0 :
+	First public release.

+ 42 - 0
gogs.install

@@ -0,0 +1,42 @@
+pre_install() {
+  if ! getent group gogs >/dev/null; then
+    groupadd --system gogs
+  fi
+  if ! getent passwd gogs >/dev/null; then
+    useradd -m --system -c 'gogs daemon users' -g gogs -s /bin/false gogs
+  fi
+  chsh gogs -s /usr/bin/bash
+}
+
+post_install(){
+	mkdir -p /var/log/gogs
+	chown -R gogs:gogs /var/log/gogs
+	chown -R gogs:gogs /srv/gogs
+
+	systemctl daemon-reload
+}
+
+pre_upgrade(){
+	systemctl stop gogs.service
+	
+	pre_install $1
+}
+
+post_upgrade() {
+	post_install $1
+	systemctl start gogs.service
+}
+
+pre_remove() {
+	systemctl stop gogs.service
+	systemctl disable gogs.service
+}
+
+post_remove() {
+  if getent passwd gogs >/dev/null; then
+    userdel -r gogs
+  fi
+  if getent group gogs >/dev/null; then
+    groupdel gogs
+  fi
+}

+ 14 - 0
gogs.service

@@ -0,0 +1,14 @@
+[Unit]
+Description=Gogs (Go Git Service) server
+After=syslog.target
+After=network.target
+
+[Service]
+Type=simple
+User=gogs
+Group=gogs
+ExecStart=/usr/share/gogs/gogs web --config /srv/gogs/conf/app.ini
+WorkingDirectory=/usr/share/gogs/
+
+[Install]
+WantedBy=multi-user.target