Gogs is a painless self-hosted Git service
 
 
 
 
Go to file
Achilleas Koutsou dc13eb6df0 pkg/context: Render live notice banner from file (#5750)
* pkg/context: Render live notice banner from file

- Contexter checks if there is a file called 'notice' under the
GOGS_CUSTOM directory and loads it.
- The first line is treated as a header/title and everything else as the
message body.
- Message body is rendered as HTML (tags allowed).
- File size is limited to 1024 bytes.
- File mime type must be text.
- Notice is rendered in head.tmpl for all pages.

* pkg/context: Rename maxlen to maxSize

Rename maxlen to maxSize for the maximum size (in bytes) of the notice
file to render.
Define the variable when needed to avoid instantiating it when the file
doesn't exist.

Co-Authored-By: ᴊ. ᴄʜᴇɴ <u@gogs.io>

* pkg/context: Package name after license header

Co-Authored-By: ᴊ. ᴄʜᴇɴ <u@gogs.io>

* pkg/context: Don't print 'Found notice file'

Becomes too verbose as it prints on every page load when the file
exists.

* pkg/context: Match project conventions

Import order and grouping

Variable names:
    fileloc -> fpath
    fp -> f
    finfo -> fi

* pkg/context: Remove empty line

Co-Authored-By: ᴊ. ᴄʜᴇɴ <u@gogs.io>

* pkg/context: Render notice as markdown

Server notice file should be named 'notice.md'.  The contents of the
file are treated as markdown and rendered as a warning message at the
top of every page.

* Update notice.go


Co-authored-by: ᴊ. ᴄʜᴇɴ <u@gogs.io>
2019-07-27 23:47:35 -07:00
.github .github: adjust issue templates 2018-12-14 18:35:01 -05:00
cmd templates: make state changing routes to POST method (#5541) 2018-12-06 22:58:02 -05:00
conf locale: sync from Crowdin 2019-06-27 08:32:59 -04:00
docker docker: prevent Gogs from running a recursive chown on each boot (#5724) 2019-06-16 13:42:56 -04:00
models Include the Sha in webhook create payloads. (#5689) 2019-07-09 17:26:19 -07:00
packager packager: update files (#4181) 2017-02-23 15:33:58 -05:00
pkg pkg/context: Render live notice banner from file (#5750) 2019-07-27 23:47:35 -07:00
public public/css: make less (#5317) 2018-12-25 08:58:59 -05:00
routes auth: coding style and glitches fixes for GitHub login source (#5340) 2018-12-18 16:46:50 -05:00
scripts scripts: add NoNewPrivileges=true to systemd unit file (#5381) 2018-08-16 19:07:36 +08:00
templates pkg/context: Render live notice banner from file (#5750) 2019-07-27 23:47:35 -07:00
vendor Include the Sha in webhook create payloads. (#5689) 2019-07-09 17:26:19 -07:00
.bra.toml Makefile: correct errors 2017-07-14 16:48:55 -04:00
.codebeatignore Add .mailmap 2016-08-11 16:57:48 -07:00
.codebeatsettings Adjust .codebeatsettings 2016-08-08 23:26:10 -07:00
.dockerignore docker: add new Dockerfile.docker-ce for docker-ce(>=v17.06) to build docker image (#5322) 2018-08-13 20:50:25 +08:00
.editorconfig milestone: only show issue-related count under issue list (#4316) 2017-03-24 14:00:01 -04:00
.gitattributes locale: sync from Crowdin 2018-04-25 13:50:48 -04:00
.gitignore webhook: minor text change on Discord 2017-02-19 16:07:28 -05:00
.mailmap Add .mailmap 2016-08-11 16:57:48 -07:00
.pkgr.yml pkgr: update spec to build on Debian 9 (Stretch) (#5083) 2018-03-08 02:14:18 -05:00
.travis.yml *: remove Go 1.7 support 2018-12-19 08:38:10 -05:00
Dockerfile docker: add new Dockerfile.docker-ce for docker-ce(>=v17.06) to build docker image (#5322) 2018-08-13 20:50:25 +08:00
Dockerfile.aarch64 docker: allow setting UID and GID when running a container (#4776) 2017-10-13 16:26:39 -04:00
Dockerfile.aarch64hub Dockerfile.aarch64hub: install shadow package (#5481) 2018-11-05 16:46:53 -05:00
Dockerfile.rpi docker: allow setting UID and GID when running a container (#4776) 2017-10-13 16:26:39 -04:00
Dockerfile.rpihub docker: allow setting UID and GID when running a container (#4776) 2017-10-13 16:26:39 -04:00
LICENSE Change LICENSE copyright holder name [CI SKIP] 2016-08-09 13:05:15 -07:00
Makefile Makefile: only read GOPATH from env var 2018-09-18 12:33:14 -04:00
README.md README: fix tutorial links (#5641) 2019-02-28 19:54:07 -05:00
README_ZH.md README: fix tutorial links (#5641) 2019-02-28 19:54:07 -05:00
appveyor.yml ci: update appveyor.yml 2018-12-03 20:00:28 -05:00
gogs.go locale: sync from Crowdin 2019-06-27 08:32:59 -04:00

README.md

Gogs Build Status Build status Crowdin Discord

Current tip version: .VERSION (see Releases for binary versions)
Web UI Preview
Dashboard Repository Editor
Profile Diff Repository Settings
Webhook Organization Admin Dashboard

Important Notes

  1. YOU MUST READ Contributing Code BEFORE STARTING TO WORK ON A PULL REQUEST.
  2. Due to testing purpose, data of try.gogs.io was reset in Jan 28, 2015 and will reset multiple times after. Please do NOT put your important data on the site.
  3. The demo site try.gogs.io is running under develop branch.
  4. If you think there are vulnerabilities in the project, please talk privately to u@gogs.io, and the name you want to be credited as. Thanks!
  5. If you're interested in using APIs, we have experimental support with documentation.
  6. If your team/company is using Gogs and would like to put your logo on our website, contact us by any means.

简体中文

Vision

This project aims to build a simple, stable and extensible self-hosted Git service that can be setup in the most painless way. With Go, this can be done with an independent binary distribution across ALL platforms that Go supports, including Linux, macOS, Windows and ARM.

Overview

Features

  • Activity timeline
  • SSH and HTTP/HTTPS protocols
  • SMTP/LDAP/Reverse proxy authentication
  • Reverse proxy with sub-path
  • Account/Organization/Repository management
  • Add/Remove repository collaborators
  • Repository/Organization webhooks (including Slack and Discord)
  • Repository Git hooks/deploy keys
  • Repository issues, pull requests, wiki and protected branches
  • Migrate and mirror repository and its wiki
  • Web editor for repository files and wiki
  • Jupyter Notebook
  • Two-factor authentication
  • Gravatar and Federated avatar with custom source
  • Mail service
  • Administration panel
  • Supports MySQL, PostgreSQL, SQLite3, MSSQL and TiDB (via MySQL protocol)
  • Multi-language support (30 languages)

Hardware Requirements

  • A Raspberry Pi or $5 Digital Ocean Droplet is more than enough to get you started. Some even use 64MB RAM Docker CaaS.
  • 2 CPU cores and 512MB RAM would be the baseline for teamwork.
  • Increase CPU cores when your team size gets significantly larger, memory footprint remains low.

Browser Support

  • Please see Semantic UI for specific versions of supported browsers.
  • The smallest resolution officially supported is 1024*768, however the UI may still look right in smaller resolutions, but no promises or fixes.

Installation

Make sure you install the prerequisites first.

There are 6 ways to install Gogs:

Tutorials

Screencasts

Deploy to Cloud

Software and Service Support

Product Support

Acknowledgments

Contributors

License

This project is under the MIT License. See the LICENSE file for the full license text.

FOSSA Status