Skip to content

Commit 864db86

Browse files
authored
Merge pull request #1 from uddugteam/ipfs-storage
Ipfs storage
2 parents 1b5e8ec + f010eae commit 864db86

File tree

16 files changed

+1495
-144
lines changed

16 files changed

+1495
-144
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,8 @@ __debug_bin
2020

2121
.repos/
2222

23-
gitsec-backend
23+
gitsec-backend
24+
25+
local/
26+
27+
.fs.json

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ You can also clone the repository using the git clone command:
6161
$ git clone http://localhost:8080/repos/repo.git
6262
```
6363

64-
6564
## Configuration
6665
The following environment variables can be used to configure the server:
6766

@@ -76,10 +75,13 @@ The following environment variables can be used to configure the server:
7675
* `make lint`: Runs the linter to check
7776

7877
## Todo
79-
- [ ] Add support for SSH protocol
78+
- [x] Add support for IPFS storage
79+
- [ ] Add support for onchain registry
80+
- [ ] Add disaster recovery for repo storage
81+
- [ ] Add performance optimisation for IPFS storage
82+
- [ ] Add support for SSH protocols
8083
- [ ] Add authentication
8184
- [ ] Add SSL/TLS support
82-
- [ ] Add repository management features
8385
- [ ] Add Git hooks support
8486

8587
## Contributing

config/init.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ func init() {
1313
viper.SetDefault("http.port", 8080)
1414

1515
viper.SetDefault("git.path", ".repos/")
16+
17+
viper.SetDefault("ipfs.address", "http://127.0.0.1:5001")
1618
}

config/scheme.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ type Scheme struct {
1010

1111
// Git is the configuration for the Git server.
1212
Git *Git
13+
14+
// Ipfs is the configuration for the Ipfs client.
15+
Ipfs *Ipfs
1316
}
1417

1518
// HTTP represents the HTTP server configuration scheme.
@@ -23,3 +26,9 @@ type Git struct {
2326
// Path is the path to the Git repositories.
2427
Path string
2528
}
29+
30+
// Ipfs represent Ipfs client configuration scheme.
31+
type Ipfs struct {
32+
// Address of Ipfs node
33+
Address string
34+
}

go.mod

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ require (
66
github.com/go-chi/chi/v5 v5.0.8
77
github.com/go-git/go-billy/v5 v5.3.1
88
github.com/go-git/go-git/v5 v5.4.2
9+
github.com/ipfs/go-ipfs-api v0.3.0
910
github.com/misnaged/annales v0.0.4
1011
github.com/spf13/cobra v1.5.0
1112
github.com/spf13/pflag v1.0.5
@@ -17,29 +18,51 @@ require (
1718
github.com/Microsoft/go-winio v0.6.0 // indirect
1819
github.com/ProtonMail/go-crypto v0.0.0-20221026131551-cf6655e29de4 // indirect
1920
github.com/acomagu/bufpipe v1.0.3 // indirect
21+
github.com/btcsuite/btcd v0.20.1-beta // indirect
2022
github.com/cloudflare/circl v1.3.1 // indirect
23+
github.com/crackcomm/go-gitignore v0.0.0-20170627025303-887ab5e44cc3 // indirect
2124
github.com/davecgh/go-spew v1.1.1 // indirect
2225
github.com/emirpasic/gods v1.18.1 // indirect
2326
github.com/fsnotify/fsnotify v1.5.4 // indirect
2427
github.com/go-git/gcfg v1.5.0 // indirect
28+
github.com/gogo/protobuf v1.3.2 // indirect
2529
github.com/hashicorp/hcl v1.0.0 // indirect
2630
github.com/imdario/mergo v0.3.13 // indirect
2731
github.com/inconshreveable/mousetrap v1.0.1 // indirect
32+
github.com/ipfs/go-cid v0.0.7 // indirect
33+
github.com/ipfs/go-ipfs-files v0.0.9 // indirect
2834
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
2935
github.com/kevinburke/ssh_config v1.2.0 // indirect
36+
github.com/libp2p/go-buffer-pool v0.0.2 // indirect
37+
github.com/libp2p/go-flow-metrics v0.0.3 // indirect
38+
github.com/libp2p/go-libp2p-core v0.6.1 // indirect
39+
github.com/libp2p/go-openssl v0.0.7 // indirect
3040
github.com/magiconair/properties v1.8.6 // indirect
41+
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 // indirect
42+
github.com/minio/sha256-simd v0.1.1 // indirect
3143
github.com/mitchellh/go-homedir v1.1.0 // indirect
3244
github.com/mitchellh/mapstructure v1.5.0 // indirect
45+
github.com/mr-tron/base58 v1.2.0 // indirect
46+
github.com/multiformats/go-base32 v0.0.3 // indirect
47+
github.com/multiformats/go-base36 v0.1.0 // indirect
48+
github.com/multiformats/go-multiaddr v0.3.0 // indirect
49+
github.com/multiformats/go-multibase v0.0.3 // indirect
50+
github.com/multiformats/go-multihash v0.0.14 // indirect
51+
github.com/multiformats/go-varint v0.0.6 // indirect
3352
github.com/pelletier/go-toml v1.9.5 // indirect
3453
github.com/pelletier/go-toml/v2 v2.0.2 // indirect
3554
github.com/pmezard/go-difflib v1.0.0 // indirect
3655
github.com/sergi/go-diff v1.2.0 // indirect
3756
github.com/sirupsen/logrus v1.9.0 // indirect
57+
github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect
58+
github.com/spaolacci/murmur3 v1.1.0 // indirect
3859
github.com/spf13/afero v1.9.2 // indirect
3960
github.com/spf13/cast v1.5.0 // indirect
4061
github.com/spf13/jwalterweatherman v1.1.0 // indirect
4162
github.com/subosito/gotenv v1.4.0 // indirect
63+
github.com/whyrusleeping/tar-utils v0.0.0-20180509141711-8c6c8ba81d5c // indirect
4264
github.com/xanzy/ssh-agent v0.3.3 // indirect
65+
go.opencensus.io v0.23.0 // indirect
4366
golang.org/x/crypto v0.4.0 // indirect
4467
golang.org/x/mod v0.7.0 // indirect
4568
golang.org/x/net v0.4.0 // indirect

0 commit comments

Comments
 (0)