Skip to content

Commit

Permalink
Merge go-ipfs v0.4.21 version
Browse files Browse the repository at this point in the history
  • Loading branch information
Jin Liu authored and jin-tron committed Jun 13, 2019
1 parent 699b9de commit 2a3d3b3
Show file tree
Hide file tree
Showing 188 changed files with 4,632 additions and 2,940 deletions.
452 changes: 452 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions COPYRIGHT
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This project is transitioning from an MIT-only license to a dual MIT/Apache-2.0 license.
Unless otherwise noted, all code contributed prior to 2019-05-06 and not contributed by
a user listed in [this signoff issue](https://github.com/ipfs/go-ipfs/issues/6302) is
licensed under MIT-only. All new contributions (and past contributions since 2019-05-06)
are licensed under a dual MIT/Apache-2.0 license.
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ RUN set -x \
# Get the TLS CA certificates, they're not provided by busybox.
RUN apt-get update && apt-get install -y ca-certificates

# Install FUSE
RUN apt-get update && apt-get install -y fuse

# Now comes the actual target image, which aims to be as small as possible.
FROM busybox:1-glibc
MAINTAINER Lars Gierth <[email protected]>
Expand All @@ -43,8 +46,12 @@ COPY --from=0 $SRC_DIR/cmd/btfs/ipfs /usr/local/bin/ipfs
COPY --from=0 $SRC_DIR/bin/container_daemon /usr/local/bin/start_ipfs
COPY --from=0 /tmp/su-exec/su-exec /sbin/su-exec
COPY --from=0 /tmp/tini /sbin/tini
COPY --from=0 /bin/fusermount /usr/local/bin/fusermount
COPY --from=0 /etc/ssl/certs /etc/ssl/certs

# Add suid bit on fusermount so it will run properly
RUN chmod 4755 /usr/local/bin/fusermount

# This shared lib (part of glibc) doesn't seem to be included with busybox.
COPY --from=0 /lib/x86_64-linux-gnu/libdl-2.24.so /lib/libdl.so.2

Expand All @@ -63,6 +70,10 @@ RUN mkdir -p $IPFS_PATH \
&& adduser -D -h $IPFS_PATH -u 1000 -G users ipfs \
&& chown ipfs:users $IPFS_PATH

# Create mount points for `ipfs mount` command
RUN mkdir /btfs /btns \
&& chown btfs:users /btfs /btns

# Expose the fs-repo as a volume.
# start_ipfs initializes an fs-repo if none is mounted.
# Important this happens after the USER directive so permission are correct.
Expand Down
39 changes: 0 additions & 39 deletions ISSUE_TEMPLATE.md

This file was deleted.

5 changes: 5 additions & 0 deletions LICENSE-APACHE
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
19 changes: 19 additions & 0 deletions LICENSE-MIT
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
10 changes: 8 additions & 2 deletions Rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ COVERAGE :=
DISTCLEAN :=
TEST :=
TEST_SHORT :=
GOCC ?= go

all: help # all has to be first defined target
.PHONY: all
Expand Down Expand Up @@ -104,9 +105,14 @@ install_unsupported: install
.PHONY: install_unsupported

uninstall:
go clean -i ./cmd/btfs
$(GOCC) clean -i ./cmd/btfs
.PHONY: uninstall

supported:
@echo "Currently supported platforms:"
@for p in ${SUPPORTED_PLATFORMS}; do echo $$p; done
.PHONY: supported

help:
@echo 'DEPENDENCY TARGETS:'
@echo ''
Expand Down Expand Up @@ -135,7 +141,7 @@ help:
@echo ' test_go_test - Run all go tests'
@echo ' test_go_expensive - Run all go tests and compile on all platforms'
@echo ' test_go_race - Run go tests with the race detector enabled'
@echo ' test_go_megacheck - Run the `megacheck` vetting tool'
@echo ' test_go_lint - Run the `golangci-lint` vetting tool'
@echo ' test_sharness_short - Run short sharness tests'
@echo ' test_sharness_expensive - Run all sharness tests'
@echo ' coverage - Collects coverage info from unit tests and sharness'
Expand Down
4 changes: 2 additions & 2 deletions assets/assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (

cid "github.com/ipfs/go-cid"
files "github.com/ipfs/go-ipfs-files"
iface "github.com/ipfs/interface-go-ipfs-core"
options "github.com/ipfs/interface-go-ipfs-core/options"
"github.com/ipfs/interface-go-ipfs-core/path"

// this import keeps gx from thinking the dep isn't used
_ "github.com/ipfs/dir-index-html"
Expand Down Expand Up @@ -57,7 +57,7 @@ func addAssetList(nd *core.IpfsNode, l []string) (cid.Cid, error) {
return cid.Cid{}, err
}

basePath := iface.IpfsPath(dirb.Cid())
basePath := path.IpfsPath(dirb.Cid())

for _, p := range l {
d, err := Asset(p)
Expand Down
8 changes: 5 additions & 3 deletions bin/check_go_version
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ PREFIX=$(expr "$0" : "\(.*\/\)") || PREFIX='./'

# Check that the go binary exist and is in the path

type go >/dev/null 2>&1 || die_upgrade "go is not installed or not in the PATH!"
GOCC=${GOCC="go"}

type ${GOCC} >/dev/null 2>&1 || die_upgrade "go is not installed or not in the PATH!"

# Check the go binary version

VERS_STR=$(go version 2>&1) || die "'go version' failed with output: $VERS_STR"
VERS_STR=$(${GOCC} version 2>&1) || die "'go version' failed with output: $VERS_STR"

GO_CUR_VERSION=$(expr "$VERS_STR" : ".*go version go\([^ ]*\) .*") || die "Invalid 'go version' output: $VERS_STR"

check_at_least_version "$GO_MIN_VERSION" "$GO_CUR_VERSION" "go"
check_at_least_version "$GO_MIN_VERSION" "$GO_CUR_VERSION" "${GOCC}"
4 changes: 3 additions & 1 deletion bin/dist_get
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh

GOCC=${GOCC=go}

die() {
echo "$@" >&2
exit 1
Expand Down Expand Up @@ -99,7 +101,7 @@ get_go_vars() {
if [ ! -z "$GOOS" ] && [ ! -z "$GOARCH" ]; then
printf "%s-%s" "$GOOS" "$GOARCH"
elif have_binary go; then
printf "%s-%s" "$(go env GOOS)" "$(go env GOARCH)"
printf "%s-%s" "$($GOCC env GOOS)" "$($GOCC env GOARCH)"
else
die "no way of determining system GOOS and GOARCH\nPlease manually set GOOS and GOARCH then retry."
fi
Expand Down
14 changes: 8 additions & 6 deletions bin/maketarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ if ! [[ "$OUTPUT" = /* ]]; then
OUTPUT="$PWD/$OUTPUT"
fi

TMPDIR="$(mktemp -d)"
cp -r . "$TMPDIR"
( cd "$TMPDIR" &&
GOCC=${GOCC=go}

TEMP="$(mktemp -d)"
cp -r . "$TEMP"
( cd "$TEMP" &&
echo $PWD &&
go mod vendor &&
$GOCC mod vendor &&
(git describe --always --match=NeVeRmAtCh --dirty 2>/dev/null || true) > .tarball &&
chmod -R u=rwX,go=rX "$TMPDIR" # normalize permissions
chmod -R u=rwX,go=rX "$TEMP" # normalize permissions
tar -czf "$OUTPUT" --exclude="./.git" .
)

rm -rf "$TMPDIR"
rm -rf "$TEMP"
Loading

0 comments on commit 2a3d3b3

Please sign in to comment.