Giter VIP home page Giter VIP logo

git-module's Introduction

gogs-brand

GitHub Workflow Status Discord Sourcegraph

简体中文

🔮 Vision

The Gogs (/gɑgz/) project aims to build a simple, stable and extensible self-hosted Git service that can be set up 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-based systems.

📡 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, deploy keys and Git LFS.
  • 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 and TiDB.
  • Have localization over 31 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

This project is proundly supported by:

Other acknowledgments:

  • Thanks Egon Elbre for designing the original version of the logo.
  • Thanks Crowdin for sponsoring open source translation plan.
  • Thanks MonoVM for sponsoring VPS services.
  • Thanks Buildkite for sponsoring open source CI/CD plan.

👋 Contributors

⚖️ License

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

git-module's People

Contributors

0xbaadf00d avatar asedge avatar aymanbagabas avatar bharatnc avatar bjschafer avatar cez81 avatar codelingoteam avatar dependabot[bot] avatar devilmengcry avatar dsh0416 avatar gdewald avatar goldbattle avatar gronke avatar houtmanj avatar jonatan5524 avatar manfer avatar moltam avatar mrexodia avatar nanoant avatar novaeye avatar odinuge avatar richmahn avatar sermojohn avatar strk avatar tanapoln avatar tekaoh avatar unknwon avatar varphone avatar wolfgangkluge avatar zhukovra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

git-module's Issues

Consider other project name, as git-shell means something else

@unknwon as I mentioned on Gitter, IMHO git-shell is unlucky name. While I understand your intention that you wanted use pure git shell command but there are few caveats:

  1. This project is not a shell, it is a library (module, API, wrapper), see definition of Shell
  2. There is already git-shell part of official Git project and it is something else (a real but restricted login shell in fact) see https://git-scm.com/docs/git-shell

Therefore consider renaming the project to something like go-git-module, go-git-wrapper or some other name which reflects what is the purpose of this project. This will help community to properly lookup your project and help with extending it.

Ability to limit goroutine number

Implement ability to limit the goroutine number on the method GetCommitsInfo. Now, the concurrency goroutine number is hard-coded to 10. Performance regarding, its not a valid value on medium specs computers (usually 2 - 8 core not 10).

Commits without email cause panic()'s

When you have a commit done by an author not having an email address, followed by a push to the repository hosted in Gogs, the method "newSignatureFromCommitline" causes a panic().

It is triggered at signature.go:30 which incorrectly assumes an email address is always entered.

panic: runtime error: slice bounds out of range [recovered]
panic: runtime error: slice bounds out of range

