hyperboria / bugs

Peer-to-peer IPv6 networking, secure and near-zero-conf.
154 stars 17 forks source link

How to build cjdns using make.js #191

Open s243a opened 4 years ago

s243a commented 4 years ago

This might be and andoid/termux specific issue but I'm interested in how to do this in general. I do the following:

npm install cjdns -g
cd $PREFIX/lib/node_modules/cjdns/node_build
git init
git config --global username <your username>
git config --global user.email <Your Email Address>
git add .
git commit -am “initial commit”
node make.js
node make.js install

termux tells me that everything builds fine but I can't find cjdroute.

If I search for it with the command:

find $PREFIX -name 'chdroute*' | grep bin

I don't see any files with this name in an expected directory like $PREFIX/bin

P.S. if I so happen to be able to build this then I"m expecting to run it with the $PREFIX/etc/initd/cjdns script that I get as follows:

mkdir -p $PREFIX/etc/default
curl -o $PREFIX/etc/default/cjdns https://raw.githubusercontent.com/prurigro/cjdns-git-sysvinit/master/cjdns 
sed -i 's@\"/usr/bin\"@\"'$PREFIX'/bin\"@g' $PREFIX/etc/default/cjdns
sed -i 's@\"/etc/cjdroute.conf\"@\"'$PREFIX'/etc/cjdroute.conf\"@g' $PREFIX/etc/default/cjdns
mkdir -p $PREFIX/etc/init.d
curl -o $PREFIX/etc/init.d/cjdns https://raw.githubusercontent.com/prurigro/cjdns-git-sysvinit/master/cjdns.sh 
chmod +x $PREFIX/etc/init.d/cjdns
sed -i "s@ /etc/default/cjdns@ $PREFIX/etc/default/cjdns@g" $PREFIX/etc/init.d/cjdns

I know that it might not work on termux and if does I might need root, but I might face similar issues with trying to install on linux. P.S. it should be possible to run cjdns on android without root because there are aps that can create a tuntap device, which doen't require root.

s243a commented 4 years ago

I found a differnet way to supposedly build cjdns for termux:

git clone https://github.com/cjdelisle/cjdns.git
cd cjdns
./do

The same thing hapens as does when I try to build from the package installed via node.js and so I'm not sure if anything actually gets built! Anyway, the above link also mentions how you are supposed to create the tunnel device:

mknod /dev/net/tun c 10 200

this doesn't work without root and it is possible a custom android kernal could use different device numbers. I read somewhere else that there are user space virtual tunnel devices:

https://android.googlesource.com/kernel/msm/+/android-msm-hammerhead-3.4-marshmallow-mr2/Documentation/networking/tuntap.txt

For example:

http://vtun.sourceforge.net/setup.html http://vtun.sourceforge.net/download.html

I will try compiling vun on termux and see if I can get it to work with cjdns.

lovelynamess commented 4 years ago

I have trouble finding the peer. Could you help me?

progval commented 4 years ago

@Jacker7777 Your problem does not seem to be related to this issue. Could you open a new one with and give more details about your question?