|
@@ -529,6 +529,8 @@ ZERONET_DEFAULT_MAIL_TAGLINE="Mail for the Mesh"
|
529
|
529
|
ZERONET_ID_REPO="https://github.com/HelloZeroNet/ZeroID"
|
530
|
530
|
ZERONET_ID_COMMIT='ccf14fdc96fa9cdb2ddd8a7ab283a8e17a4f234b'
|
531
|
531
|
|
|
532
|
+MESH_INSTALL_DIR=/var/lib
|
|
533
|
+
|
532
|
534
|
# https://github.com/ipfs/go-ipfs
|
533
|
535
|
IPFS_GO_REPO="https://github.com/ipfs/go-ipfs"
|
534
|
536
|
IPFS_COMMIT='20b06a4cbce8884f5b194da6e98cb11f2c77f166'
|
|
@@ -2769,7 +2771,7 @@ function install_zeronet_blog {
|
2769
|
2771
|
return
|
2770
|
2772
|
fi
|
2771
|
2773
|
|
2772
|
|
- set_repo_commit /opt/zeronet/ZeroBlog "ZeroNet Blog commit" "$ZERONET_BLOG_COMMIT" $ZERONET_BLOG_REPO
|
|
2774
|
+ set_repo_commit $MESH_INSTALL_DIR/zeronet/ZeroBlog "ZeroNet Blog commit" "$ZERONET_BLOG_COMMIT" $ZERONET_BLOG_REPO
|
2773
|
2775
|
|
2774
|
2776
|
if grep -Fxq "install_zeronet_blog" $COMPLETION_FILE; then
|
2775
|
2777
|
return
|
|
@@ -2790,9 +2792,9 @@ function install_zeronet_blog {
|
2790
|
2792
|
|
2791
|
2793
|
ZERONET_DEFAULT_BLOG_TITLE="${MY_USERNAME}'s Blog"
|
2792
|
2794
|
|
2793
|
|
- cd /opt/zeronet
|
2794
|
|
- python zeronet.py --batch siteCreate 2> /opt/zeronet/blog.txt
|
2795
|
|
- if [ ! -f /opt/zeronet/blog.txt ]; then
|
|
2795
|
+ cd $MESH_INSTALL_DIR/zeronet
|
|
2796
|
+ python zeronet.py --batch siteCreate 2> $MESH_INSTALL_DIR/zeronet/blog.txt
|
|
2797
|
+ if [ ! -f $MESH_INSTALL_DIR/zeronet/blog.txt ]; then
|
2796
|
2798
|
echo $'Unable to create blog'
|
2797
|
2799
|
exit 479
|
2798
|
2800
|
fi
|
|
@@ -2815,17 +2817,17 @@ function install_zeronet_blog {
|
2815
|
2817
|
exit 1639
|
2816
|
2818
|
fi
|
2817
|
2819
|
|
2818
|
|
- if [ ! -d "/opt/zeronet/data/$ZERONET_BLOG_ADDRESS" ]; then
|
2819
|
|
- echo $"Unable to find site directory: /opt/zeronet/data/$ZERONET_BLOG_ADDRESS"
|
|
2820
|
+ if [ ! -d "$MESH_INSTALL_DIR/zeronet/data/$ZERONET_BLOG_ADDRESS" ]; then
|
|
2821
|
+ echo $"Unable to find site directory: $MESH_INSTALL_DIR/zeronet/data/$ZERONET_BLOG_ADDRESS"
|
2820
|
2822
|
exit 7638
|
2821
|
2823
|
fi
|
2822
|
2824
|
|
2823
|
2825
|
git_clone $ZERONET_BLOG_REPO ZeroBlog
|
2824
|
|
- if [ ! -d /opt/zeronet/ZeroBlog ]; then
|
|
2826
|
+ if [ ! -d $MESH_INSTALL_DIR/zeronet/ZeroBlog ]; then
|
2825
|
2827
|
echo $'ZeroBlog repo could not be cloned'
|
2826
|
2828
|
exit 6739
|
2827
|
2829
|
fi
|
2828
|
|
- cd /opt/zeronet/ZeroBlog
|
|
2830
|
+ cd $MESH_INSTALL_DIR/zeronet/ZeroBlog
|
2829
|
2831
|
git checkout $ZERONET_BLOG_COMMIT -b $ZERONET_BLOG_COMMIT
|
2830
|
2832
|
if ! grep -q "ZeroNet Blog commit" $COMPLETION_FILE; then
|
2831
|
2833
|
echo "ZeroNet Blog commit:$ZERONET_BLOG_COMMIT" >> $COMPLETION_FILE
|
|
@@ -2835,17 +2837,17 @@ function install_zeronet_blog {
|
2835
|
2837
|
|
2836
|
2838
|
echo $"ZeroNet Blog address: $ZERONET_BLOG_ADDRESS"
|
2837
|
2839
|
echo $"ZeroNet Blog private key: $ZERONET_BLOG_PRIVATE_KEY"
|
2838
|
|
- cp -r /opt/zeronet/ZeroBlog/* /opt/zeronet/data/$ZERONET_BLOG_ADDRESS
|
|
2840
|
+ cp -r $MESH_INSTALL_DIR/zeronet/ZeroBlog/* $MESH_INSTALL_DIR/zeronet/data/$ZERONET_BLOG_ADDRESS
|
2839
|
2841
|
|
2840
|
|
- if [ ! -d /opt/zeronet/data/$ZERONET_BLOG_ADDRESS/data ]; then
|
2841
|
|
- mkdir /opt/zeronet/data/$ZERONET_BLOG_ADDRESS/data
|
|
2842
|
+ if [ ! -d $MESH_INSTALL_DIR/zeronet/data/$ZERONET_BLOG_ADDRESS/data ]; then
|
|
2843
|
+ mkdir $MESH_INSTALL_DIR/zeronet/data/$ZERONET_BLOG_ADDRESS/data
|
2842
|
2844
|
fi
|
2843
|
|
- cp /opt/zeronet/data/$ZERONET_BLOG_ADDRESS/data-default/data.json /opt/zeronet/data/$ZERONET_BLOG_ADDRESS/data
|
2844
|
|
- sed -i "s/MyZeroBlog/$ZERONET_DEFAULT_BLOG_TITLE/g" /opt/zeronet/data/$ZERONET_BLOG_ADDRESS/data/data.json
|
2845
|
|
- sed -i "s/My ZeroBlog./$ZERONET_DEFAULT_BLOG_TAGLINE/g" /opt/zeronet/data/$ZERONET_BLOG_ADDRESS/data/data.json
|
2846
|
|
- sed -i "s/ZeroBlog Demo/$ZERONET_DEFAULT_BLOG_TITLE/g" /opt/zeronet/data/$ZERONET_BLOG_ADDRESS/index.html
|
2847
|
|
- sed -i "s|<h3 class=\"description\">.*|<h3 class=\"description\">$ZERONET_DEFAULT_BLOG_TAGLINE</h3>|g" /opt/zeronet/data/$ZERONET_BLOG_ADDRESS/index.html
|
2848
|
|
- sed -i "s/Blogging platform Demo/Blogging platform/g" /opt/zeronet/data/$ZERONET_BLOG_ADDRESS/content.json
|
|
2845
|
+ cp $MESH_INSTALL_DIR/zeronet/data/$ZERONET_BLOG_ADDRESS/data-default/data.json $MESH_INSTALL_DIR/zeronet/data/$ZERONET_BLOG_ADDRESS/data
|
|
2846
|
+ sed -i "s/MyZeroBlog/$ZERONET_DEFAULT_BLOG_TITLE/g" $MESH_INSTALL_DIR/zeronet/data/$ZERONET_BLOG_ADDRESS/data/data.json
|
|
2847
|
+ sed -i "s/My ZeroBlog./$ZERONET_DEFAULT_BLOG_TAGLINE/g" $MESH_INSTALL_DIR/zeronet/data/$ZERONET_BLOG_ADDRESS/data/data.json
|
|
2848
|
+ sed -i "s/ZeroBlog Demo/$ZERONET_DEFAULT_BLOG_TITLE/g" $MESH_INSTALL_DIR/zeronet/data/$ZERONET_BLOG_ADDRESS/index.html
|
|
2849
|
+ sed -i "s|<h3 class=\"description\">.*|<h3 class=\"description\">$ZERONET_DEFAULT_BLOG_TAGLINE</h3>|g" $MESH_INSTALL_DIR/zeronet/data/$ZERONET_BLOG_ADDRESS/index.html
|
|
2850
|
+ sed -i "s/Blogging platform Demo/Blogging platform/g" $MESH_INSTALL_DIR/zeronet/data/$ZERONET_BLOG_ADDRESS/content.json
|
2849
|
2851
|
python zeronet.py siteSign $ZERONET_BLOG_ADDRESS $ZERONET_BLOG_PRIVATE_KEY
|
2850
|
2852
|
|
2851
|
2853
|
# Add an avahi service
|
|
@@ -2881,7 +2883,7 @@ function install_zeronet_mail {
|
2881
|
2883
|
return
|
2882
|
2884
|
fi
|
2883
|
2885
|
|
2884
|
|
- set_repo_commit /opt/zeronet/ZeroMail "ZeroNet Mail commit" "$ZERONET_MAIL_COMMIT" $ZERONET_MAIL_REPO
|
|
2886
|
+ set_repo_commit $MESH_INSTALL_DIR/zeronet/ZeroMail "ZeroNet Mail commit" "$ZERONET_MAIL_COMMIT" $ZERONET_MAIL_REPO
|
2885
|
2887
|
|
2886
|
2888
|
if grep -Fxq "install_zeronet_mail" $COMPLETION_FILE; then
|
2887
|
2889
|
return
|
|
@@ -2902,9 +2904,9 @@ function install_zeronet_mail {
|
2902
|
2904
|
|
2903
|
2905
|
ZERONET_DEFAULT_MAIL_TITLE="${MY_USERNAME}'s Mail"
|
2904
|
2906
|
|
2905
|
|
- cd /opt/zeronet
|
2906
|
|
- python zeronet.py --batch siteCreate 2> /opt/zeronet/mail.txt
|
2907
|
|
- if [ ! -f /opt/zeronet/mail.txt ]; then
|
|
2907
|
+ cd $MESH_INSTALL_DIR/zeronet
|
|
2908
|
+ python zeronet.py --batch siteCreate 2> $MESH_INSTALL_DIR/zeronet/mail.txt
|
|
2909
|
+ if [ ! -f $MESH_INSTALL_DIR/zeronet/mail.txt ]; then
|
2908
|
2910
|
echo $'Unable to create mail'
|
2909
|
2911
|
exit 479
|
2910
|
2912
|
fi
|
|
@@ -2927,17 +2929,17 @@ function install_zeronet_mail {
|
2927
|
2929
|
exit 1639
|
2928
|
2930
|
fi
|
2929
|
2931
|
|
2930
|
|
- if [ ! -d "/opt/zeronet/data/$ZERONET_MAIL_ADDRESS" ]; then
|
2931
|
|
- echo $"Unable to find site directory: /opt/zeronet/data/$ZERONET_MAIL_ADDRESS"
|
|
2932
|
+ if [ ! -d "$MESH_INSTALL_DIR/zeronet/data/$ZERONET_MAIL_ADDRESS" ]; then
|
|
2933
|
+ echo $"Unable to find site directory: $MESH_INSTALL_DIR/zeronet/data/$ZERONET_MAIL_ADDRESS"
|
2932
|
2934
|
exit 7638
|
2933
|
2935
|
fi
|
2934
|
2936
|
|
2935
|
2937
|
git_clone $ZERONET_MAIL_REPO ZeroMail
|
2936
|
|
- if [ ! -d /opt/zeronet/ZeroMail ]; then
|
|
2938
|
+ if [ ! -d $MESH_INSTALL_DIR/zeronet/ZeroMail ]; then
|
2937
|
2939
|
echo $'ZeroMail repo could not be cloned'
|
2938
|
2940
|
exit 6739
|
2939
|
2941
|
fi
|
2940
|
|
- cd /opt/zeronet/ZeroMail
|
|
2942
|
+ cd $MESH_INSTALL_DIR/zeronet/ZeroMail
|
2941
|
2943
|
git checkout $ZERONET_MAIL_COMMIT -b $ZERONET_MAIL_COMMIT
|
2942
|
2944
|
if ! grep -q "ZeroNet Mail commit" $COMPLETION_FILE; then
|
2943
|
2945
|
echo "ZeroNet Mail commit:$ZERONET_MAIL_COMMIT" >> $COMPLETION_FILE
|
|
@@ -2947,17 +2949,17 @@ function install_zeronet_mail {
|
2947
|
2949
|
|
2948
|
2950
|
echo $"ZeroNet Mail address: $ZERONET_MAIL_ADDRESS"
|
2949
|
2951
|
echo $"ZeroNet Mail private key: $ZERONET_MAIL_PRIVATE_KEY"
|
2950
|
|
- cp -r /opt/zeronet/ZeroMail/* /opt/zeronet/data/$ZERONET_MAIL_ADDRESS
|
|
2952
|
+ cp -r $MESH_INSTALL_DIR/zeronet/ZeroMail/* $MESH_INSTALL_DIR/zeronet/data/$ZERONET_MAIL_ADDRESS
|
2951
|
2953
|
|
2952
|
|
- if [ ! -d /opt/zeronet/data/$ZERONET_MAIL_ADDRESS/data ]; then
|
2953
|
|
- mkdir /opt/zeronet/data/$ZERONET_MAIL_ADDRESS/data
|
|
2954
|
+ if [ ! -d $MESH_INSTALL_DIR/zeronet/data/$ZERONET_MAIL_ADDRESS/data ]; then
|
|
2955
|
+ mkdir $MESH_INSTALL_DIR/zeronet/data/$ZERONET_MAIL_ADDRESS/data
|
2954
|
2956
|
fi
|
2955
|
|
- cp /opt/zeronet/data/$ZERONET_MAIL_ADDRESS/data-default/data.json /opt/zeronet/data/$ZERONET_MAIL_ADDRESS/data
|
2956
|
|
- sed -i "s/MyZeroMail/$ZERONET_DEFAULT_MAIL_TITLE/g" /opt/zeronet/data/$ZERONET_MAIL_ADDRESS/data/data.json
|
2957
|
|
- sed -i "s/My ZeroMail./$ZERONET_DEFAULT_MAIL_TAGLINE/g" /opt/zeronet/data/$ZERONET_MAIL_ADDRESS/data/data.json
|
2958
|
|
- sed -i "s/ZeroMail Demo/$ZERONET_DEFAULT_MAIL_TITLE/g" /opt/zeronet/data/$ZERONET_MAIL_ADDRESS/index.html
|
2959
|
|
- sed -i "s|<h3 class=\"description\">.*|<h3 class=\"description\">$ZERONET_DEFAULT_MAIL_TAGLINE</h3>|g" /opt/zeronet/data/$ZERONET_MAIL_ADDRESS/index.html
|
2960
|
|
- sed -i "s/Mailging platform Demo/Mailging platform/g" /opt/zeronet/data/$ZERONET_MAIL_ADDRESS/content.json
|
|
2957
|
+ cp $MESH_INSTALL_DIR/zeronet/data/$ZERONET_MAIL_ADDRESS/data-default/data.json $MESH_INSTALL_DIR/zeronet/data/$ZERONET_MAIL_ADDRESS/data
|
|
2958
|
+ sed -i "s/MyZeroMail/$ZERONET_DEFAULT_MAIL_TITLE/g" $MESH_INSTALL_DIR/zeronet/data/$ZERONET_MAIL_ADDRESS/data/data.json
|
|
2959
|
+ sed -i "s/My ZeroMail./$ZERONET_DEFAULT_MAIL_TAGLINE/g" $MESH_INSTALL_DIR/zeronet/data/$ZERONET_MAIL_ADDRESS/data/data.json
|
|
2960
|
+ sed -i "s/ZeroMail Demo/$ZERONET_DEFAULT_MAIL_TITLE/g" $MESH_INSTALL_DIR/zeronet/data/$ZERONET_MAIL_ADDRESS/index.html
|
|
2961
|
+ sed -i "s|<h3 class=\"description\">.*|<h3 class=\"description\">$ZERONET_DEFAULT_MAIL_TAGLINE</h3>|g" $MESH_INSTALL_DIR/zeronet/data/$ZERONET_MAIL_ADDRESS/index.html
|
|
2962
|
+ sed -i "s/Mailging platform Demo/Mailging platform/g" $MESH_INSTALL_DIR/zeronet/data/$ZERONET_MAIL_ADDRESS/content.json
|
2961
|
2963
|
python zeronet.py siteSign $ZERONET_MAIL_ADDRESS $ZERONET_MAIL_PRIVATE_KEY
|
2962
|
2964
|
|
2963
|
2965
|
# Add an avahi service
|
|
@@ -2994,7 +2996,7 @@ function install_zeronet_forum {
|
2994
|
2996
|
fi
|
2995
|
2997
|
|
2996
|
2998
|
# update to the next commit
|
2997
|
|
- set_repo_commit /opt/zeronet/ZeroTalk "ZeroNet Forum commit" "$ZERONET_FORUM_COMMIT" $ZERONET_FORUM_REPO
|
|
2999
|
+ set_repo_commit $MESH_INSTALL_DIR/zeronet/ZeroTalk "ZeroNet Forum commit" "$ZERONET_FORUM_COMMIT" $ZERONET_FORUM_REPO
|
2998
|
3000
|
|
2999
|
3001
|
if grep -Fxq "install_zeronet_forum" $COMPLETION_FILE; then
|
3000
|
3002
|
return
|
|
@@ -3015,9 +3017,9 @@ function install_zeronet_forum {
|
3015
|
3017
|
|
3016
|
3018
|
ZERONET_DEFAULT_FORUM_TITLE=$"${MY_USERNAME}'s Forum"
|
3017
|
3019
|
|
3018
|
|
- cd /opt/zeronet
|
3019
|
|
- python zeronet.py --batch siteCreate 2> /opt/zeronet/forum.txt
|
3020
|
|
- if [ ! -f /opt/zeronet/forum.txt ]; then
|
|
3020
|
+ cd $MESH_INSTALL_DIR/zeronet
|
|
3021
|
+ python zeronet.py --batch siteCreate 2> $MESH_INSTALL_DIR/zeronet/forum.txt
|
|
3022
|
+ if [ ! -f $MESH_INSTALL_DIR/zeronet/forum.txt ]; then
|
3021
|
3023
|
echo $'Unable to create forum'
|
3022
|
3024
|
exit 479
|
3023
|
3025
|
fi
|
|
@@ -3040,13 +3042,13 @@ function install_zeronet_forum {
|
3040
|
3042
|
exit 87356
|
3041
|
3043
|
fi
|
3042
|
3044
|
|
3043
|
|
- if [ ! -d "/opt/zeronet/data/$ZERONET_FORUM_ADDRESS" ]; then
|
3044
|
|
- echo $"Unable to find site directory: /opt/zeronet/data/$ZERONET_FORUM_ADDRESS"
|
|
3045
|
+ if [ ! -d "$MESH_INSTALL_DIR/zeronet/data/$ZERONET_FORUM_ADDRESS" ]; then
|
|
3046
|
+ echo $"Unable to find site directory: $MESH_INSTALL_DIR/zeronet/data/$ZERONET_FORUM_ADDRESS"
|
3045
|
3047
|
exit 7638
|
3046
|
3048
|
fi
|
3047
|
3049
|
|
3048
|
3050
|
git_clone $ZERONET_FORUM_REPO ZeroTalk
|
3049
|
|
- if [ ! -d /opt/zeronet/ZeroTalk ]; then
|
|
3051
|
+ if [ ! -d $MESH_INSTALL_DIR/zeronet/ZeroTalk ]; then
|
3050
|
3052
|
echo $'ZeroTalk repo could not be cloned'
|
3051
|
3053
|
exit 6739
|
3052
|
3054
|
fi
|
|
@@ -3059,12 +3061,12 @@ function install_zeronet_forum {
|
3059
|
3061
|
|
3060
|
3062
|
echo $"Forum address: $ZERONET_FORUM_ADDRESS"
|
3061
|
3063
|
echo $"Forum private key: $ZERONET_FORUM_PRIVATE_KEY"
|
3062
|
|
- cp -r /opt/zeronet/ZeroTalk/* /opt/zeronet/data/$ZERONET_FORUM_ADDRESS
|
3063
|
|
- sed -i "s/ZeroBoard/$ZERONET_DEFAULT_FORUM_TITLE/g" /opt/zeronet/data/$ZERONET_FORUM_ADDRESS/index.html
|
3064
|
|
- sed -i "s/ZeroTalk/$ZERONET_DEFAULT_FORUM_TITLE/g" /opt/zeronet/data/$ZERONET_FORUM_ADDRESS/index.html
|
3065
|
|
- sed -i "s|Demo for dynamic, decentralized content publishing.|$ZERONET_DEFAULT_FORUM_TAGLINE|g" /opt/zeronet/data/$ZERONET_FORUM_ADDRESS/index.html
|
3066
|
|
- sed -i 's/Messaging Board Demo/Messaging Board/g' /opt/zeronet/data/$ZERONET_FORUM_ADDRESS/content.json
|
3067
|
|
- sed -i "s/ZeroBoard/$ZERONET_DEFAULT_FORUM_TITLE/g" /opt/zeronet/data/$ZERONET_FORUM_ADDRESS/content.json
|
|
3064
|
+ cp -r $MESH_INSTALL_DIR/zeronet/ZeroTalk/* $MESH_INSTALL_DIR/zeronet/data/$ZERONET_FORUM_ADDRESS
|
|
3065
|
+ sed -i "s/ZeroBoard/$ZERONET_DEFAULT_FORUM_TITLE/g" $MESH_INSTALL_DIR/zeronet/data/$ZERONET_FORUM_ADDRESS/index.html
|
|
3066
|
+ sed -i "s/ZeroTalk/$ZERONET_DEFAULT_FORUM_TITLE/g" $MESH_INSTALL_DIR/zeronet/data/$ZERONET_FORUM_ADDRESS/index.html
|
|
3067
|
+ sed -i "s|Demo for dynamic, decentralized content publishing.|$ZERONET_DEFAULT_FORUM_TAGLINE|g" $MESH_INSTALL_DIR/zeronet/data/$ZERONET_FORUM_ADDRESS/index.html
|
|
3068
|
+ sed -i 's/Messaging Board Demo/Messaging Board/g' $MESH_INSTALL_DIR/zeronet/data/$ZERONET_FORUM_ADDRESS/content.json
|
|
3069
|
+ sed -i "s/ZeroBoard/$ZERONET_DEFAULT_FORUM_TITLE/g" $MESH_INSTALL_DIR/zeronet/data/$ZERONET_FORUM_ADDRESS/content.json
|
3068
|
3070
|
python zeronet.py siteSign $ZERONET_FORUM_ADDRESS $ZERONET_FORUM_PRIVATE_KEY --inner_path data/users/content.json
|
3069
|
3071
|
|
3070
|
3072
|
# Add an avahi service
|
|
@@ -3101,7 +3103,7 @@ function install_zeronet {
|
3101
|
3103
|
fi
|
3102
|
3104
|
|
3103
|
3105
|
# update to the next commit
|
3104
|
|
- set_repo_commit /opt/zeronet "ZeroNet commit" "$ZERONET_COMMIT" $ZERONET_REPO
|
|
3106
|
+ set_repo_commit $MESH_INSTALL_DIR/zeronet "ZeroNet commit" "$ZERONET_COMMIT" $ZERONET_REPO
|
3105
|
3107
|
|
3106
|
3108
|
if grep -Fxq "install_zeronet" $COMPLETION_FILE; then
|
3107
|
3109
|
return
|