hypercore-protocol / hyperdrive-daemon

Hyperdrive, batteries included.
MIT License
156 stars 24 forks source link

nginx, hyperdrive-daemon and fuse #68

Open millette opened 4 years ago

millette commented 4 years ago

First, congrats on the relaunch. Long live Dat II! :-)

I just started using the daemon and so far so good. I got my normal user, "millette" and what that user I could setup, mount, create, etc.

Naively, I tried to add a ~/Hyperdrive/subdir to my nginx config (ok, I'm lying, I've moved to Caddy - great web server btw!) which has it's own user. When I did, the web server could not see the files under /home/millette/Hyperdrive/subdir.

cat /etc/mtab revealed this:

/dev/fuse /home/millette/Hyperdrive fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0

When I started the webserver as the user "millette" (instead of with it's normal user, thru service/systemd), I was able to see the subdir content just fine.

I'm not a fuse pro, so any hint here would be appreciated. Thanks!

Slightly related: #6

Let me know if there's a more appropriate place for support questions (haven't seen one on https://hypercore-protocol.org/).

pfrazee commented 4 years ago

Just wanted to say, hey Robin! Glad to see you again. (This is an andrew question so I'll let him handle it.)

On Thu, Jun 4, 2020 at 9:29 PM Robin Millette notifications@github.com wrote:

First, congrats on the relaunch. Long live Dat II! :-)

I just started using the daemon and so far so good. I got my normal user, "millette" and what that user I could setup, mount, create, etc.

Naively, I tried to add a ~/Hyperdrive/subdir to my nginx config (ok, I'm lying, I've moved to Caddy - great web server btw!) which has it's own user. When I did, the web server could not see the files under /home/millette/Hyperdrive/subdir.

cat /etc/mtab revealed this:

/dev/fuse /home/millette/Hyperdrive fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0

When I started the webserver as the user "millette" (instead of with it's normal user, thru service/systemd), I was able to see the subdir content just fine.

I'm not a fuse pro, so any hint here would be appreciated. Thanks!

Let me know if there's a more appropriate place for support questions (haven't seen one on https://hypercore-protocol.org/).

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hypercore-protocol/hyperdrive-daemon/issues/68, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJWCUZ3ALNZYD6I6HJA5HDRVBKABANCNFSM4NTE3ACQ .

mafintosh commented 4 years ago

For the webserver to normally work would it need to be owned by the webserver user?

millette commented 4 years ago

@mafintosh usually (not FUSE), the webserver only needs read access. Which it has thru the "other" rights (millette-owned 775, example for directories). But it's not enough in this case.

millette commented 4 years ago

After adding myself to the caddy (webserver) group (sudo adduser millette caddy - number 997 according to /etc/group) and doing:

hyperdrive stop
hyperdrive fuse-setup  --group=997 --force
hyperdrive start
grep Hyperdrive /etc/mtab

I'm still seeing

/dev/fuse /home/millette/Hyperdrive fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0

No change to the group.