RangerMauve / dat-store

A CLI tool for backing up hyperdrive datasets
GNU Affero General Public License v3.0
59 stars 14 forks source link

suggestion for dat-store #55

Closed chekanov closed 2 years ago

chekanov commented 2 years ago

Hello,

We are considering this P2P "dat" project for https://encycloreader.org It is possible to build a downloadable zip file for dat-store that can be unpacked and run without admin privileges on Linux, similar to the "dat" project? This command "npm install -g dat-store" requires sudo.

S.C.

RangerMauve commented 2 years ago

I usually use the pkg library for building binaries. And I've got a similar workflow going for other projects like hyper-gateway

Unfortunately I don't have spare time or budget to work on adding that functionality here, but I'm down to review pull requests or do a short term consultation to get it in. 😁

RangerMauve commented 2 years ago

I would strongly suggest to move to the new tools using the hypercore-protocol rather than the Dat CLI since they have better reliability for connecting across networks and are more actively maintained. (the latest version of dat-store uses these for example)

chekanov commented 2 years ago

Thanks a lot! Let's me read more about this project. We are already running this network using "dat" (since the program can be just unzipped and ready to go). Maybe I'll find figure out how to create just a zip file with hyper-gateway.

RangerMauve commented 2 years ago

You could actually just use the .exe from the releases page without needing to use a zip file. 😁 https://github.com/RangerMauve/hyper-gateway/releases/tag/v2.1.3

The same thing can be done for dat-store, which would also be closer to what you'd be using the dat cli for since it can sync folders.

chekanov commented 2 years ago

Thanks. Yes, hyper-gateway-linux executable works on Ubuntu 20.04. It would be great to have something like this for dat-store since we are sharing folders. I cannot install dat-store even as a sudo. This command npm install -g dat-store gives the error:

> better-sqlite3@7.4.5 install /usr/local/lib/node_modules/dat-store/node_modules/better-sqlite3
> prebuild-install || npm run build-release

prebuild-install WARN install EACCES: permission denied, access '/root/.npm'
npm ERR! code EACCES
npm ERR! syscall scandir
npm ERR! path /root/.npm/_logs
npm ERR! errno -13
npm ERR! 
npm ERR! Your cache folder contains root-owned files, due to a bug in
npm ERR! previous versions of npm which has since been addressed.
npm ERR! 
npm ERR! To permanently fix this problem, please run:
npm ERR!   sudo chown -R 65534:1000 "/root/.npm"
glob error { [Error: EACCES: permission denied, scandir '/root/.npm/_logs']
  errno: -13,
  code: 'EACCES',
  syscall: 'scandir',
  path: '/root/.npm/_logs' }

> better-sqlite3@7.4.5 build-release /usr/local/lib/node_modules/dat-store/node_modules/better-sqlite3
> node-gyp rebuild --release

gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/dat-store/node_modules/better-sqlite3/build'
gyp ERR! System Linux 5.4.0-91-generic
gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "rebuild" "--release"
gyp ERR! cwd /usr/local/lib/node_modules/dat-store/node_modules/better-sqlite3
gyp ERR! node -v v10.19.0
gyp ERR! node-gyp -v v6.1.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! better-sqlite3@7.4.5 build-release: `node-gyp rebuild --release`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the better-sqlite3@7.4.5 build-release script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

> os-service@2.2.0 install /usr/local/lib/node_modules/dat-store/node_modules/os-service
> node-gyp rebuild

gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/dat-store/node_modules/os-service/build'
gyp ERR! System Linux 5.4.0-91-generic
gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/dat-store/node_modules/os-service
gyp ERR! node -v v10.19.0
gyp ERR! node-gyp -v v6.1.0
gyp ERR! not ok 
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: better-sqlite3@7.4.5 (node_modules/dat-store/node_modules/better-sqlite3):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: better-sqlite3@7.4.5 install: `prebuild-install || npm run build-release`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 243

Tried to fix as sudo chown -R 65534:1000 "/root/.npm" but this does not help. When I ran the second time, it gives the same error.

RangerMauve commented 2 years ago

Hey, I took your suggestion to heart and updated dat-store with automated releases with binary files, similar to hyper-gateway.

You can check them out in the latest Release: https://github.com/datproject/dat-store/releases/tag/v6.3.1