Bash script that installs and setups IPFS for RaspberryPi OS Lite on RaspberryPi Zero W.
- View script: ipfs-rpizero.sh
- Get a brand new installed Raspberry Pi OS Lite (with no GUI) micro SD card.
- See the prerequisites below.
- Update, upgrade apk packages and upgrade kernel to the latest as well.
- SSH to your RaspberryPi Zero W.
- Go home.
- Create a file, copy and paste the script.
- Give access to the script. (
chmod +x ipfs-rpizero.sh
) - Run the script. (
./ipfs-rpizero.sh
) - Reboot now. (
sudo reboot now
)
- Do not use desktop version of RaspberryPi OS.
- Set display resolution to 800 x 600 or lower.
- Change host name from
raspberrypi
to other, if necessary. (Recommended though) - Set disk swap size to 2GB.
- Change your
pi
user password. - Set SSH settings to login with private key. (Send your public key to
~/.ssh/known_hosts
) - Disable SSH pasword login and root user login.
- Disable all exposed ports except: SSH(22) and IPFS(4001).
./ipfs-rpizero.sh run
To run the IPFS daemon background:
nohup ./ipfs-rpizero.sh run
./ipfs-rpizero.sh uninstall
./run-webui.sh
IPFS Daemon contains a built-in Web server to monitor the status from the Web browser.
You can monitor file trafic, peers connected and post or mange a file to IPFS.
Though, this script does not allow Web access from other client. (Only http://localhost:5001/
or http://127.0.0.1:5001
request are allowed)
We recommend to SSH port forward the 127.0.0.0:5001
access of your rpi to your local.
# In your local, run the below to begin port forward/tunnel the SSH access.
ssh -N [email protected] -L 5001:127.0.0.1:5001
# Note that the above login user is `pi` and the host is `raspberrypi.local`.
# Change it to your settings.
Then from your browser, access: http://localhost:5001/webui
- Request, enhancement, ideas, etc. -> Go to the discussions
- Bug report -> Go to the issues
- PR -> Welcome!!
- We recommend to draft a PR first, before implementing anything. So the others would know what you are dealing with.
- In Japanese
- ヘッドレス RaspberryPi ZeroW のブートディスク作成(Wi-Fi 設定済み SSH 有効済み)と設定 @ Qiita
- ハッシュ関数と次世代ファイルシステム IPFS の関係 | hashアルゴリズムとハッシュ値の長さ一覧(+ハッシュ関数の基本と応用) @ Qiita
$ # OS
$ cat /etc/os-release | grep PRETTY_NAME
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
$ # Hardware Revision
$ cat /proc/device-tree/model
Raspberry Pi Zero W Rev 1.1
$ # Kernel version
$ cat /proc/version
Linux version 5.10.31+ (dom@buildbot) (arm-linux-gnueabihf-gcc-8 (Ubuntu/Linaro 8.4.0-3ubuntu1) 8.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1412 Wed Apr 21 15:43:03 BST 2021
$ # IPFS version
$ sudo -u ipfs ipfs --version
ipfs version 0.8.0
- Create systemd service template
- Create tests for script
setup_ipfs.sh
(Lint and static analysis check) - Include basic security checker.
-
pi
user password is not default (notraspberry
) - ssh: pasword login is disabled
- ssh: root uer login is disabled
-
- Reboot machine periodically (
cron
once an
th day) - Check IPFS latest stable version on boot