Mesh install
This commit is contained in:
parent
1657653079
commit
bee3da28bc
|
@ -7030,10 +7030,10 @@ function install_tox_client {
|
||||||
exit 74872
|
exit 74872
|
||||||
fi
|
fi
|
||||||
make install
|
make install
|
||||||
su -c 'echo "n
|
su -c "echo 'n
|
||||||
/nick $MY_USERNAME
|
/nick $MY_USERNAME
|
||||||
/exit
|
/exit
|
||||||
" | /usr/bin/toxic -d' - $MY_USERNAME
|
' | /usr/bin/toxic -d" - $MY_USERNAME
|
||||||
|
|
||||||
echo 'install_tox_client' >> $COMPLETION_FILE
|
echo 'install_tox_client' >> $COMPLETION_FILE
|
||||||
}
|
}
|
||||||
|
|
|
@ -301,7 +301,7 @@ EOF
|
||||||
echo " ${PROJECT_NAME} menuconfig-onion" >> $rootdir/root/.bashrc
|
echo " ${PROJECT_NAME} menuconfig-onion" >> $rootdir/root/.bashrc
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo ' echo ""'
|
echo " echo ''" >> $rootdir/root/.bashrc
|
||||||
fi
|
fi
|
||||||
echo ' if [ "$?" = "0" ]; then' >> $rootdir/root/.bashrc
|
echo ' if [ "$?" = "0" ]; then' >> $rootdir/root/.bashrc
|
||||||
echo " if [ -f ~/${PROJECT_NAME}-completed.txt ]; then" >> $rootdir/root/.bashrc
|
echo " if [ -f ~/${PROJECT_NAME}-completed.txt ]; then" >> $rootdir/root/.bashrc
|
||||||
|
@ -501,7 +501,6 @@ mesh_firewall() {
|
||||||
mesh_tox_node() {
|
mesh_tox_node() {
|
||||||
TOX_REPO='git://github.com/irungentoo/toxcore.git'
|
TOX_REPO='git://github.com/irungentoo/toxcore.git'
|
||||||
TOX_COMMIT='73b2144edcfd1ca617e9054479b66ab0c0361a14'
|
TOX_COMMIT='73b2144edcfd1ca617e9054479b66ab0c0361a14'
|
||||||
TOX_BOOTSTRAP_ID_FILE=/var/lib/tox-bootstrapd/pubkey.txt
|
|
||||||
# These are some default nodes, but you can replace them with trusted nodes
|
# These are some default nodes, but you can replace them with trusted nodes
|
||||||
# as you prefer. See https://wiki.tox.im/Nodes
|
# as you prefer. See https://wiki.tox.im/Nodes
|
||||||
TOX_NODES=
|
TOX_NODES=
|
||||||
|
@ -515,7 +514,7 @@ mesh_tox_node() {
|
||||||
chroot "$rootdir" apt-get -y install libsodium13 libsodium-dev libcap2-bin
|
chroot "$rootdir" apt-get -y install libsodium13 libsodium-dev libcap2-bin
|
||||||
chroot "$rootdir" apt-get -y install libconfig9 libconfig-dev
|
chroot "$rootdir" apt-get -y install libconfig9 libconfig-dev
|
||||||
|
|
||||||
git clone $TOX_REPO $rootdir/$INSTALL_DIR/toxcore
|
chroot "$rootdir" git clone $TOX_REPO $INSTALL_DIR/toxcore
|
||||||
chroot "$rootdir" cd $INSTALL_DIR/toxcore
|
chroot "$rootdir" cd $INSTALL_DIR/toxcore
|
||||||
chroot "$rootdir" git checkout $TOX_COMMIT -b $TOX_COMMIT
|
chroot "$rootdir" git checkout $TOX_COMMIT -b $TOX_COMMIT
|
||||||
|
|
||||||
|
@ -588,6 +587,18 @@ mesh_tox_node() {
|
||||||
chroot "$rootdir" systemctl enable tox-bootstrapd.service
|
chroot "$rootdir" systemctl enable tox-bootstrapd.service
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function mesh_tox_client {
|
||||||
|
chroot "$rootdir" apt-get -y install libncursesw5-dev libconfig-dev libqrencode-dev libcurl4-openssl-dev
|
||||||
|
|
||||||
|
chroot "$rootdir" git clone $TOXIC_REPO $INSTALL_DIR/toxic
|
||||||
|
chroot "$rootdir" cd $INSTALL_DIR/toxic
|
||||||
|
chroot "$rootdir" git checkout $TOXIC_COMMIT -b $TOXIC_COMMIT
|
||||||
|
echo "Toxic commit:$TOXIC_COMMIT" >> $rootdir$COMPLETION_FILE
|
||||||
|
|
||||||
|
chroot "$rootdir" make
|
||||||
|
chroot "$rootdir" make install
|
||||||
|
}
|
||||||
|
|
||||||
function mesh_zeronet {
|
function mesh_zeronet {
|
||||||
ZERONET_REPO='https://github.com/HelloZeroNet/ZeroNet.git'
|
ZERONET_REPO='https://github.com/HelloZeroNet/ZeroNet.git'
|
||||||
ZERONET_COMMIT='675bd462556c541d65e2d95f91f899146a373aad'
|
ZERONET_COMMIT='675bd462556c541d65e2d95f91f899146a373aad'
|
||||||
|
@ -621,7 +632,7 @@ function mesh_zeronet {
|
||||||
echo 'User=zeronet' >> $rootdir/etc/systemd/system/zeronet.service
|
echo 'User=zeronet' >> $rootdir/etc/systemd/system/zeronet.service
|
||||||
echo 'Group=zeronet' >> $rootdir/etc/systemd/system/zeronet.service
|
echo 'Group=zeronet' >> $rootdir/etc/systemd/system/zeronet.service
|
||||||
echo 'WorkingDirectory=/opt/zeronet' >> $rootdir/etc/systemd/system/zeronet.service
|
echo 'WorkingDirectory=/opt/zeronet' >> $rootdir/etc/systemd/system/zeronet.service
|
||||||
echo "ExecStart=/usr/bin/python zeronet.py --ip_external ${DEFAULT_DOMAIN_NAME}.local --trackers_file /opt/zeronet/bootstrap" >> $rootdir/etc/systemd/system/zeronet.service
|
echo 'ExecStart=/usr/bin/python zeronet.py --ip_external replace.local --trackers_file /opt/zeronet/bootstrap' >> $rootdir/etc/systemd/system/zeronet.service
|
||||||
echo '' >> $rootdir/etc/systemd/system/zeronet.service
|
echo '' >> $rootdir/etc/systemd/system/zeronet.service
|
||||||
echo 'TimeoutSec=300' >> $rootdir/etc/systemd/system/zeronet.service
|
echo 'TimeoutSec=300' >> $rootdir/etc/systemd/system/zeronet.service
|
||||||
echo '' >> $rootdir/etc/systemd/system/zeronet.service
|
echo '' >> $rootdir/etc/systemd/system/zeronet.service
|
||||||
|
@ -665,6 +676,7 @@ initialise_mesh() {
|
||||||
mesh_avahi
|
mesh_avahi
|
||||||
mesh_batman
|
mesh_batman
|
||||||
mesh_tox_node
|
mesh_tox_node
|
||||||
|
mesh_tox_client
|
||||||
mesh_zeronet
|
mesh_zeronet
|
||||||
|
|
||||||
MESH_SERVICE='mesh-setup.service'
|
MESH_SERVICE='mesh-setup.service'
|
||||||
|
|
|
@ -32,6 +32,7 @@ export TEXTDOMAIN=${PROJECT_NAME}-image-mesh
|
||||||
export TEXTDOMAINDIR="/usr/share/locale"
|
export TEXTDOMAINDIR="/usr/share/locale"
|
||||||
|
|
||||||
MY_USERNAME='fbone'
|
MY_USERNAME='fbone'
|
||||||
|
PEER_ID=
|
||||||
|
|
||||||
function change_avahi_name {
|
function change_avahi_name {
|
||||||
decarray=( 1 2 3 4 5 6 7 8 9 0 )
|
decarray=( 1 2 3 4 5 6 7 8 9 0 )
|
||||||
|
@ -53,6 +54,10 @@ function regenerate_ssh_host_keys {
|
||||||
echo $'ssh small moduli removed'
|
echo $'ssh small moduli removed'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function configure_zeronet {
|
||||||
|
sed -i "s|replace.local|P${PEER_ID}.local|g" /etc/systemd/system/zeronet.service
|
||||||
|
}
|
||||||
|
|
||||||
function configure_zeronet_blog {
|
function configure_zeronet_blog {
|
||||||
echo $'Updating ZeroNet Blog'
|
echo $'Updating ZeroNet Blog'
|
||||||
ZERONET_DEFAULT_BLOG_TITLE="${MY_USERNAME}'s Blog"
|
ZERONET_DEFAULT_BLOG_TITLE="${MY_USERNAME}'s Blog"
|
||||||
|
@ -60,8 +65,8 @@ function configure_zeronet_blog {
|
||||||
cd /opt/zeronet
|
cd /opt/zeronet
|
||||||
python zeronet.py --batch siteCreate 2> /opt/zeronet/blog.txt
|
python zeronet.py --batch siteCreate 2> /opt/zeronet/blog.txt
|
||||||
if [ ! -f /opt/zeronet/blog.txt ]; then
|
if [ ! -f /opt/zeronet/blog.txt ]; then
|
||||||
echo $'Unable to create blog'
|
echo $'Unable to create ZeroNet blog'
|
||||||
exit 479
|
exit 7386
|
||||||
fi
|
fi
|
||||||
blog_address=$(cat blog.txt | grep "Site address" | awk -F ':' '{print $2}')
|
blog_address=$(cat blog.txt | grep "Site address" | awk -F ':' '{print $2}')
|
||||||
blog_private_key=$(cat blog.txt | grep "Site private key" | awk -F ':' '{print $2}')
|
blog_private_key=$(cat blog.txt | grep "Site private key" | awk -F ':' '{print $2}')
|
||||||
|
@ -132,8 +137,8 @@ function configure_zeronet_mail {
|
||||||
cd /opt/zeronet
|
cd /opt/zeronet
|
||||||
python zeronet.py --batch siteCreate 2> /opt/zeronet/mail.txt
|
python zeronet.py --batch siteCreate 2> /opt/zeronet/mail.txt
|
||||||
if [ ! -f /opt/zeronet/mail.txt ]; then
|
if [ ! -f /opt/zeronet/mail.txt ]; then
|
||||||
echo 'Unable to create mail'
|
echo $'Unable to create ZeroNet mail'
|
||||||
exit 479
|
exit 72574
|
||||||
fi
|
fi
|
||||||
mail_address=$(cat mail.txt | grep "Site address" | awk -F ':' '{print $2}')
|
mail_address=$(cat mail.txt | grep "Site address" | awk -F ':' '{print $2}')
|
||||||
mail_private_key=$(cat mail.txt | grep "Site private key" | awk -F ':' '{print $2}')
|
mail_private_key=$(cat mail.txt | grep "Site private key" | awk -F ':' '{print $2}')
|
||||||
|
@ -204,8 +209,8 @@ function configure_zeronet_forum {
|
||||||
cd /opt/zeronet
|
cd /opt/zeronet
|
||||||
python zeronet.py --batch siteCreate 2> /opt/zeronet/forum.txt
|
python zeronet.py --batch siteCreate 2> /opt/zeronet/forum.txt
|
||||||
if [ ! -f /opt/zeronet/forum.txt ]; then
|
if [ ! -f /opt/zeronet/forum.txt ]; then
|
||||||
echo 'Unable to create forum'
|
echo $'Unable to create ZeroNet forum'
|
||||||
exit 479
|
exit 47962
|
||||||
fi
|
fi
|
||||||
forum_address=$(cat forum.txt | grep "Site address" | awk -F ':' '{print $2}')
|
forum_address=$(cat forum.txt | grep "Site address" | awk -F ':' '{print $2}')
|
||||||
forum_private_key=$(cat forum.txt | grep "Site private key" | awk -F ':' '{print $2}')
|
forum_private_key=$(cat forum.txt | grep "Site private key" | awk -F ':' '{print $2}')
|
||||||
|
@ -274,8 +279,8 @@ function configure_tox {
|
||||||
TOX_BOOTSTRAP_ID_FILE=/var/lib/tox-bootstrapd/pubkey.txt
|
TOX_BOOTSTRAP_ID_FILE=/var/lib/tox-bootstrapd/pubkey.txt
|
||||||
TOX_PUBLIC_KEY=$(cat /var/log/syslog | grep tox | grep "Public Key" | awk -F ' ' '{print $8}' | tail -1)
|
TOX_PUBLIC_KEY=$(cat /var/log/syslog | grep tox | grep "Public Key" | awk -F ' ' '{print $8}' | tail -1)
|
||||||
if [ ${#TOX_PUBLIC_KEY} -lt 30 ]; then
|
if [ ${#TOX_PUBLIC_KEY} -lt 30 ]; then
|
||||||
echo 'Could not obtain the tox node public key'
|
echo $'WARNING: Could not obtain the tox node public key'
|
||||||
exit 6529
|
exit 46362
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# save the public key for later reference
|
# save the public key for later reference
|
||||||
|
@ -284,10 +289,10 @@ function configure_tox {
|
||||||
echo $'Resetting toxic client'
|
echo $'Resetting toxic client'
|
||||||
if [ -d /home/$MY_USERNAME/.config/tox ]; then
|
if [ -d /home/$MY_USERNAME/.config/tox ]; then
|
||||||
rm -rf /home/$MY_USERNAME/.config/tox
|
rm -rf /home/$MY_USERNAME/.config/tox
|
||||||
su -c 'echo "n
|
su -c "echo 'n
|
||||||
/nick $MY_USERNAME
|
/nick P$PEER_ID
|
||||||
/exit
|
/exit
|
||||||
" | /usr/bin/toxic -d' - $MY_USERNAME
|
' | /usr/bin/toxic -d" - $MY_USERNAME
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -296,12 +301,16 @@ if [ -f /root/.initial_mesh_setup ]; then
|
||||||
MY_USERNAME=$1
|
MY_USERNAME=$1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# sleep in order to allow other daemons to start up
|
||||||
|
sleep 15
|
||||||
|
|
||||||
|
change_avahi_name
|
||||||
regenerate_ssh_host_keys
|
regenerate_ssh_host_keys
|
||||||
configure_zeronet_blog
|
configure_zeronet_blog
|
||||||
configure_zeronet_mail
|
configure_zeronet_mail
|
||||||
configure_zeronet_forum
|
configure_zeronet_forum
|
||||||
configure_tox
|
configure_tox
|
||||||
change_avahi_name
|
configure_zeronet
|
||||||
|
|
||||||
rm /root/.initial_mesh_setup
|
rm /root/.initial_mesh_setup
|
||||||
systemctl disable mesh-setup.service
|
systemctl disable mesh-setup.service
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
PROJECT_NAME='freedombone'
|
PROJECT_NAME='freedombone'
|
||||||
|
|
||||||
export TEXTDOMAIN=$PROJECT_NAME
|
export TEXTDOMAIN=$PROJECT_NAME-zeronetavahi
|
||||||
export TEXTDOMAINDIR="/usr/share/locale"
|
export TEXTDOMAINDIR="/usr/share/locale"
|
||||||
|
|
||||||
WEB_PAGE_TITLE=$"${PROJECT_NAME} Mesh"
|
WEB_PAGE_TITLE=$"${PROJECT_NAME} Mesh"
|
||||||
|
|
Loading…
Reference in New Issue