Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DietPi-Software | IPFS Node #4236

Merged
merged 31 commits into from
Apr 11, 2021
Merged

DietPi-Software | IPFS Node #4236

merged 31 commits into from
Apr 11, 2021

Conversation

ravenclaw900
Copy link
Collaborator

@ravenclaw900 ravenclaw900 commented Mar 31, 2021

Status: Ready

  • Test on VM
  • Test on RPi

Reference: #4232

Commit list/description:

  • DietPi-Software | Add IPFS Node
  • DietPi-Software | Add uninstall instructions

+ DietPi-Software | Add IPFS Node
@ravenclaw900 ravenclaw900 added this to the v7.1 milestone Mar 31, 2021
@ravenclaw900 ravenclaw900 self-assigned this Mar 31, 2021
@ravenclaw900
Copy link
Collaborator Author

Well, I tried updating VirtualBox and now the kernel module is not loading. Time to start using QEMU.

dietpi/dietpi-software Outdated Show resolved Hide resolved
dietpi/dietpi-software Outdated Show resolved Hide resolved
dietpi/dietpi-software Outdated Show resolved Hide resolved
@MichaIng
Copy link
Owner

MichaIng commented Apr 2, 2021

I like the idea to merge nodes for distributed projects. Probably the decentralised search engines YaCy and SearX (not added yet) could be added there as well, as the local node as well contributes to the global network.

@MichaIng MichaIng linked an issue Apr 2, 2021 that may be closed by this pull request
@ravenclaw900
Copy link
Collaborator Author

Coincidentally, I was planning to do SearX sometime soon.

@MichaIng
Copy link
Owner

MichaIng commented Apr 2, 2021

Well, I tried updating VirtualBox and now the kernel module is not loading. Time to start using QEMU.

Related to IPFS? You mean updating the desktop application or the DietPi guest system?

@ravenclaw900
Copy link
Collaborator Author

ravenclaw900 commented Apr 2, 2021

It was the desktop application, and I hadn't even switched to the IPFS branch yet, so almost certainly not related.

@ravenclaw900
Copy link
Collaborator Author

Fixed now (broken permissions on the kext directory).

+ Multiple | Fixes
+ DietPi-Software | Fix variable call
+ DietPi-Software | Add missing !
+ DietPi-Software | Add uninstall instructions
+ DietPi-Software | Remove systemd service when uninstalling
+ DietPi-Software | Fix G_CONFIG_INJECT
+ DietPi-Software | Again fix G_CONFIG_INJECT
+ DietPi-Software | Fix moved line
+ DietPi-Software | Fix userdata path in systemd service
+ DietPi-Software | Chown after all files have been created
+ DietPi-Software | Make IPFS_PATH an environment variable
+ DietPi-Software | Allow access from outside of localhost
+ DietPi-Software | Broadcast webui
@ravenclaw900 ravenclaw900 requested a review from MichaIng April 2, 2021 21:38
+ DietPi-Software | Remove bashrc file on uninstall
dietpi/dietpi-services Outdated Show resolved Hide resolved
MichaIng and others added 2 commits April 11, 2021 14:14
+ DietPi-Survey_report | Add IPFS support, newly added with DietPi v7.1
+ DietPi-Services | Move tor back to networking section
dietpi/dietpi-software Outdated Show resolved Hide resolved
dietpi/dietpi-software Outdated Show resolved Hide resolved
+ DietPi-Software | Fixes
@MichaIng
Copy link
Owner

Online docs required: MichaIng/DietPi-Docs#425
Did some install tests and it works like a charm 👍.

+ DietPi-Software | IPFS: Limit data dir write permissions to IPFS service user, as it's basically a database directory that is not intended to be used directly for move files inside via file servers or such.
+ DietPi-Software | Add some code comments and G_EXEC usage, where applicable
@MichaIng
Copy link
Owner

MichaIng commented Apr 11, 2021

One error during startup:

2021/04/11 18:25:50 failed to sufficiently increase receive buffer size (was: 208 kiB, wanted: 2048 kiB, got: 416 kiB). See https://github.com/lucas-clemente/quic-go/wiki/UDP-Receive-Buffer-Size for
details.

https://github.com/lucas-clemente/quic-go/wiki/UDP-Receive-Buffer-Size

# sysctl net.core.rmem_max
net.core.rmem_max = 212992
# sysctl -w net.core.rmem_max=2500000
net.core.rmem_max = 2500000
# Issue solved

Shall we implement an /etc/sysctl.d/dietpi-ipfs.conf to have this applied automatically. Not sure whether ~2.4 MiB packet receive buffer can be an issue for low memory devices?


Another question: I don't see a reason to have the ipfs user being member of the dietpi group, since its internal data is completely independent from any file system directories, right? The CLI in case needs read permissions, but the dietpi group is by default only required for write permissions to the /mnt/dietpi_userdata media directories. Shall we skip that group membership, to harden the application a little?

@MichaIng MichaIng requested a review from Joulinar April 11, 2021 17:10
+ DietPi-Software | Fix switched around arches
@ravenclaw900
Copy link
Collaborator Author

Let's add the file, at least for the sake of mitigating the error. It seems that the dietpi user requires full permissions to the directory for IPFS commands to work, I just did that so that we wouldn't have to apply 777 permissions to the directory.

@MichaIng
Copy link
Owner

It seems that the dietpi user requires full permissions to the directory for IPFS commands to work

What has the dietpi user to do with it? You mean when one logs in with that user and runs the ipfs command from console? For this reason I thought about the CLI alias: #4236 (comment)
Generally the dietpi user should not be seen as the intended login user and I aim to remove it in favour of an optional custom login user to be created on first boot of DietPi. To have new files and directories in case created with the correct user, so that the web UI remains to have full access, the CLI should be executed as ipfs user as well.

@ravenclaw900
Copy link
Collaborator Author

Ah. In that case, yes, let's remove it from the dietpi group.

@MichaIng
Copy link
Owner

Okay, I'm adding the change, including the CLI alias and the receive buffer raise.

+ DietPi-Software | IPFS: Do not add service user to "dietpi" group. Instead, to assure all login users call the correct instance via correct service user, create a CLI alias to invoke the CLI via "sudo -u ipfs".
+ DietPi-Software | IPFS: Raise receive buffer by default to meet the recommendation from the IPFS wiki and mitigate the related error on service start
+ DietPi-Software | IPFS: Add an IPFS node API docs link to the systemd unit
MichaIng
MichaIng previously approved these changes Apr 11, 2021
+ DietPi-Software | IPFS: Apply increased receive buffer directly on install, to have the error message addressed on first service start already
+ DietPi-Software | Do not call "dietpi-set_hardware headless 0" in every case but only if graphical software is installed
MichaIng
MichaIng previously approved these changes Apr 11, 2021
+ CHANGELOG | IPFS Node: The InterPlanetary File System peer-to-peer hypermedia protocol node is now available for install
@MichaIng
Copy link
Owner

The web interface is unprotected by default. Is there a way at application level to enable login authentication, limit access to local network or such?

@MichaIng
Copy link
Owner

I'll merge it, we can further test and think about web UI protection in the issue.

@MichaIng MichaIng merged commit bdb5699 into dev Apr 11, 2021
@MichaIng MichaIng deleted the ipfs branch April 11, 2021 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DietPi-Software | IPFS Node
2 participants