Gogs is a painless self-hosted Git service
 
 
 
 
Go to file
ᴜɴᴋɴᴡᴏɴ 5ad2fdcf0b
api: `GET /repos/:owner/:repo/contents/:path` ()
* support API `GET /repos/:owner/:repo/contents/:path`

This PR adds support to :
`GET /repos/:owner/:repo/contents/:path`

Curl:

```bash
curl -H "Authorization: token REDACTED"
http://localhost:3000/api/v1/repos/root/testrepo/contents//master/README.md
-X GET  | jq .
```

Curl  Response:

```bash
{
  "type": "blob",
  "size": 12,
  "name": "README.md",
  "path": "README.md",
  "sha": "70fcb456d436f08462602f26df6fb7e167e7a916",
  "url": "http://localhost:3000/api/v1/repos/root/testrepo/contents/README.md",
  "git_url": "70fcb456d4",
  "html_url": "70fcb456d4",
  "download_url": "http://localhost:3000/api/v1/root/testrepo/raw/README.md",
  "_links": {
    "git": "70fcb456d4",
    "self": "http://localhost:3000/api/v1/repos/root/testrepo/contents/README.md",
    "html": "70fcb456d4"
  },
  "content": "IyB0ZXN0cmVwbwoK"
}

```

* rename - path.go to contents.go

* reorder imports

Co-Authored-By: ᴜɴᴋɴᴡᴏɴ <u@gogs.io>

* rename struct to repoContents and fix field order

Co-Authored-By: ᴜɴᴋɴᴡᴏɴ <u@gogs.io>

* rename variable

Co-Authored-By: ᴜɴᴋɴᴡᴏɴ <u@gogs.io>

* rename GetPathContents to GetContents

Co-Authored-By: ᴜɴᴋɴᴡᴏɴ <u@gogs.io>

* return on server error

Co-Authored-By: ᴜɴᴋɴᴡᴏɴ <u@gogs.io>

* resolve conflicts introduced via git web ui

* make constants as method variables

* handle dir type case last

* fix func and var names

* implement suggested changes in review

* refactor smaller funcs to be part of GetContent

* fix content type check for blob after refactoring

* changes based on suggestions

* read full file, return empty json array

* don't set submoduleURL

* set server err msg to method name

* set target to be blob data for symlinks

* Update contents.go

Co-authored-by: ᴜɴᴋɴᴡᴏɴ <u@gogs.io>
2020-03-05 16:15:38 +08:00
.github
.packager pkgr: update heroku-buildpack to latest () 2020-03-01 22:46:39 +08:00
conf locale: sync from Crowdin () 2020-03-04 02:28:13 +08:00
docker docker: fix link to Docker Hub 2020-02-22 19:30:17 +08:00
docs docs: improve local development guide 2020-02-25 02:12:11 +08:00
internal api: `GET /repos/:owner/:repo/contents/:path` () 2020-03-05 16:15:38 +08:00
public js: fix jQuery error 2020-02-29 23:52:35 +08:00
scripts
templates template: improve admin config page 2020-03-01 03:21:13 +08:00
.codebeatignore
.codebeatsettings
.dockerignore
.editorconfig js: fix jQuery error 2020-02-29 23:52:35 +08:00
.gitattributes
.gitignore
.mailmap
.pkgr.yml pkgr: update heroku-buildpack to latest () 2020-03-01 22:46:39 +08:00
.travis.yml conf: overhaul settings () 2020-02-29 16:29:17 +08:00
CHANGELOG.md template: improve admin config page 2020-03-01 03:21:13 +08:00
Dockerfile
Dockerfile.aarch64
Dockerfile.aarch64hub
Dockerfile.rpi
Dockerfile.rpihub
LICENSE
Makefile
README.md README: update acknowledgments 2020-02-27 20:24:40 +08:00
README_ZH.md
appveyor.yml conf: add unit tests () 2020-02-29 22:24:20 +08:00
codecov.yml conf: overhaul settings () 2020-02-29 16:29:17 +08:00
go.mod pkgr: update heroku-buildpack to latest () 2020-03-01 22:46:39 +08:00
go.sum go.mod: update unknwon.dev/clog/v2 to v2.1.1 2020-02-22 20:43:58 +08:00
gogs.go build: requires Go 1.13 2020-02-28 23:43:19 +08:00

README.md

Gogs - A painless self-hosted Git service

Build status Build status Discord Sourcegraph

Repository

简体中文

🔮 Vision

The Gogs (/gɑgz/) 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

  • User dashboard, user profile and activity timeline.
  • Access repositories via SSH, HTTP and HTTPS protocols.
  • User, organization and repository management.
  • Repository and organization webhooks, including Slack, Discord and Dingtalk.
  • Repository Git hooks and deploy keys.
  • Repository issues, pull requests, wiki, protected branches and collaboration.
  • Migrate and mirror repositories with wiki from other code hosts.
  • Web editor for quick editing repository files and wiki.
  • Jupyter Notebook and PDF rendering.
  • Authentication via SMTP, LDAP, reverse proxy, GitHub.com and GitHub Enterprise with 2FA.
  • Customize HTML templates, static files and many others.
  • Rich database backend, including PostgreSQL, MySQL, SQLite3, MSSQL and TiDB.
  • Have localization over 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:

Deploy to cloud

Tutorials

📦 Software, service and product support

🙇‍♂️ Acknowledgments

👋 Contributors

License

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