Add helper script + go-ipfs binary for Linux

master
Melroy van den Berg 2020-12-06 21:31:47 +01:00
parent c2d976e265
commit 5cc1238815
7 changed files with 104 additions and 0 deletions

8
go-ipfs/LICENSE Normal file
View File

@ -0,0 +1,8 @@
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.
MIT: https://www.opensource.org/licenses/mit
Apache-2.0: https://www.apache.org/licenses/license-2.0

5
go-ipfs/LICENSE-APACHE Normal file
View File

@ -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
go-ipfs/LICENSE-MIT Normal file
View File

@ -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.

28
go-ipfs/README.md Normal file
View File

@ -0,0 +1,28 @@
# ipfs commandline tool
This is the [ipfs](http://ipfs.io) commandline tool. It contains a full ipfs node.
## Install
To install it, move the binary somewhere in your `$PATH`:
```sh
sudo mv ipfs /usr/local/bin/ipfs
```
Or run `sudo ./install.sh` which does this for you.
## Usage
First, you must initialize your local ipfs node:
```sh
ipfs init
```
This will give you directions to get started with ipfs.
You can always get help with:
```sh
ipfs --help
```

36
go-ipfs/install.sh Executable file
View File

@ -0,0 +1,36 @@
#!/bin/sh
#
# Installation script for ipfs. It tries to move $bin in one of the
# directories stored in $binpaths.
INSTALL_DIR=$(dirname $0)
bin="$INSTALL_DIR/ipfs"
binpaths="/usr/local/bin /usr/bin"
# This variable contains a nonzero length string in case the script fails
# because of missing write permissions.
is_write_perm_missing=""
for binpath in $binpaths; do
if mv "$bin" "$binpath/ipfs" ; then
echo "Moved $bin to $binpath"
exit 0
else
if [ -d "$binpath" ] && [ ! -w "$binpath" ]; then
is_write_perm_missing=1
fi
fi
done
echo "We cannot install $bin in one of the directories $binpaths"
if [ -n "$is_write_perm_missing" ]; then
echo "It seems that we do not have the necessary write permissions."
echo "Perhaps try running this script as a privileged user:"
echo
echo " sudo $0"
echo
fi
exit 1

BIN
go-ipfs/ipfs Executable file

Binary file not shown.

8
misc/get_ipfs.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
# Download & untar Go-IPFS
wget --quiet -O "$DIR/go-ipfs.tar.gz" "https://dist.ipfs.io/go-ipfs/v0.7.0/go-ipfs_v0.7.0_linux-amd64.tar.gz"
tar -xvzf "$DIR/go-ipfs.tar.gz" -C "$DIR/../"
# Clean-up
rm -rf "$DIR/go-ipfs.tar.gz"