Skip to content

Commit

Permalink
Merge pull request #3 from RTradeLtd/sanitize
Browse files Browse the repository at this point in the history
Sanitize
  • Loading branch information
eyedeekay authored Feb 10, 2019
2 parents 64153e0 + 68e0b17 commit f8e40a1
Show file tree
Hide file tree
Showing 930 changed files with 24,509 additions and 4,551 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
README.md.asc
*.so
build
go
*log*
*err*
Expand Down
74 changes: 18 additions & 56 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 28 additions & 7 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,29 @@
ignored = ["github.com/RTradeLtd/go-ipfs-plugin-i2p-gateway"]
# Gopkg.toml example
#
# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
#
# [prune]
# non-go = false
# go-tests = true
# unused-packages = true


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

[[constraint]]
name = "github.com/ipfs/go-ipfs-config"
version = "0.2.15"
name = "github.com/ipfs/go-ipfs"
version = "0.4.18"

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

[[constraint]]
name = "github.com/ipfs/go-ipfs"
branch = "master"

[[constraint]]
name = "github.com/multiformats/go-multiaddr"
branch = "master"

[prune]
go-tests = true
Expand Down
61 changes: 44 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,55 +1,86 @@
THIS_FILE := $(lastword $(MAKEFILE_LIST))
UNSAFE=no
GOCC ?= go

.PHONY: install build gx
# build plugin and ipfs daemon
.PHONY: build
build:
mkdir build
@$(MAKE) -f $(THIS_FILE) plugin-ipfs
@$(MAKE) -f $(THIS_FILE) ipfs

build: go-ipfs-plugin-i2p-gateway.so
# build the actual plugin
.PHONY: plugin-ipfs
plugin-ipfs:
$(GOCC) build -o build/go-ipfs-plugin-i2p-gateway.so -buildmode=plugin
chmod +x "build/go-ipfs-plugin-i2p-gateway.so"

# build ipfs daemon
.PHONY: ipfs
ipfs:
( cd vendor/github.com/ipfs/go-ipfs/cmd/ipfs ; go build -o ../../../../../../build/ipfs ; cp ipfs $(GOPATH)/bin)

# clean up files
.PHONY: clean
clean:
rm -f go-ipfs-plugin-i2p-gateway.so
rm -rf build
find . -name '*.i2pkeys' -exec rm -vf {} \;
find . -name '*i2pconfig' -exec rm -vf {} \;

install: build
# install plugin to ipfs plugin folder
.PHONY: install
install:
mkdir -p $(IPFS_PATH)/plugins
install -Dm700 go-ipfs-plugin-i2p-gateway.so "$(IPFS_PATH)/plugins/go-ipfs-plugin-i2p-gateway.so"
install -Dm700 build/go-ipfs-plugin-i2p-gateway.so "$(IPFS_PATH)/plugins/go-ipfs-plugin-i2p-gateway.so"

# grab tooling to deal with gx
.PHONY: gx
gx:
go get -u github.com/whyrusleeping/gx
go get -u github.com/whyrusleeping/gx-go
go get -u github.com/karalabe/ungx

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

# build libp2p plugin
.PHONY: plugin-libp2p
plugin-libp2p:
$(GOCC) build -a -tags libp2p -buildmode=plugin

# fetch dependencies
.PHONY: deps
deps:
go get -u github.com/RTradeLtd/go-garlic-tcp-transport
go get -u github.com/RTradeLtd/go-ipfs-plugin-i2p-gateway/config
$(GX_GO_PATH) get github.com/RTradeLtd/go-ipfs-plugin-i2p-gateway

clobber:
rm -rf $(GOPATH)

b:
# build i2p folder
.PHONY: build-i2p
build-i2p:
go build ./i2p

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

# run tests
.PHONY: test
test:
go test ./config -v
go test ./i2p -v

# vet go code
.PHONY: vet
vet:
go vet ./config
go vet ./i2p

# import gx ipfs
.PHONY: import
import:
gx import github.com/ipfs/go-ipfs

# completely rebuild vendor
.PHONY: vendor
vendor:
# Nuke vendor directory
Expand All @@ -65,8 +96,4 @@ vendor:
mv vendor/github.com/ipfs/go-ipfs/vendor/* vendor

# Remove problematic dependencies
find . -name test-vectors -type d -exec rm -r {} +

.PHONY: ipfs
ipfs:
( cd vendor/github.com/ipfs/go-ipfs/cmd/ipfs ; go build ; cp ipfs $(GOPATH)/bin)
find . -name test-vectors -type d -exec rm -r {} +
Loading

0 comments on commit f8e40a1

Please sign in to comment.