Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Contribution Guidelines

## Reporting Bug or Feature Request

We recommend using Gitopia issues for bug report, feature request and feedback. However, you can ask quick questions on our official [Gitopia Discord](https://discord.gg/mVpQVW3vKE).

Before you open an issue, do a web search, and check for existing open and closed Issues to see if that bug has already been reported. If you find a relevant topic, you can comment on that issue.

Please try to be as detailed as possible. What steps will reproduce the issue? What are you looking in particular feature?

## Submitting Pull Request

### Base branch

In general, always base your work on the `master` branch.

For a bug that's not yet in `master`, find the branch that introduces the bug, and base your work on the tip of that branch.

### Do not rebase commits in your branch.

Avoid rebasing after you open your PRs to reviews. Instead, add more commits to your PR. It's OK to do force pushes if PR was never opened for reviews before.

A reviewer likes to see a linear commit history while reviewing. If you tend to force push from an older commit, a reviewer might lose track in your recent changes and will have to start reviewing from scratch.

Don't worry about adding too many commits. The commits are squashed into a single commit while merging (if needed). Your PR title is used as the commit message.

### Describe changes

Give an explanation for the change(s) that is detailed enough so that people can judge if it is good thing to do, without reading the actual code.

The goal of your commit message is to convey the _what_ and _why_ behind your change.

### Make seperate commits

Make separate commits for logically separate changes.

If your description starts to get too long, that's a sign that you probably need to split up your commit to finer grained pieces.

### Respect existing Code

Bug fix or feature implementation should not break existing functionalities and tests.

### Write Tests

Make sure that you have tests for the bug you are fixing.

### Code must be well written

See [Coding Guidelines](CodingGuidelines.md).
19 changes: 19 additions & 0 deletions CodingGuidelines.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Coding Guidelines

- We use tabs to indent, and interpret tabs as 4 spaces.
- Variables have to be declared at the beginning of the block, before the first statement.
- Variables name should follow Camel casing.
- Make your code readable and sensible. You may put comments if needed.
- Code should obey `gofmt` must not consists of any `go lint` warning.
- Multi-line comments include their delimiters on separate lines from
the text. E.g.
```
/*
* A very long
* multi-line comment.
*/
```
- Do not end error messages with a full stop. Also, do not capitalize the first word, only because it is the first word in the message.
- Avoid introducing a new dependency.

As for more concrete guidelines, just imitate the existing code (this is a good guideline, no matter which project you are contributing to). It is always preferable to match the _local_ convention. New code added to Git suite is expected to match the overall style of existing code. Modifications to existing code is expected to match the style the surrounding code already uses (even if it doesn't match the overall style of existing code).
14 changes: 13 additions & 1 deletion app/gitopia.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package app
import (
"context"

"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/authz"
"github.com/gitopia/git-server/logger"
Expand All @@ -11,6 +12,8 @@ import (
"github.com/ignite/cli/ignite/pkg/cosmosclient"
"github.com/pkg/errors"
"github.com/spf13/viper"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)

const (
Expand Down Expand Up @@ -38,12 +41,21 @@ func NewGitopiaClient(ctx context.Context, account string) (GitopiaClient, error
cosmosclient.WithKeyringBackend(cosmosaccount.KeyringTest),
cosmosclient.WithHome(viper.GetString("keyring_dir")),
cosmosclient.WithAddressPrefix(GITOPIA_ACC_ADDRESS_PREFIX),
cosmosclient.WithGasPrices(viper.GetString("gas_prices")),
)
if err != nil {
return GitopiaClient{}, errors.Wrap(err, "error creating cosmos client")
}

queryClient := types.NewQueryClient(client.Context().GRPCClient)
grpcConn, err := grpc.Dial(viper.GetString("gitopia_grpc_url"),
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithDefaultCallOptions(grpc.ForceCodec(codec.NewProtoCodec(nil).GRPCCodec())),
)
if err != nil {
return GitopiaClient{}, errors.Wrap(err, "error creating grpc client")
}

queryClient := types.NewQueryClient(grpcConn)

return GitopiaClient{
accountName: account,
Expand Down
8 changes: 8 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [v1.0.0] - 2022-10-20

- Bump gitopia version to v1.0.0
- Add authentication in push api
- Don't cache git objects larger than 1Mb in go-git
- Fix certain diffs
- Pass codec during grpc client initialization

## [v0.6.1] - 2022-07-28

### Fixes
Expand Down
3 changes: 2 additions & 1 deletion config_dev.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ git_dir = "/var/repos"
attachment_dir = "/var/attachments"
tm_addr = "http://grpc.gitopia.dev:26657"
key_name = "git-server"
keyring_dir = "/home/ubuntu/git-server"
keyring_dir = "/home/ubuntu/git-server"
gas_prices = "0.001utlore"
3 changes: 2 additions & 1 deletion config_local.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ git_dir = "/var/repos"
attachment_dir = "/var/attachments"
tm_addr = "http://localhost:26657"
key_name = "git-server"
keyring_dir = ""
keyring_dir = ""
gas_prices = ""
3 changes: 2 additions & 1 deletion config_prod.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ git_dir = "/var/repos"
attachment_dir = "/var/attachments"
tm_addr = "http://grpc.gitopia.com:26657"
key_name = "git-server"
keyring_dir = "/home/ubuntu/git-server"
keyring_dir = "/home/ubuntu/git-server"
gas_prices = "0.001ulore"
164 changes: 160 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
module github.com/gitopia/git-server

go 1.16
go 1.18

require (
github.com/buger/jsonparser v1.1.1
github.com/cosmos/cosmos-sdk v0.46.1
github.com/gitopia/gitopia v1.0.0-rc.2
github.com/gitopia/go-git/v5 v5.4.3-0.20211224112515-b2efd9bec92c
github.com/cosmos/cosmos-sdk v0.46.2
github.com/gitopia/gitopia v1.0.0
github.com/gitopia/go-git/v5 v5.4.3-0.20221011074003-f70479dc646c
github.com/go-git/go-billy/v5 v5.3.1
github.com/ignite/cli v0.24.0
github.com/libgit2/git2go/v33 v33.0.4
Expand All @@ -19,4 +19,160 @@ require (
google.golang.org/grpc v1.49.0
)

require (
cloud.google.com/go v0.102.1 // indirect
cloud.google.com/go/compute v1.7.0 // indirect
cloud.google.com/go/iam v0.4.0 // indirect
cloud.google.com/go/storage v1.22.1 // indirect
cosmossdk.io/errors v1.0.0-beta.7 // indirect
cosmossdk.io/math v1.0.0-beta.3 // indirect
filippo.io/edwards25519 v1.0.0-rc.1 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/99designs/keyring v1.2.1 // indirect
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect
github.com/Microsoft/go-winio v0.5.2 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 // indirect
github.com/acomagu/bufpipe v1.0.3 // indirect
github.com/armon/go-metrics v0.4.0 // indirect
github.com/aws/aws-sdk-go v1.40.45 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/bgentry/speakeasy v0.1.0 // indirect
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/btcsuite/btcd v0.22.1 // indirect
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect
github.com/cockroachdb/apd/v2 v2.0.2 // indirect
github.com/confio/ics23/go v0.7.0 // indirect
github.com/cosmos/btcutil v1.0.4 // indirect
github.com/cosmos/cosmos-proto v1.0.0-alpha7 // indirect
github.com/cosmos/go-bip39 v1.0.0 // indirect
github.com/cosmos/gorocksdb v1.2.0 // indirect
github.com/cosmos/iavl v0.19.2-0.20220916140702-9b6be3095313 // indirect
github.com/cosmos/ibc-go/v5 v5.0.0-rc1 // indirect
github.com/cosmos/ledger-cosmos-go v0.11.1 // indirect
github.com/cosmos/ledger-go v0.9.2 // indirect
github.com/danieljoos/wincred v1.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgraph-io/badger/v2 v2.2007.4 // indirect
github.com/dgraph-io/ristretto v0.1.0 // indirect
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
github.com/dustin/go-humanize v1.0.1-0.20200219035652-afde56e7acac // indirect
github.com/dvsekhvalnov/jose2go v1.5.0 // indirect
github.com/emirpasic/gods v1.12.0 // indirect
github.com/felixge/httpsnoop v1.0.1 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/gitopia/go-diff v0.0.0-20221011073329-132b1aebc86c // indirect
github.com/go-git/gcfg v1.5.0 // indirect
github.com/go-kit/kit v0.12.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
github.com/gogo/gateway v1.1.0 // indirect
github.com/gogo/protobuf v1.3.3 // indirect
github.com/golang/glog v1.0.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/btree v1.0.1 // indirect
github.com/google/go-cmp v0.5.8 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.1.0 // indirect
github.com/googleapis/gax-go/v2 v2.4.0 // indirect
github.com/googleapis/go-type-adapters v1.0.0 // indirect
github.com/gorilla/handlers v1.5.1 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
github.com/gtank/merlin v0.1.1 // indirect
github.com/gtank/ristretto255 v0.1.2 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-getter v1.6.1 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-safetemp v1.0.0 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/ipfs/go-cid v0.3.2 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect
github.com/klauspost/compress v1.15.9 // indirect
github.com/klauspost/cpuid/v2 v2.0.4 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/manifoldco/promptui v0.9.0 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 // indirect
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 // indirect
github.com/minio/sha256-simd v1.0.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-testing-interface v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/mtibben/percent v0.2.1 // indirect
github.com/multiformats/go-base32 v0.0.3 // indirect
github.com/multiformats/go-base36 v0.1.0 // indirect
github.com/multiformats/go-multibase v0.0.3 // indirect
github.com/multiformats/go-multihash v0.0.15 // indirect
github.com/multiformats/go-varint v0.0.6 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.2 // indirect
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.12.2 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.34.0 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/rakyll/statik v0.1.7 // indirect
github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 // indirect
github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/objx v0.4.0 // indirect
github.com/stretchr/testify v1.8.0 // indirect
github.com/subosito/gotenv v1.4.0 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
github.com/tendermint/btcd v0.1.1 // indirect
github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 // indirect
github.com/tendermint/go-amino v0.16.0 // indirect
github.com/tendermint/tm-db v0.6.7 // indirect
github.com/ulikunitz/xz v0.5.8 // indirect
github.com/xanzy/ssh-agent v0.3.1 // indirect
github.com/zondax/hid v0.9.1-0.20220302062450-5552068d2266 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
go.opencensus.io v0.23.0 // indirect
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/net v0.0.0-20220726230323-06994584191e // indirect
golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094 // indirect
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab // indirect
golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect
google.golang.org/api v0.93.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/ini.v1 v1.66.6 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
Loading