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

deploy-dat #5

Open
m-onz opened this issue Apr 5, 2018 · 12 comments
Open

deploy-dat #5

m-onz opened this issue Apr 5, 2018 · 12 comments
Labels

Comments

@m-onz
Copy link

m-onz commented Apr 5, 2018

Hey nice ideas.. I'm working on similar ideas so I would like to collaborate on making Raspberry Pi DAT servers.

Check out my project /deploy-dat which could be adapted for raspberry pi.. the idea being you can provision a Pi with a single shell script and run a server.

I will keep you posted on my efforts.

@callil
Copy link
Contributor

callil commented Apr 5, 2018

super cool - I'd love to make a small guide on setting this up. Maybe we can have a quick chat to walk through how it works.

@m-onz
Copy link
Author

m-onz commented Apr 5, 2018

Yes please get in touch.

Feel free to email me and we can do google hang out or something.. my details are on my website: www.tx11.co.uk

Incidentally I am running my websites using dat / dat sync --http!

I would love to help with this project! I'm in the process of moving away from the cloud and using Raspberry Pi's and server free architectures with DAT.

@neauoire
Copy link
Collaborator

neauoire commented Apr 5, 2018

Just tested with node-v8.11.1-linux-armv7l.tar.xz on a RPi3B+.
Works perfectly!

Cannot get forever to run on my Pi Zero W, I'll have to investigate. It's complaining about UTP-native.

@neauoire
Copy link
Collaborator

neauoire commented Apr 6, 2018

For anyone who want to install dat on a RPi:

wget https://nodejs.org/dist/v8.11.1/node-v8.11.1-linux-armv7l.tar.xz
tar xvf ./node-v8.11.1-linux-armv7l.tar.xz
cd node-v8.11.1-linux-armv7l/bin
sudo cp ./node /usr/bin/
sudo ./npm install npm@latest -g
npm update
sudo npm install dat -g

Will give an error:

gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/lib/node_modules/dat/node_modules/utp-native/.node-gyp/8.11.1"

But running, sudo npm install dat -g a second time will succeed.

pi@weather-station:~/node-v8.11.1-linux-armv7l/bin $ sudo npm install dat -g
/usr/bin/dat -> /usr/lib/node_modules/dat/bin/cli.js
+ [email protected]
updated 1 package in 26.3s

Success

pi@weather-station:~/node-v8.11.1-linux-armv7l/bin $ dat -v
13.10.0

@callil
Copy link
Contributor

callil commented Apr 6, 2018

@neauoire awesome! I also finished writing this guide earlier today which uses a slightly different method. Feel free to submit changes if you find anything that could be explained more clearly.

I like yours because the source looks more reliable / less shady.

@callil callil added the idea label Apr 6, 2018
@neauoire
Copy link
Collaborator

neauoire commented Apr 6, 2018

Excellent guide, I've added a note on renaming the device. If you use a pi zero for mirroring site, it's very likely that other raspberrypi named devices are active in the network, especially in the context of pebble.

@m-onz
Copy link
Author

m-onz commented Apr 6, 2018

Hey,

I'm working on cloudflare w. dynamic DNS solution as a helper package / repo that does the dynamic dns with cloudflare v4 api.. It should be ready by next week.

I noticed some discussion about dynamic DNS for making http servers accessible from behind home firewalls. I have another configuration that may work for those who who use cloudflare.

The process would be... get a free cloud flare account... create a domain etc. Set up the CDN and use the tunnel/CDN option. This gives you HTTPS and DDOS protection for free and lets you point directly to the dat http instance running on port 80.

deploy-dat => run deploy dat to get a dat folder running on port 80.

Set up dynamic DNS using the cloudflare API... https://support.cloudflare.com/hc/en-us/articles/200168816-Does-CloudFlare-work-with-Dynamic-DNS-Can-I-update-my-DNS-records-remotely-

...

I can write guides for AWS / digital ocean servers as well as raspberry Pis behind home routers.

Any objections?

@callil
Copy link
Contributor

callil commented Apr 12, 2018

This all sounds super good @m-onz - I'm going to give deploy at a shot tonight if I have time. I'd love to better understand the dynamic dns stuff.

I'd like to eventually make the frontend of https://github.com/new-computers/seeder public (as like a public seeder profile) so this could be a great integration.

@cblgh
Copy link

cblgh commented Apr 12, 2018

@neauoire i was installing ssb the other day on a server, and that error looks similar enough that i think maybe adding --unsafe-perm will make it work the first time!

so the new instructions for installing dat would then be

wget https://nodejs.org/dist/v8.11.1/node-v8.11.1-linux-armv7l.tar.xz
tar xvf ./node-v8.11.1-linux-armv7l.tar.xz
cd node-v8.11.1-linux-armv7l/bin
sudo cp ./node /usr/bin/
sudo ./npm install npm@latest -g
npm update
sudo npm install dat -g --unsafe-perm

(reason being root will drop in privilege for some of the native building iirc) - i haven't verified it yet though, just a hunch!

@neauoire
Copy link
Collaborator

Thanks a lot!
I'll give this a shot next time I flash a Pi :)

@m-onz
Copy link
Author

m-onz commented Apr 12, 2018

Maybe building from source would be more predictable / reliable...

git clone https://github.com/datproject/dat
cd dat
npm install
sudo npm install link

@neauoire
Copy link
Collaborator

I tried that, but on a rasp pi zero, it's very long, and install a lot of things that I don't think is needed on the device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants