Daemon architecture thoughts
- Dominant language
- Go
- Stars
- 17.1k
- Forks
- 3.2k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 11
Description
These are some of the thoughts I've had on the ipfs daemon. In my time writing a linux init daemon for it I've felt the architecture to be very strange. I have two different proposals to shoot for and discuss.
### Only have a system daemon
This idea is oriented around how most systems work. They have a system service and only certain users are granted read and/or write access. With this idea, users wouldn't run their own daemon nor have their own ipns entry. Permissions would be set up such that users must be in a specific group in order to write to the daemon and do things like pinning and publishing. Not everyone needs their own ipns entry. They just need some place to write to in the same way that traditional webservers work with multiple users. Alternatively, would it be even possible for a single daemon to be the authority on multiple ipns entries? I'm guessing that would require it to have multiple peer id's. This idea also assumes that ipns would be the only hindrance and reason to stay away.
### Have a system daemon and user daemons
This idea is oriented around the idea that every user on a system should have their own ipns entry, or at least the fact that a single system should be able to be the authority on multiple ipns entries. I assume there's additional use cases than multiple ipns entries, but it's the first that popped into my head. The key to this is to split out the system stuff from the user stuff which also makes it more complicated.
System level:
- Mounting /ipfs and /ipns
- Gateway access
User level:
- IPNS publishing
- Pinning
- Adding
It would be nice if the daemon had the following features to make running by the system cleaner:
- Mounting needs to be done as root. Then we can reduce privileges when the mount has completed. This will make it so that people won't have to modify their fuse.conf to get the desired allow_other behavior.
- /ipns/local doesn't make much sense for the system daemon. A globally writable /ipns/local makes even less sense. I noticed that I can't use chmod or chown within the /ipns directory either, is this a fuse limitation or have we simply not implemented that functionality yet?
- ~~Can mounting not be a separate command, done automatically by the daemon, and simply be enabled or disabled from the config?~~ --mount flag
Running the daemon as a user:
- Improve the usability by having the daemon automatically start if it hasn't started when an ipfs command is given. The daemon can simply sit in the background.
- Turn off the gateway.
- Have /ipns/local mounted to their home directory.
Notes on all:
- Lock down the localhost api servers so they aren't globally accessible by everyone on a system.
Contributor guide
Assessment
This issue has not been assessed yet.