|
@@ -477,6 +477,14 @@ TOX_NODES=
|
477
|
477
|
ZERONET_REPO=
|
478
|
478
|
ZERONET_COMMIT=
|
479
|
479
|
ZERONET_PORT=
|
|
480
|
+ZERONET_BLOG_REPO=
|
|
481
|
+ZERONET_BLOG_COMMIT=
|
|
482
|
+ZERONET_MAIL_REPO=
|
|
483
|
+ZERONET_MAIL_COMMIT=
|
|
484
|
+ZERONET_FORUM_REPO=
|
|
485
|
+ZERONET_FORUM_COMMIT=
|
|
486
|
+ZERONET_ID_REPO=
|
|
487
|
+ZERONET_ID_COMMIT=
|
480
|
488
|
|
481
|
489
|
# Directory where source code is downloaded and compiled
|
482
|
490
|
INSTALL_DIR=$HOME/build
|
|
@@ -981,6 +989,96 @@ function mesh_zeronet {
|
981
|
989
|
chroot "$rootdir" systemctl enable zeronet.service
|
982
|
990
|
}
|
983
|
991
|
|
|
992
|
+function mesh_zeronet_blog {
|
|
993
|
+ if [ -f /usr/local/bin/${PROJECT_NAME} ]; then
|
|
994
|
+ ZERONET_BLOG_REPO=$(cat /usr/local/bin/${PROJECT_NAME} | grep "ZERONET_BLOG_REPO=" | head -n 1 | awk -F '"' '{print $2}')
|
|
995
|
+ ZERONET_BLOG_COMMIT=$(cat /usr/local/bin/${PROJECT_NAME} | grep "ZERONET_BLOG_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
|
|
996
|
+ else
|
|
997
|
+ ZERONET_BLOG_REPO=$(cat /usr/bin/${PROJECT_NAME} | grep "ZERONET_BLOG_REPO=" | head -n 1 | awk -F '"' '{print $2}')
|
|
998
|
+ ZERONET_BLOG_COMMIT=$(cat /usr/bin/${PROJECT_NAME} | grep "ZERONET_BLOG_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
|
|
999
|
+ fi
|
|
1000
|
+
|
|
1001
|
+ git clone $ZERONET_BLOG_REPO $rootdir/opt/zeronet/ZeroBlog
|
|
1002
|
+ if [ ! -d $rootdir/opt/zeronet/ZeroBlog ]; then
|
|
1003
|
+ echo $'ZeroBlog repo could not be cloned'
|
|
1004
|
+ exit 6739
|
|
1005
|
+ fi
|
|
1006
|
+ cd $rootdir/opt/zeronet/ZeroBlog
|
|
1007
|
+ git checkout $ZERONET_BLOG_COMMIT -b $ZERONET_BLOG_COMMIT
|
|
1008
|
+ chroot "$rootdir" chown -R zeronet:zeronet /opt/zeronet
|
|
1009
|
+}
|
|
1010
|
+
|
|
1011
|
+function mesh_zeronet_mail {
|
|
1012
|
+ if [ -f /usr/local/bin/${PROJECT_NAME} ]; then
|
|
1013
|
+ ZERONET_MAIL_REPO=$(cat /usr/local/bin/${PROJECT_NAME} | grep "ZERONET_MAIL_REPO=" | head -n 1 | awk -F '"' '{print $2}')
|
|
1014
|
+ ZERONET_MAIL_COMMIT=$(cat /usr/local/bin/${PROJECT_NAME} | grep "ZERONET_MAIL_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
|
|
1015
|
+ else
|
|
1016
|
+ ZERONET_MAIL_REPO=$(cat /usr/bin/${PROJECT_NAME} | grep "ZERONET_MAIL_REPO=" | head -n 1 | awk -F '"' '{print $2}')
|
|
1017
|
+ ZERONET_MAIL_COMMIT=$(cat /usr/bin/${PROJECT_NAME} | grep "ZERONET_MAIL_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
|
|
1018
|
+ fi
|
|
1019
|
+
|
|
1020
|
+ git clone $ZERONET_MAIL_REPO $rootdir/opt/zeronet/ZeroMail
|
|
1021
|
+ if [ ! -d $rootdir/opt/zeronet/ZeroMail ]; then
|
|
1022
|
+ echo $'ZeroMail repo could not be cloned'
|
|
1023
|
+ exit 78493
|
|
1024
|
+ fi
|
|
1025
|
+ cd $rootdir/opt/zeronet/ZeroMail
|
|
1026
|
+ git checkout $ZERONET_MAIL_COMMIT -b $ZERONET_MAIL_COMMIT
|
|
1027
|
+ chroot "$rootdir" chown -R zeronet:zeronet /opt/zeronet
|
|
1028
|
+}
|
|
1029
|
+
|
|
1030
|
+function mesh_zeronet_forum {
|
|
1031
|
+ if [ -f /usr/local/bin/${PROJECT_NAME} ]; then
|
|
1032
|
+ ZERONET_FORUM_REPO=$(cat /usr/local/bin/${PROJECT_NAME} | grep "ZERONET_FORUM_REPO=" | head -n 1 | awk -F '"' '{print $2}')
|
|
1033
|
+ ZERONET_FORUM_COMMIT=$(cat /usr/local/bin/${PROJECT_NAME} | grep "ZERONET_FORUM_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
|
|
1034
|
+ else
|
|
1035
|
+ ZERONET_FORUM_REPO=$(cat /usr/bin/${PROJECT_NAME} | grep "ZERONET_FORUM_REPO=" | head -n 1 | awk -F '"' '{print $2}')
|
|
1036
|
+ ZERONET_FORUM_COMMIT=$(cat /usr/bin/${PROJECT_NAME} | grep "ZERONET_FORUM_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
|
|
1037
|
+ fi
|
|
1038
|
+
|
|
1039
|
+ git clone $ZERONET_FORUM_REPO $rootdir/opt/zeronet/ZeroTalk
|
|
1040
|
+ if [ ! -d $rootdir/opt/zeronet/ZeroTalk ]; then
|
|
1041
|
+ echo $'ZeroTalk repo could not be cloned'
|
|
1042
|
+ exit 78252
|
|
1043
|
+ fi
|
|
1044
|
+ cd $rootdir/opt/zeronet/ZeroTalk
|
|
1045
|
+ git checkout $ZERONET_FORUM_COMMIT -b $ZERONET_FORUM_COMMIT
|
|
1046
|
+ chroot "$rootdir" chown -R zeronet:zeronet /opt/zeronet
|
|
1047
|
+}
|
|
1048
|
+
|
|
1049
|
+function mesh_zeronet_id {
|
|
1050
|
+ if [ -f /usr/local/bin/${PROJECT_NAME} ]; then
|
|
1051
|
+ ZERONET_ID_REPO=$(cat /usr/local/bin/${PROJECT_NAME} | grep "ZERONET_ID_REPO=" | head -n 1 | awk -F '"' '{print $2}')
|
|
1052
|
+ ZERONET_ID_COMMIT=$(cat /usr/local/bin/${PROJECT_NAME} | grep "ZERONET_ID_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
|
|
1053
|
+ else
|
|
1054
|
+ ZERONET_ID_REPO=$(cat /usr/bin/${PROJECT_NAME} | grep "ZERONET_ID_REPO=" | head -n 1 | awk -F '"' '{print $2}')
|
|
1055
|
+ ZERONET_ID_COMMIT=$(cat /usr/bin/${PROJECT_NAME} | grep "ZERONET_ID_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
|
|
1056
|
+ fi
|
|
1057
|
+
|
|
1058
|
+ git clone $ZERONET_ID_REPO $rootdir/opt/zeronet/ZeroID
|
|
1059
|
+ if [ ! -d $rootdir/opt/zeronet/ZeroID ]; then
|
|
1060
|
+ echo $'ZeroID repo could not be cloned'
|
|
1061
|
+ exit 37936
|
|
1062
|
+ fi
|
|
1063
|
+ cd $rootdir/opt/zeronet/ZeroID
|
|
1064
|
+ git checkout $ZERONET_ID_COMMIT -b $ZERONET_ID_COMMIT
|
|
1065
|
+ chroot "$rootdir" chown -R zeronet:zeronet /opt/zeronet
|
|
1066
|
+}
|
|
1067
|
+
|
|
1068
|
+function mesh_web_server {
|
|
1069
|
+ if [ -d /etc/apache2 ]; then
|
|
1070
|
+ chroot "$rootdir" apt-get -y remove --purge apache2
|
|
1071
|
+ chroot "$rootdir" rm -rf /etc/apache2
|
|
1072
|
+ fi
|
|
1073
|
+
|
|
1074
|
+ chroot "$rootdir" apt-get -y install nginx
|
|
1075
|
+
|
|
1076
|
+ if [ ! -d /etc/nginx ]; then
|
|
1077
|
+ echo $'Unable to install web server'
|
|
1078
|
+ exit 346825
|
|
1079
|
+ fi
|
|
1080
|
+}
|
|
1081
|
+
|
984
|
1082
|
initialise_mesh() {
|
985
|
1083
|
if [[ $VARIANT != "mesh" && $VARIANT != "meshclient" && $VARIANT != "meshusb" ]]; then
|
986
|
1084
|
return
|
|
@@ -1012,7 +1110,11 @@ initialise_mesh() {
|
1012
|
1110
|
mesh_tox_node
|
1013
|
1111
|
mesh_tox_avahi
|
1014
|
1112
|
mesh_tox_client
|
|
1113
|
+ mesh_web_server
|
1015
|
1114
|
mesh_zeronet
|
|
1115
|
+ mesh_zeronet_blog
|
|
1116
|
+ mesh_zeronet_mail
|
|
1117
|
+ mesh_zeronet_forum
|
1016
|
1118
|
|
1017
|
1119
|
MESH_SERVICE='mesh-setup.service'
|
1018
|
1120
|
MESH_SETUP_DAEMON=$rootdir/etc/systemd/system/$MESH_SERVICE
|