goroutine 1 [running]:
panic(0xd8d900, 0xc4200120e0)
/usr/local/go/src/runtime/panic.go:500 +0x1a1
github.com/urfave/cli.HandleAction.func1(0xc42026b940)
/home/vagrant/gopath/src/github.com/urfave/cli/app.go:478 +0x247
panic(0xd8d900, 0xc4200120e0)
/usr/local/go/src/runtime/panic.go:458 +0x243
github.com/gogits/git-module.newSignatureFromCommitline(0xc420170c65, 0x20, 0x59b, 0x6, 0xffffffffffffff01, 0x6)
/home/vagrant/gopath/src/github.com/gogits/git-module/signature.go:30 +0x489
github.com/gogits/git-module.parseCommitData(0xc420170c00, 0xdc, 0x600, 0xc420170c00, 0xdc, 0x600)
/home/vagrant/gopath/src/github.com/gogits/git-module/repo_commit.go:70 +0x3de
github.com/gogits/git-module.(*Repository).getCommit(0xc4204273e0, 0xa07ed8f8c22f15b8, 0xc698db97c4bfc470, 0xc698db97f4913a13, 0xf4913a13, 0x0, 0x0)
/home/vagrant/gopath/src/github.com/gogits/git-module/repo_commit.go:108 +0x40e
github.com/gogits/git-module.(*Repository).GetCommit(0xc4204273e0, 0xc420423770, 0x28, 0xa, 0x0, 0x0)
/home/vagrant/gopath/src/github.com/gogits/git-module/repo_commit.go:133 +0x88
github.com/gogits/gogs/models.PushUpdate(0x1b, 0xc4204241b0, 0xc, 0xc420411028, 0x6, 0xc42039ac27, 0xa, 0xc420426e20, 0x11, 0xc4204236e0, ...)
/home/vagrant/gopath/src/github.com/gogits/gogs/models/update.go:140 +0x6ba
github.com/gogits/gogs/cmd.handleUpdateTask(0xc420422ea0, 0x24, 0xc420417000, 0xc42015ec00, 0xc42039ac27, 0xa, 0x0)
/home/vagrant/gopath/src/github.com/gogits/gogs/cmd/serve.go:111 +0x361
github.com/gogits/gogs/cmd.runServ(0xc420321040, 0x0, 0x0)
/home/vagrant/gopath/src/github.com/gogits/gogs/cmd/serve.go:279 +0xcd4
reflect.Value.call(0xd632e0, 0xef59f0, 0x13, 0xe5a833, 0x4, 0xc42026b900, 0x1, 0x1, 0x475128, 0xe42fe0, ...)
/usr/local/go/src/reflect/value.go:434 +0x5c8
reflect.Value.Call(0xd632e0, 0xef59f0, 0x13, 0xc42026b900, 0x1, 0x1, 0x0, 0xc42026b8e0, 0x47e056)
/usr/local/go/src/reflect/value.go:302 +0xa4
github.com/urfave/cli.HandleAction(0xd632e0, 0xef59f0, 0xc420321040, 0x0, 0x0)
/home/vagrant/gopath/src/github.com/urfave/cli/app.go:487 +0x1e0
github.com/urfave/cli.Command.Run(0xe5b2d7, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe8d556, 0x2f, 0x0, ...)
/home/vagrant/gopath/src/github.com/urfave/cli/command.go:186 +0xc2b
github.com/urfave/cli.(*App).Run(0xc420338000, 0xc42000c200, 0x4, 0x4, 0x0, 0x0)
/home/vagrant/gopath/src/github.com/urfave/cli/app.go:240 +0x611
main.main()
/home/vagrant/gopath/src/github.com/gogits/gogs/gogs.go:41 +0x321

should Blob() func return Blob for types EntryBlob and EntryExec ?

I use the gogs api for fetching repo content:

https://github.com/gogs/gogs/blob/master/internal/route/api/v1/api.go#L274-L276

I realized that for all executable files (mostly bash scripts), I get the following as the file content:

{"message":"the entry is not a blob","url":"https://github.com/gogs/docs-api"} 

Digging a little bit, I realized that the (t *Tree) Blob(subpath string, opts ...LsTreeOptions) (*Blob, error) func only returns Blob() if the entry is of type Blob:

// Blob returns the blob object by given subpath of the tree.
func (t *Tree) Blob(subpath string, opts ...LsTreeOptions) (*Blob, error) {
	e, err := t.TreeEntry(subpath, opts...)
	if err != nil {
		return nil, err
	}

	if e.IsBlob() {
		return e.Blob(), nil
	}

	return nil, ErrNotBlob
}

https://github.com/gogs/git-module/blob/master/tree_blob.go#L56

I think this is why the gogs conents api returns error message:

switch {
		case entry.IsBlob(), entry.IsExec():
			content.Type = "file"
			p, err := entry.Blob().Bytes()
			if err != nil {
				return nil, errors.Wrap(err, "get blob content")
			}
			content.Encoding = "base64"
			content.Content = base64.StdEncoding.EncodeToString(p)
			content.GitURL = fmt.Sprintf("%s/git/blobs/%s", repoURL, entry.ID().String())
....

https://github.com/gogs/gogs/blob/master/internal/route/api/v1/repo/contents.go#L87-L91

Can we make (t *Tree) Blob(subpath string, opts ...LsTreeOptions) (*Blob, error) func return contents for EntryExec and EntryBlob. @unknwon is this acceptable, or do you think that I got this all wrong and the fix should be somewhere else?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.