Skip to content

Commit f8e40a1

Browse files
authored
Merge pull request #3 from RTradeLtd/sanitize
Sanitize
2 parents 64153e0 + 68e0b17 commit f8e40a1

File tree

930 files changed

+24509
-4551
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

930 files changed

+24509
-4551
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
README.md.asc
22
*.so
3+
build
34
go
45
*log*
56
*err*

Gopkg.lock

Lines changed: 18 additions & 56 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,29 @@
1-
ignored = ["github.com/RTradeLtd/go-ipfs-plugin-i2p-gateway"]
1+
# Gopkg.toml example
2+
#
3+
# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
4+
# for detailed Gopkg.toml documentation.
5+
#
6+
# required = ["github.com/user/thing/cmd/thing"]
7+
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
8+
#
9+
# [[constraint]]
10+
# name = "github.com/user/project"
11+
# version = "1.0.0"
12+
#
13+
# [[constraint]]
14+
# name = "github.com/user/project2"
15+
# branch = "dev"
16+
# source = "github.com/myfork/project2"
17+
#
18+
# [[override]]
19+
# name = "github.com/x/y"
20+
# version = "2.4.0"
21+
#
22+
# [prune]
23+
# non-go = false
24+
# go-tests = true
25+
# unused-packages = true
26+
227

328
[[constraint]]
429
branch = "fix/imports"
@@ -9,8 +34,8 @@ ignored = ["github.com/RTradeLtd/go-ipfs-plugin-i2p-gateway"]
934
name = "github.com/eyedeekay/sam-forwarder"
1035

1136
[[constraint]]
12-
name = "github.com/ipfs/go-ipfs-config"
13-
version = "0.2.15"
37+
name = "github.com/ipfs/go-ipfs"
38+
version = "0.4.18"
1439

1540
[[constraint]]
1641
name = "github.com/ipfs/go-ipfs-util"
@@ -21,12 +46,8 @@ ignored = ["github.com/RTradeLtd/go-ipfs-plugin-i2p-gateway"]
2146
version = "1.1.0"
2247

2348
[[constraint]]
24-
name = "github.com/ipfs/go-ipfs"
2549
branch = "master"
26-
27-
[[constraint]]
2850
name = "github.com/multiformats/go-multiaddr"
29-
branch = "master"
3051

3152
[prune]
3253
go-tests = true

Makefile

Lines changed: 44 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,86 @@
1+
THIS_FILE := $(lastword $(MAKEFILE_LIST))
2+
UNSAFE=no
13
GOCC ?= go
24

3-
.PHONY: install build gx
5+
# build plugin and ipfs daemon
6+
.PHONY: build
7+
build:
8+
mkdir build
9+
@$(MAKE) -f $(THIS_FILE) plugin-ipfs
10+
@$(MAKE) -f $(THIS_FILE) ipfs
411

5-
build: go-ipfs-plugin-i2p-gateway.so
12+
# build the actual plugin
13+
.PHONY: plugin-ipfs
14+
plugin-ipfs:
15+
$(GOCC) build -o build/go-ipfs-plugin-i2p-gateway.so -buildmode=plugin
16+
chmod +x "build/go-ipfs-plugin-i2p-gateway.so"
617

18+
# build ipfs daemon
19+
.PHONY: ipfs
20+
ipfs:
21+
( cd vendor/github.com/ipfs/go-ipfs/cmd/ipfs ; go build -o ../../../../../../build/ipfs ; cp ipfs $(GOPATH)/bin)
22+
23+
# clean up files
24+
.PHONY: clean
725
clean:
8-
rm -f go-ipfs-plugin-i2p-gateway.so
26+
rm -rf build
927
find . -name '*.i2pkeys' -exec rm -vf {} \;
1028
find . -name '*i2pconfig' -exec rm -vf {} \;
1129

12-
install: build
30+
# install plugin to ipfs plugin folder
31+
.PHONY: install
32+
install:
1333
mkdir -p $(IPFS_PATH)/plugins
14-
install -Dm700 go-ipfs-plugin-i2p-gateway.so "$(IPFS_PATH)/plugins/go-ipfs-plugin-i2p-gateway.so"
34+
install -Dm700 build/go-ipfs-plugin-i2p-gateway.so "$(IPFS_PATH)/plugins/go-ipfs-plugin-i2p-gateway.so"
1535

36+
# grab tooling to deal with gx
37+
.PHONY: gx
1638
gx:
1739
go get -u github.com/whyrusleeping/gx
1840
go get -u github.com/whyrusleeping/gx-go
1941
go get -u github.com/karalabe/ungx
2042

21-
go-ipfs-plugin-i2p-gateway.so: plugin.go
22-
$(GOCC) build -buildmode=plugin
23-
chmod +x "go-ipfs-plugin-i2p-gateway.so"
2443

44+
# build libp2p plugin
45+
.PHONY: plugin-libp2p
2546
plugin-libp2p:
2647
$(GOCC) build -a -tags libp2p -buildmode=plugin
2748

49+
# fetch dependencies
50+
.PHONY: deps
2851
deps:
2952
go get -u github.com/RTradeLtd/go-garlic-tcp-transport
3053
go get -u github.com/RTradeLtd/go-ipfs-plugin-i2p-gateway/config
3154
$(GX_GO_PATH) get github.com/RTradeLtd/go-ipfs-plugin-i2p-gateway
3255

33-
clobber:
34-
rm -rf $(GOPATH)
35-
36-
b:
56+
# build i2p folder
57+
.PHONY: build-i2p
58+
build-i2p:
3759
go build ./i2p
3860

61+
# format i2p and config golang files
62+
.PHONY: fmt
3963
fmt:
4064
find ./i2p ./config -name '*.go' -exec gofmt -w {} \;
4165

66+
# run tests
67+
.PHONY: test
4268
test:
4369
go test ./config -v
4470
go test ./i2p -v
4571

72+
# vet go code
73+
.PHONY: vet
4674
vet:
4775
go vet ./config
4876
go vet ./i2p
4977

78+
# import gx ipfs
79+
.PHONY: import
5080
import:
5181
gx import github.com/ipfs/go-ipfs
5282

83+
# completely rebuild vendor
5384
.PHONY: vendor
5485
vendor:
5586
# Nuke vendor directory
@@ -65,8 +96,4 @@ vendor:
6596
mv vendor/github.com/ipfs/go-ipfs/vendor/* vendor
6697

6798
# Remove problematic dependencies
68-
find . -name test-vectors -type d -exec rm -r {} +
69-
70-
.PHONY: ipfs
71-
ipfs:
72-
( cd vendor/github.com/ipfs/go-ipfs/cmd/ipfs ; go build ; cp ipfs $(GOPATH)/bin)
99+
find . -name test-vectors -type d -exec rm -r {} +

0 commit comments

Comments
 (0)