Bläddra i källkod

Merge branch 'stretch' of https://github.com/bashrc/freedombone

Bob Mottram 7 år sedan
förälder
incheckning
cd6b5f1320

+ 1
- 1
doc/EN/index.org Visa fil

45
 
45
 
46
 If you find bugs, or want to add a new app to this system see the [[./devguide.html][Developers Guide]].
46
 If you find bugs, or want to add a new app to this system see the [[./devguide.html][Developers Guide]].
47
 
47
 
48
-Ready made disk images which can be copied onto USB or microSD drives are [[./downloads/v3][available here].
48
+Ready made disk images which can be copied onto USB or microSD drives are [[./downloads/current][available here]].
49
 
49
 
50
 #+BEGIN_CENTER
50
 #+BEGIN_CENTER
51
 This site can also be accessed via a Tor browser at http://pazyv7nkllp76hqr.onion. This documentation is under the [[https://www.gnu.org/licenses/fdl-1.3.txt][GNU Free Documentation License version 1.3]]
51
 This site can also be accessed via a Tor browser at http://pazyv7nkllp76hqr.onion. This documentation is under the [[https://www.gnu.org/licenses/fdl-1.3.txt][GNU Free Documentation License version 1.3]]

+ 26
- 20
doc/EN/mesh.org Visa fil

54
  - Voice chat (VoIP) and video calls
54
  - Voice chat (VoIP) and video calls
55
  - Private and public sharing of files
55
  - Private and public sharing of files
56
  - Blogging
56
  - Blogging
57
+ - Collaborative editing of documents and presentations
57
  - Creating and broadcasting audio media/podcasts
58
  - Creating and broadcasting audio media/podcasts
58
  - Social network stream. Follow/unfollow other peers
59
  - Social network stream. Follow/unfollow other peers
59
  - No network administration required
60
  - No network administration required
97
 wget https://freedombone.net/downloads/current/freedombone-meshclient-i386.img.xz.sig
98
 wget https://freedombone.net/downloads/current/freedombone-meshclient-i386.img.xz.sig
98
 gpg --verify freedombone-meshclient-i386.img.xz.sig
99
 gpg --verify freedombone-meshclient-i386.img.xz.sig
99
 sha256sum freedombone-meshclient-i386.img.xz
100
 sha256sum freedombone-meshclient-i386.img.xz
100
-995dd64538f46f6abf83ba258cca6cb82a72399cb9a099caeafc1de947ef795c
101
+61e474afae14774d7aa479b6727fd5e77bdc1854e547b3c5b630bf10542a9581
101
 unxz freedombone-meshclient-i386.img.xz
102
 unxz freedombone-meshclient-i386.img.xz
102
 sudo dd if=/dev/zero of=/dev/sdX bs=1M count=8
103
 sudo dd if=/dev/zero of=/dev/sdX bs=1M count=8
103
 sudo dd bs=1M if=freedombone-meshclient-i386.img of=/dev/sdX conv=fdatasync
104
 sudo dd bs=1M if=freedombone-meshclient-i386.img of=/dev/sdX conv=fdatasync
113
 wget https://freedombone.net/downloads/current/freedombone-meshclient-insecure-i386.img.xz.sig
114
 wget https://freedombone.net/downloads/current/freedombone-meshclient-insecure-i386.img.xz.sig
114
 gpg --verify freedombone-meshclient-insecure-i386.img.xz.sig
115
 gpg --verify freedombone-meshclient-insecure-i386.img.xz.sig
115
 sha256sum freedombone-meshclient-insecure-i386.img.xz
116
 sha256sum freedombone-meshclient-insecure-i386.img.xz
116
-b06e6ff5e56577025e6b994fe0bb28f02da7d2905ac32a2f38d7d074ffe801fc
117
+fec843303d7d280859f75f7a8edccd70512915a34d4cc0787b5de7d8fbde5c81
117
 unxz freedombone-meshclient-insecure-i386.img.xz
118
 unxz freedombone-meshclient-insecure-i386.img.xz
118
 sudo dd if=/dev/zero of=/dev/sdX bs=1M count=8
119
 sudo dd if=/dev/zero of=/dev/sdX bs=1M count=8
119
 sudo dd bs=1M if=freedombone-meshclient-insecure-i386.img of=/dev/sdX conv=fdatasync
120
 sudo dd bs=1M if=freedombone-meshclient-insecure-i386.img of=/dev/sdX conv=fdatasync
154
 wget https://freedombone.net/downloads/current/freedombone.tar.gz.sig
155
 wget https://freedombone.net/downloads/current/freedombone.tar.gz.sig
155
 gpg --verify freedombone.tar.gz.sig
156
 gpg --verify freedombone.tar.gz.sig
156
 sha256sum freedombone.tar.gz
157
 sha256sum freedombone.tar.gz
157
-fd0b3fe1527de893f4ece7ffe95fdf0c41e635a3f82d22a51b707c1aee541e88
158
+e2715e27b142a21fa257eab15778ddc96f86fda70f8d91d47c4c9aa19f22e272
158
 tar -xzvf freedombone.tar.gz
159
 tar -xzvf freedombone.tar.gz
159
 cd freedombone
160
 cd freedombone
160
 git checkout stretch
161
 git checkout stretch
241
 
242
 
242
 Where /myclient.ovpn/ comes from your VPN provider and with the password "/freedombone/".
243
 Where /myclient.ovpn/ comes from your VPN provider and with the password "/freedombone/".
243
 ** Connecting two meshes over the internet via a VPN tunnel
244
 ** Connecting two meshes over the internet via a VPN tunnel
244
-Maybe the internet exists, but you don't care about getting any content from it and just want to use it as a way to connect mesh networks from different geographical locations together. VPN configuration, pem and stunnel files exist within the home directory. Edit the configuration with:
245
+Maybe the internet exists, but you don't care about getting any content from it and just want to use it as a way to connect mesh networks from different geographical locations together.
245
 
246
 
246
-#+begin_src bash
247
-nano ~/client.ovpn
248
-#+end_src
249
-
250
-Edit the IP address or domain for the mesh that you wish to connect to within the /route/ command:
251
-
252
-#+begin_src bash
253
-route [mesh IP or domain] 255.255.255.255 net_gateway
254
-#+end_src
247
+In your home directory on a system connected via ethernet to an internet router you'll find a file called *vpn.tar.gz*. If you want another mesh to be able to connect to yours then send them this file and get them to uncompress it into their home directory also on an internet gateway machine. If they have an external IP address or domain name for your router then they will be able to VPN connect using the *Connect Meshes* icon. They should also forward port 653 from their internet router to the mesh gateway machine.
255
 
248
 
256
-Then you can connect to the other mesh with:
249
+#+BEGIN_CENTER
250
+[[file:images/mesh_connect.jpg]]
251
+#+END_CENTER
257
 
252
 
258
-#+begin_src bash
259
-cd /home/fbone
260
-sudo stunnel stunnel-client.conf
261
-sudo openvpn client.ovpn
262
-#+end_src
253
+You should create a new *vpn.tar.gz* file for every other mesh which wants to be able to connect to yours. If you are prompted for a password it is 'freedombone'.
263
 
254
 
264
-Using the password "/freedombone/". From a deep packet inspection point of view the traffic going over the internet will just look like any other TLS connection to a server.
255
+From a deep packet inspection point of view the traffic going over the internet between mesh gateways will just look like any other TLS connection to a server.
265
 
256
 
266
 ** Mobile devices (phones, etc)
257
 ** Mobile devices (phones, etc)
267
 To allow mobile devices to connect to the mesh you will need a second wifi adapter connected to your laptop/netbook/SBC. Plug in a second wifi adapter then reboot the system. The second adaptor will then create a wifi hotspot which mobile devices can connect to. The hotspot name also contains its local IP address (eg. "/mesh-192.168.1.83/").
258
 To allow mobile devices to connect to the mesh you will need a second wifi adapter connected to your laptop/netbook/SBC. Plug in a second wifi adapter then reboot the system. The second adaptor will then create a wifi hotspot which mobile devices can connect to. The hotspot name also contains its local IP address (eg. "/mesh-192.168.1.83/").
303
 
294
 
304
 At present video doesn't work reliably, but text and voice chat do work well.
295
 At present video doesn't work reliably, but text and voice chat do work well.
305
 
296
 
297
+** Collaborative document editing
298
+The mesh system includes the ability to collaboratively edit various sorts of documents using CryptPad. CryptPad is an almost peer-to-peer system in that it is designed for a client/server environment but that the server aspect of it is very minimal and limited to orchestrating the connected clients. With CryptPad installed on each mesh peer it effectively enables peer-to-peer collaborative editing. Documents are ephemeral and forgotten unless they're exported or copy-pasted to permanent storage.
299
+
300
+#+BEGIN_CENTER
301
+[[file:images/mesh_cryptpad1.jpg]]
302
+#+END_CENTER
303
+
304
+To create a document click on the CryptPad icon. Depending upon the specifications of your system it may take a few seconds to load, so don't be too disturned if the browser contents look blank for a while. Select _Rich Text Pad_ and give yourself a username.
305
+
306
+#+BEGIN_CENTER
307
+[[file:images/mesh_cryptpad2.jpg]]
308
+#+END_CENTER
309
+
310
+If you have the chat system running you can then copy and paste the URL for your pad into the chat, and the other user can then open the link and edit the document with you. You can repeat that for however many other users you wish to be able to edit.
311
+
306
 ** Social Network
312
 ** Social Network
307
 
313
 
308
 Patchwork is available as a social networking system for the mesh. Like all social network systems it has a stream of posts and you can follow or unfollow other users. You can also send private messages to other users with end-to-end encryption.
314
 Patchwork is available as a social networking system for the mesh. Like all social network systems it has a stream of posts and you can follow or unfollow other users. You can also send private messages to other users with end-to-end encryption.

Binär
img/avatars/connect.jpg Visa fil


Binär
img/icon_cryptpad.png Visa fil


Binär
img/mesh_connect.jpg Visa fil


Binär
img/mesh_cryptpad1.jpg Visa fil


Binär
img/mesh_cryptpad2.jpg Visa fil


+ 159
- 4
src/freedombone-app-cryptpad Visa fil

215
     userdel -r cryptpad
215
     userdel -r cryptpad
216
 }
216
 }
217
 
217
 
218
+function mesh_install_cryptpad {
219
+    if [[ $VARIANT != "meshclient" && $VARIANT != "meshusb" ]]; then
220
+        return
221
+    fi
222
+
223
+    if [ ! -d $rootdir/var/www/cryptpad ]; then
224
+        mkdir $rootdir/var/www/cryptpad
225
+    fi
226
+    if [ -d $rootdir$CRYPTPAD_DIR ]; then
227
+        rm -rf $rootdir$CRYPTPAD_DIR
228
+    fi
229
+
230
+    git_clone $CRYPTPAD_REPO $rootdir$CRYPTPAD_DIR
231
+
232
+    if [ ! -d $rootdir$CRYPTPAD_DIR ]; then
233
+        echo $'Unable to clone cryptpad repo'
234
+        exit 783251
235
+    fi
236
+
237
+    if [ -f $rootdir/root/$PROJECT_NAME/img/icon_cryptpad.png ]; then
238
+        cp $rootdir/root/$PROJECT_NAME/img/icon_cryptpad.png $rootdir$CRYPTPAD_DIR/icon_cryptpad.png
239
+    fi
240
+
241
+    # an unprivileged user to run as
242
+    chroot "$rootdir" useradd -d $CRYPTPAD_DIR/ cryptpad
243
+
244
+    cd $rootdir$CRYPTPAD_DIR
245
+    git checkout $CRYPTPAD_COMMIT -b $CRYPTPAD_COMMIT
246
+
247
+    chroot "$rootdir" chown -R cryptpad:cryptpad $CRYPTPAD_DIR
248
+
249
+    cryptpad_nginx_site=$rootdir/etc/nginx/sites-available/cryptpad
250
+    echo 'server {' > $cryptpad_nginx_site
251
+    echo "  listen 80 default_server;" >> $cryptpad_nginx_site
252
+    echo "  server_name P${PEER_ID}.local;" >> $cryptpad_nginx_site
253
+    echo '' >> $cryptpad_nginx_site
254
+    echo '  # Logs' >> $cryptpad_nginx_site
255
+    echo '  access_log /dev/null;' >> $cryptpad_nginx_site
256
+    echo '  error_log /dev/null;' >> $cryptpad_nginx_site
257
+    echo '' >> $cryptpad_nginx_site
258
+    echo '  # Root' >> $cryptpad_nginx_site
259
+    echo "  root $CRYPTPAD_DIR;" >> $cryptpad_nginx_site
260
+    echo '' >> $cryptpad_nginx_site
261
+    echo '  index index.html;' >> $cryptpad_nginx_site
262
+    echo '' >> $cryptpad_nginx_site
263
+    echo '  add_header X-XSS-Protection "1; mode=block";' >> $cryptpad_nginx_site
264
+    echo '  add_header X-Content-Type-Options nosniff;' >> $cryptpad_nginx_site
265
+    echo '  add_header X-Frame-Options SAMEORIGIN;' >> $cryptpad_nginx_site
266
+    echo '' >> $cryptpad_nginx_site
267
+    echo '  if ($uri = /pad/inner.html) {' >> $cryptpad_nginx_site
268
+    echo "    set \$scriptSrc \"'self' 'unsafe-eval' 'unsafe-inline'\";" >> $cryptpad_nginx_site
269
+    echo '  }' >> $cryptpad_nginx_site
270
+    echo '' >> $cryptpad_nginx_site
271
+    echo '  location = /cryptpad_websocket {' >> $cryptpad_nginx_site
272
+    echo "    proxy_pass http://localhost:$CRYPTPAD_PORT;" >> $cryptpad_nginx_site
273
+    echo '    proxy_set_header X-Real-IP $remote_addr;' >> $cryptpad_nginx_site
274
+    echo '    proxy_set_header Host $host;' >> $cryptpad_nginx_site
275
+    echo '    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;' >> $cryptpad_nginx_site
276
+    echo '' >> $cryptpad_nginx_site
277
+    echo '    # WebSocket support (nginx 1.4)' >> $cryptpad_nginx_site
278
+    echo '    proxy_http_version 1.1;' >> $cryptpad_nginx_site
279
+    echo '    proxy_set_header Upgrade $http_upgrade;' >> $cryptpad_nginx_site
280
+    echo '    proxy_set_header Connection upgrade;' >> $cryptpad_nginx_site
281
+    echo '  }' >> $cryptpad_nginx_site
282
+    echo '' >> $cryptpad_nginx_site
283
+
284
+    echo '  location ^~ /customize.dist/ {' >> $cryptpad_nginx_site
285
+    echo '    # This is needed in order to prevent infinite recursion between /customize/ and the root' >> $cryptpad_nginx_site
286
+    echo '  }' >> $cryptpad_nginx_site
287
+    echo '  location ^~ /customize/ {' >> $cryptpad_nginx_site
288
+    echo '    rewrite ^/customize/(.*)$ $1 break;' >> $cryptpad_nginx_site
289
+    echo '    try_files /customize/$uri /customize.dist/$uri;' >> $cryptpad_nginx_site
290
+    echo '  }' >> $cryptpad_nginx_site
291
+    echo '  location = /api/config {' >> $cryptpad_nginx_site
292
+    echo '    default_type text/javascript;' >> $cryptpad_nginx_site
293
+    echo '    rewrite ^.*$ /customize/api/config break;' >> $cryptpad_nginx_site
294
+    echo '  }' >> $cryptpad_nginx_site
295
+    echo '' >> $cryptpad_nginx_site
296
+    echo '  location ^~ /blob/ {' >> $cryptpad_nginx_site
297
+    echo '    try_files $uri =404;' >> $cryptpad_nginx_site
298
+    echo '  }' >> $cryptpad_nginx_site
299
+    echo '' >> $cryptpad_nginx_site
300
+    echo '  location ^~ /register/ {' >> $cryptpad_nginx_site
301
+    echo '    try_files $uri =404;' >> $cryptpad_nginx_site
302
+    echo '  }' >> $cryptpad_nginx_site
303
+    echo '' >> $cryptpad_nginx_site
304
+    echo '  location ^~ /login/ {' >> $cryptpad_nginx_site
305
+    echo '    try_files $uri =404;' >> $cryptpad_nginx_site
306
+    echo '  }' >> $cryptpad_nginx_site
307
+    echo '' >> $cryptpad_nginx_site
308
+    echo '  location ^~ /about.html {' >> $cryptpad_nginx_site
309
+    echo '    try_files $uri =404;' >> $cryptpad_nginx_site
310
+    echo '  }' >> $cryptpad_nginx_site
311
+    echo '' >> $cryptpad_nginx_site
312
+    echo '  location ^~ /contact.html {' >> $cryptpad_nginx_site
313
+    echo '    try_files $uri =404;' >> $cryptpad_nginx_site
314
+    echo '  }' >> $cryptpad_nginx_site
315
+    echo '' >> $cryptpad_nginx_site
316
+    echo '  location ^~ /what-is-cryptpad.html {' >> $cryptpad_nginx_site
317
+    echo '    try_files $uri =404;' >> $cryptpad_nginx_site
318
+    echo '  }' >> $cryptpad_nginx_site
319
+    echo '' >> $cryptpad_nginx_site
320
+    echo '  location ~ ^/(register|login|settings|user|pad|drive|poll|slide|code|whiteboard|file|media)$ {' >> $cryptpad_nginx_site
321
+    echo '    rewrite ^(.*)$ $1/ redirect;' >> $cryptpad_nginx_site
322
+    echo '  }' >> $cryptpad_nginx_site
323
+    echo '' >> $cryptpad_nginx_site
324
+    echo '  try_files /www/$uri /www/$uri/index.html /customize/$uri;' >> $cryptpad_nginx_site
325
+    echo '}' >> $cryptpad_nginx_site
326
+
327
+    cd $rootdir$CRYPTPAD_DIR
328
+
329
+    get_npm_arch
330
+
331
+    cat <<EOF > $rootdir/usr/bin/install_cryptpad
332
+#!/bin/bash
333
+cd $CRYPTPAD_DIR
334
+npm install --arch=$NPM_ARCH --build-from-source
335
+npm install --arch=$NPM_ARCH -g bower@1.8.0
336
+chown -R cryptpad:cryptpad $CRYPTPAD_DIR
337
+su -c 'bower install' - cryptpad
338
+cp config.example.js config.js
339
+EOF
340
+    chmod +x $rootdir/usr/bin/install_cryptpad
341
+    chroot "$rootdir" /usr/bin/install_cryptpad
342
+
343
+    if [ ! -f $rootdir$CRYPTPAD_DIR/config.js ]; then
344
+        echo $'Cryptpad config file not found'
345
+        exit 628252
346
+    fi
347
+
348
+    rm $rootdir/usr/bin/install_cryptpad
349
+
350
+    sed -i "s|httpPort:.*|httpPort: $CRYPTPAD_PORT,|g" $rootdir$CRYPTPAD_DIR/config.js
351
+    sed -i "s|// domain:|domain:|g" $rootdir$CRYPTPAD_DIR/config.js
352
+    sed -i 's|openFileLimit:.*|openFileLimit: 1024,|g' $rootdir$CRYPTPAD_DIR/config.js
353
+    sed -i "s|domain:.*|domain: 'http://P${PEER_ID}.local',|g" $rootdir$CRYPTPAD_DIR/config.js
354
+
355
+    chroot "$rootdir" chown -R cryptpad:cryptpad $CRYPTPAD_DIR
356
+
357
+    # daemon
358
+    echo '[Unit]' > $rootdir/etc/systemd/system/cryptpad.service
359
+    echo 'Description=Cryptpad' >> $rootdir/etc/systemd/system/cryptpad.service
360
+    echo 'After=syslog.target' >> $rootdir/etc/systemd/system/cryptpad.service
361
+    echo 'After=network.target' >> $rootdir/etc/systemd/system/cryptpad.service
362
+    echo '' >> $rootdir/etc/systemd/system/cryptpad.service
363
+    echo '[Service]' >> $rootdir/etc/systemd/system/cryptpad.service
364
+    echo 'User=cryptpad' >> $rootdir/etc/systemd/system/cryptpad.service
365
+    echo 'Group=cryptpad' >> $rootdir/etc/systemd/system/cryptpad.service
366
+    echo "WorkingDirectory=$CRYPTPAD_DIR" >> $rootdir/etc/systemd/system/cryptpad.service
367
+    echo "ExecStart=/usr/local/bin/node $CRYPTPAD_DIR/server.js" >> $rootdir/etc/systemd/system/cryptpad.service
368
+    echo 'Environment=PATH=/usr/bin:/usr/local/bin' >> $rootdir/etc/systemd/system/cryptpad.service
369
+    echo 'Environment=NODE_ENV=production' >> $rootdir/etc/systemd/system/cryptpad.service
370
+    echo 'Restart=on-failure' >> $rootdir/etc/systemd/system/cryptpad.service
371
+    echo '' >> $rootdir/etc/systemd/system/cryptpad.service
372
+    echo '[Install]' >> $rootdir/etc/systemd/system/cryptpad.service
373
+    echo 'WantedBy=multi-user.target' >> $rootdir/etc/systemd/system/cryptpad.service
374
+    chroot "$rootdir" systemctl enable cryptpad.service
375
+}
376
+
218
 function install_cryptpad_main {
377
 function install_cryptpad_main {
219
     if [[ $(app_is_installed cryptpad_main) == "1" ]]; then
378
     if [[ $(app_is_installed cryptpad_main) == "1" ]]; then
220
         return
379
         return
320
     echo '    try_files $uri =404;' >> $cryptpad_nginx_site
479
     echo '    try_files $uri =404;' >> $cryptpad_nginx_site
321
     echo '  }' >> $cryptpad_nginx_site
480
     echo '  }' >> $cryptpad_nginx_site
322
     echo '' >> $cryptpad_nginx_site
481
     echo '' >> $cryptpad_nginx_site
323
-    echo '  location ^~ /contact.html {' >> $cryptpad_nginx_site
324
-    echo '    try_files $uri =404;' >> $cryptpad_nginx_site
325
-    echo '  }' >> $cryptpad_nginx_site
326
-    echo '' >> $cryptpad_nginx_site
327
     echo '  location ^~ /what-is-cryptpad.html {' >> $cryptpad_nginx_site
482
     echo '  location ^~ /what-is-cryptpad.html {' >> $cryptpad_nginx_site
328
     echo '    try_files $uri =404;' >> $cryptpad_nginx_site
483
     echo '    try_files $uri =404;' >> $cryptpad_nginx_site
329
     echo '  }' >> $cryptpad_nginx_site
484
     echo '  }' >> $cryptpad_nginx_site

+ 17
- 3
src/freedombone-app-pihole Visa fil

135
     data=$(tempfile 2>/dev/null)
135
     data=$(tempfile 2>/dev/null)
136
     trap "rm -f $data" 0 1 2 5 15
136
     trap "rm -f $data" 0 1 2 5 15
137
     dialog --backtitle $"Ad Blocker Upstream DNS" \
137
     dialog --backtitle $"Ad Blocker Upstream DNS" \
138
-           --radiolist $"Pick a domain name service (DNS):" 25 50 16 \
138
+           --radiolist $"Pick a domain name service (DNS):" 28 50 19 \
139
            1 $"Digital Courage" on \
139
            1 $"Digital Courage" on \
140
            2 $"German Privacy Foundation 1" off \
140
            2 $"German Privacy Foundation 1" off \
141
            3 $"German Privacy Foundation 2" off \
141
            3 $"German Privacy Foundation 2" off \
151
            13 $"PowerNS" off \
151
            13 $"PowerNS" off \
152
            14 $"ValiDOM" off \
152
            14 $"ValiDOM" off \
153
            15 $"Freie Unzensierte" off \
153
            15 $"Freie Unzensierte" off \
154
-           16 $"Google" off 2> $data
154
+           16 $"DNS.Watch" off \
155
+           17 $"uncensoreddns.org" off \
156
+           18 $"Lorraine Data Network" off \
157
+           19 $"Google" off 2> $data
155
     sel=$?
158
     sel=$?
156
     case $sel in
159
     case $sel in
157
         1) exit 1;;
160
         1) exit 1;;
203
         15) PIHOLE_DNS1='85.25.149.144'
206
         15) PIHOLE_DNS1='85.25.149.144'
204
             PIHOLE_DNS2='87.106.37.196'
207
             PIHOLE_DNS2='87.106.37.196'
205
             ;;
208
             ;;
206
-        16) PIHOLE_DNS1='8.8.8.8'
209
+        16) PIHOLE_DNS1='84.200.69.80'
210
+            PIHOLE_DNS2='84.200.70.40'
211
+            ;;
212
+        17) PIHOLE_DNS1='91.239.100.100'
213
+            PIHOLE_DNS2='89.233.43.71'
214
+            ;;
215
+        18) PIHOLE_DNS1='80.67.188.188'
216
+            PIHOLE_DNS2='89.234.141.66'
217
+            ;;
218
+        19) PIHOLE_DNS1='8.8.8.8'
207
             PIHOLE_DNS2='4.4.4.4'
219
             PIHOLE_DNS2='4.4.4.4'
220
+            dialog --title $"WARNING" \
221
+                   --msgbox $"\nGoogle's main purpose for providing DNS resolvers is to spy upon people and know which sites they are visiting.\n\nThis is something to consider, and you should only really be using Google DNS as a last resort if other resolvers are unavailable." 12 60
208
             ;;
222
             ;;
209
         255) exit 1;;
223
         255) exit 1;;
210
     esac
224
     esac

+ 21
- 5
src/freedombone-app-vpn Visa fil

106
 }
106
 }
107
 
107
 
108
 function vpn_change_tls_port {
108
 function vpn_change_tls_port {
109
-    EXISTING_VPN_TLS_PORT=$VPN_TLS_PORT
109
+    if ! grep -q "VPN-TLS" $FIREWALL_CONFIG; then
110
+        EXISTING_VPN_TLS_PORT=443
111
+    else
112
+        EXISTING_VPN_TLS_PORT=$(cat $FIREWALL_CONFIG | grep "VPN-TLS" | awk -F '=' '{print $2}')
113
+    fi
110
 
114
 
111
     data=$(tempfile 2>/dev/null)
115
     data=$(tempfile 2>/dev/null)
112
     trap "rm -f $data" 0 1 2 5 15
116
     trap "rm -f $data" 0 1 2 5 15
113
     dialog --title $"VPN Configuration" \
117
     dialog --title $"VPN Configuration" \
114
            --backtitle $"Freedombone Control Panel" \
118
            --backtitle $"Freedombone Control Panel" \
115
-           --inputbox $'Change TLS port' 10 50 $VPN_TLS_PORT 2>$data
119
+           --inputbox $'Change TLS port' 10 50 $EXISTING_VPN_TLS_PORT 2>$data
116
     sel=$?
120
     sel=$?
117
     case $sel in
121
     case $sel in
118
         0)
122
         0)
123
                     VPN_TLS_PORT=$tlsport
127
                     VPN_TLS_PORT=$tlsport
124
                     write_config_param "VPN_TLS_PORT" "$VPN_TLS_PORT"
128
                     write_config_param "VPN_TLS_PORT" "$VPN_TLS_PORT"
125
                     sed -i "s|accept =.*|accept = $VPN_TLS_PORT|g" /etc/stunnel/stunnel.conf
129
                     sed -i "s|accept =.*|accept = $VPN_TLS_PORT|g" /etc/stunnel/stunnel.conf
126
-                    sed -i "s|accept =.*|accept = $VPN_TLS_PORT|g" /etc/stunnel/stunnel-client.conf
130
+                    sed -i "s|connect =.*|connect = :$VPN_TLS_PORT|g" /etc/stunnel/stunnel-client.conf
127
 
131
 
128
                     for d in /home/*/ ; do
132
                     for d in /home/*/ ; do
129
                         USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
133
                         USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
134
                     done
138
                     done
135
 
139
 
136
                     if [ $VPN_TLS_PORT -eq 443 ]; then
140
                     if [ $VPN_TLS_PORT -eq 443 ]; then
141
+                        if [[ "$PREVIOUS_VPN_TLS_PORT" != "443" ]]; then
142
+                            firewall_remove VPN-TLS ${EXISTING_VPN_TLS_PORT}
143
+                        fi
137
                         systemctl stop nginx
144
                         systemctl stop nginx
138
                         systemctl disable nginx
145
                         systemctl disable nginx
139
                     else
146
                     else
147
+                        if [[ "$PREVIOUS_VPN_TLS_PORT" != "$VPN_TLS_PORT" ]]; then
148
+                            firewall_remove VPN-TLS ${EXISTING_VPN_TLS_PORT}
149
+                            firewall_add VPN-TLS ${VPN_TLS_PORT} tcp
150
+                        fi
140
                         systemctl enable nginx
151
                         systemctl enable nginx
141
                         systemctl restart nginx
152
                         systemctl restart nginx
142
                     fi
153
                     fi
143
 
154
 
144
                     systemctl restart stunnel
155
                     systemctl restart stunnel
145
 
156
 
146
-                    dialog --title $"VPN Configuration" \
147
-                           --msgbox $"TLS port changed to $VPN_TLS_PORT" 6 60
157
+                    if [ $VPN_TLS_PORT -eq 443 ]; then
158
+                        dialog --title $"VPN Configuration" \
159
+                               --msgbox $"TLS port changed to ${VPN_TLS_PORT}. Forward this port from your internet router." 10 60
160
+                    else
161
+                        dialog --title $"VPN Configuration" \
162
+                               --msgbox $"TLS port changed to ${VPN_TLS_PORT}. Forward this port from your internet router." 10 60
163
+                    fi
148
                 fi
164
                 fi
149
             fi
165
             fi
150
             ;;
166
             ;;

+ 20
- 9
src/freedombone-controlpanel-user Visa fil

437
 function add_gpg_key {
437
 function add_gpg_key {
438
     data=$(tempfile 2>/dev/null)
438
     data=$(tempfile 2>/dev/null)
439
     trap "rm -f $data" 0 1 2 5 15
439
     trap "rm -f $data" 0 1 2 5 15
440
-    dialog --title $"Add someone's PGP/GPG key" \
440
+    dialog --title $"Enter email address, Key ID or full key below" \
441
            --backtitle $"Freedombone User Control Panel" \
441
            --backtitle $"Freedombone User Control Panel" \
442
-           --inputbox $"Enter their email address or Key ID below" 8 60 2>$data
442
+           --editbox $data 8 60 2>$data
443
     sel=$?
443
     sel=$?
444
     case $sel in
444
     case $sel in
445
         0)
445
         0)
448
 
448
 
449
                 address_is_valid=
449
                 address_is_valid=
450
 
450
 
451
-                if [[ $ADD_EMAIL_ADDRESS == *"@"* && $ADD_EMAIL_ADDRESS == *"."* ]]; then
451
+                if [[ "$ADD_EMAIL_ADDRESS" == *"@"* && "$ADD_EMAIL_ADDRESS" == *"."* ]]; then
452
+                    address_is_valid=1
453
+                fi
454
+                if [[ "$ADD_EMAIL_ADDRESS" == "0x"* ]]; then
455
+                    address_is_valid=1
456
+                fi
457
+                publicstr=$"BEGIN PGP PUBLIC KEY BLOCK"
458
+                if [[ "$ADD_EMAIL_ADDRESS" == *"$publicstr"* ]]; then
452
                     address_is_valid=1
459
                     address_is_valid=1
453
-                else
454
-                    if [[ $ADD_EMAIL_ADDRESS == "0x"* ]]; then
455
-                        address_is_valid=1
456
-                    fi
457
                 fi
460
                 fi
458
 
461
 
459
                 if [ $address_is_valid ]; then
462
                 if [ $address_is_valid ]; then
460
                     clear
463
                     clear
461
-                    gpg --search-keys "$ADD_EMAIL_ADDRESS"
462
-                    gpg_set_trust "$ADD_EMAIL_ADDRESS"
464
+                    if [[ "$ADD_EMAIL_ADDRESS" == *"$publicstr"* ]]; then
465
+                        echo "$ADD_EMAIL_ADDRESS" | gpg --import
466
+                        dialog --title $"Add someone's PGP/GPG key" \
467
+                               --backtitle $"Freedombone User Control Panel" \
468
+                               --msgbox $"GPG public key was imported" 6 50
469
+                    else
470
+                        gpg --search-keys "$ADD_EMAIL_ADDRESS"
471
+                        gpg_set_trust "$ADD_EMAIL_ADDRESS"
472
+                    fi
463
                 else
473
                 else
464
                     dialog --title $"Unrecognised email address" \
474
                     dialog --title $"Unrecognised email address" \
465
                            --backtitle $"Freedombone User Control Panel" \
475
                            --backtitle $"Freedombone User Control Panel" \
468
             fi
478
             fi
469
             ;;
479
             ;;
470
     esac
480
     esac
481
+    rm $data
471
 }
482
 }
472
 
483
 
473
 function remove_gpg_key {
484
 function remove_gpg_key {

+ 2
- 2
src/freedombone-image Visa fil

87
 NAMESERVER2='85.214.20.141'
87
 NAMESERVER2='85.214.20.141'
88
 NAMESERVER3='213.73.91.35'
88
 NAMESERVER3='213.73.91.35'
89
 NAMESERVER4='85.214.73.63'
89
 NAMESERVER4='85.214.73.63'
90
-NAMESERVER5='8.8.8.8'
91
-NAMESERVER6='4.4.4.4'
90
+NAMESERVER5='84.200.69.80'
91
+NAMESERVER6='84.200.70.40'
92
 
92
 
93
 # An optional freedombone configuration file
93
 # An optional freedombone configuration file
94
 CONFIG_FILENAME=
94
 CONFIG_FILENAME=

+ 34
- 1
src/freedombone-image-customise Visa fil

697
     install_tox
697
     install_tox
698
     install_web_server
698
     install_web_server
699
     install_pelican
699
     install_pelican
700
+    mesh_install_cryptpad
700
     if [ $ENABLE_ZERONET ]; then
701
     if [ $ENABLE_ZERONET ]; then
701
         install_zeronet
702
         install_zeronet
702
     fi
703
     fi
896
 #!/bin/bash
897
 #!/bin/bash
897
 ethernet_connected=\$(cat /sys/class/net/eth0/carrier)
898
 ethernet_connected=\$(cat /sys/class/net/eth0/carrier)
898
 users_list=\$(lstox | awk -F ' ' '{\$1=""; print \$0}' | sed -e 's/^[[:space:]]*//' | sort -d | uniq)
899
 users_list=\$(lstox | awk -F ' ' '{\$1=""; print \$0}' | sed -e 's/^[[:space:]]*//' | sort -d | uniq)
899
-if [ ! \$users_list ]; then
900
+if [ \${#users_list} -eq 0 ]; then
900
     no_of_users=0
901
     no_of_users=0
901
 else
902
 else
902
     no_of_users=\$(echo "\$users_list" | wc -l)
903
     no_of_users=\$(echo "\$users_list" | wc -l)
927
     chmod +x /home/$MY_USERNAME/Desktop/Users.desktop
928
     chmod +x /home/$MY_USERNAME/Desktop/Users.desktop
928
     chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/Desktop/Users.desktop
929
     chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/Desktop/Users.desktop
929
 
930
 
931
+    if [ ! -f /home/$MY_USERNAME/Desktop/cryptpad.desktop ]; then
932
+        echo '[Desktop Entry]' > /home/$MY_USERNAME/Desktop/cryptpad.desktop
933
+        echo 'Name=CryptPad' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
934
+        echo 'Type=Application' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
935
+        echo 'Comment=Realtime collaborative editing of documents' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
936
+        echo "Exec=$BROWSER http://\${HOSTNAME}.local" >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
937
+        echo "Icon=/etc/cryptpad/icon_cryptpad.png" >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
938
+        echo 'Terminal=false' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
939
+        echo 'Categories=Application;' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
940
+        chmod +x /home/$MY_USERNAME/Desktop/cryptpad.desktop
941
+        chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/Desktop/cryptpad.desktop
942
+    else
943
+        if ! grep -q "\${HOSTNAME}.local" /home/$MY_USERNAME/Desktop/cryptpad.desktop; then
944
+            sed -i "s|Exec=.*|Exec=$BROWSER http://\${HOSTNAME}.local|g" /home/$MY_USERNAME/Desktop/cryptpad.desktop
945
+        fi
946
+        if grep -q "Offline" /home/$MY_USERNAME/Desktop/cryptpad.desktop; then
947
+            sed -i 's|Name=.*|Name=CryptPad|g' /home/$MY_USERNAME/Desktop/cryptpad.desktop
948
+        fi
949
+    fi
950
+
930
     if [ ! -f /home/$MY_USERNAME/Desktop/social.desktop ]; then
951
     if [ ! -f /home/$MY_USERNAME/Desktop/social.desktop ]; then
931
         echo '[Desktop Entry]' > /home/$MY_USERNAME/Desktop/social.desktop
952
         echo '[Desktop Entry]' > /home/$MY_USERNAME/Desktop/social.desktop
932
         echo 'Name=Social' >> /home/$MY_USERNAME/Desktop/social.desktop
953
         echo 'Name=Social' >> /home/$MY_USERNAME/Desktop/social.desktop
961
     #    fi
982
     #    fi
962
     #fi
983
     #fi
963
 
984
 
985
+    if [ ! -f /home/$MY_USERNAME/Desktop/vpn.desktop ]; then
986
+        echo '[Desktop Entry]' > /home/$MY_USERNAME/Desktop/vpn.desktop
987
+        echo 'Type=Application' >> /home/$MY_USERNAME/Desktop/vpn.desktop
988
+        echo 'Name=Connect Meshes' >> /home/$MY_USERNAME/Desktop/vpn.desktop
989
+        echo 'Comment=Connect to another mesh network via the internet' >> /home/$MY_USERNAME/Desktop/vpn.desktop
990
+        echo 'Exec=mate-terminal -e /usr/local/bin/${PROJECT_NAME}-mesh-connect' >> /home/$MY_USERNAME/Desktop/vpn.desktop
991
+        echo 'Icon=/usr/share/${PROJECT_NAME}/avatars/connect.jpg' >> /home/$MY_USERNAME/Desktop/vpn.desktop
992
+        echo 'StartupNotify=false' >> /home/$MY_USERNAME/Desktop/vpn.desktop
993
+        chmod +x /home/$MY_USERNAME/Desktop/vpn.desktop
994
+        chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/Desktop/vpn.desktop
995
+    fi
996
+
964
     if [ -f /tmp/.ipfs-users ]; then
997
     if [ -f /tmp/.ipfs-users ]; then
965
         echo '[Desktop Entry]' > /home/$MY_USERNAME/Desktop/sites.desktop
998
         echo '[Desktop Entry]' > /home/$MY_USERNAME/Desktop/sites.desktop
966
         echo 'Type=Application' >> /home/$MY_USERNAME/Desktop/sites.desktop
999
         echo 'Type=Application' >> /home/$MY_USERNAME/Desktop/sites.desktop

+ 2
- 2
src/freedombone-image-makefile Visa fil

64
 NAMESERVER2 ?= '85.214.20.141'
64
 NAMESERVER2 ?= '85.214.20.141'
65
 NAMESERVER3 ?= '213.73.91.35'
65
 NAMESERVER3 ?= '213.73.91.35'
66
 NAMESERVER4 ?= '85.214.73.63'
66
 NAMESERVER4 ?= '85.214.73.63'
67
-NAMESERVER5 ?= '8.8.8.8'
68
-NAMESERVER6 ?= '4.4.4.4'
67
+NAMESERVER5 ?= '84.200.69.80'
68
+NAMESERVER6 ?= '84.200.70.40'
69
 
69
 
70
 # Using taskset to pin build process to single core. This is a
70
 # Using taskset to pin build process to single core. This is a
71
 # workaround for a qemu-user-static issue that causes builds to
71
 # workaround for a qemu-user-static issue that causes builds to

+ 35
- 1
src/freedombone-image-mesh Visa fil

85
 
85
 
86
 SCUTTLEBOT_PORT=8010
86
 SCUTTLEBOT_PORT=8010
87
 
87
 
88
+CRYPTPAD_PORT=9003
89
+CRYPTPAD_DIR=/etc/cryptpad
90
+
91
+function enable_cryptpad {
92
+    if [ ! -d $CRYPTPAD_DIR ]; then
93
+        return
94
+    fi
95
+
96
+    # Set up the web server
97
+    ln -s /etc/nginx/sites-available/cryptpad /etc/nginx/sites-enabled/cryptpad
98
+    rm /etc/nginx/sites-enabled/default
99
+
100
+    if [ ! -d $CRYPTPAD_DIR/customize/api ]; then
101
+        mkdir -p $CRYPTPAD_DIR/customize/api
102
+    fi
103
+    wget 127.0.0.1:$CRYPTPAD_PORT/api/config -O $CRYPTPAD_DIR/customize/api/config
104
+    if [ ! -f $CRYPTPAD_DIR/customize/api/config ]; then
105
+        echo $'Unable to wget api/config'
106
+        exit 89252
107
+    fi
108
+    chown -R cryptpad:cryptpad $CRYPTPAD_DIR
109
+}
110
+
88
 # Debian stretch has a problem where the formerly predictable wlan0 and eth0
111
 # Debian stretch has a problem where the formerly predictable wlan0 and eth0
89
 # device names get assigned random names. This is a hacky workaround.
112
 # device names get assigned random names. This is a hacky workaround.
90
 # Also adding net.ifnames=0 to kernel options on bootloader may work.
113
 # Also adding net.ifnames=0 to kernel options on bootloader may work.
761
 
784
 
762
     cp /etc/stunnel/stunnel.pem /home/$MY_USERNAME/stunnel.pem
785
     cp /etc/stunnel/stunnel.pem /home/$MY_USERNAME/stunnel.pem
763
     cp /etc/stunnel/stunnel.p12 /home/$MY_USERNAME/stunnel.p12
786
     cp /etc/stunnel/stunnel.p12 /home/$MY_USERNAME/stunnel.p12
764
-    chown $MY_USERNAME:$MY_USERNAME $prefix$userhome/stunnel*
787
+    chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/stunnel*
765
     echo "stunnel keys created" >> /var/log/${PROJECT_NAME}.log
788
     echo "stunnel keys created" >> /var/log/${PROJECT_NAME}.log
766
 }
789
 }
767
 
790
 
774
     generate_stunnel_keys
797
     generate_stunnel_keys
775
 
798
 
776
     sed -i 's|tun-mtu .*|tun-mtu 1532|g' /home/$MY_USERNAME/client.ovpn
799
     sed -i 's|tun-mtu .*|tun-mtu 1532|g' /home/$MY_USERNAME/client.ovpn
800
+    chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/client.ovpn
801
+    chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/stunnel*
802
+
803
+    # create an archive of the vpn client files
804
+    cd /home/$MY_USERNAME
805
+    tar -czvf vpn.tar.gz stunnel* client.ovpn
806
+    chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/vpn.tar.gz
777
 
807
 
778
     systemctl restart openvpn
808
     systemctl restart openvpn
779
 }
809
 }
873
     #create_ram_disk 1
903
     #create_ram_disk 1
874
     #setup_amnesic_data
904
     #setup_amnesic_data
875
     change_avahi_name
905
     change_avahi_name
906
+    if [ -d $CRYPTPAD_DIR ]; then
907
+        systemctl start cryptpad
908
+    fi
876
     configure_toxcore
909
     configure_toxcore
877
     create_tox_user
910
     create_tox_user
878
     #setup_tahoelafs
911
     #setup_tahoelafs
879
     mesh_setup_vpn
912
     mesh_setup_vpn
880
     initialise_scuttlebot_pub
913
     initialise_scuttlebot_pub
881
     setup_ipfs
914
     setup_ipfs
915
+    enable_cryptpad
882
     mesh_amnesic
916
     mesh_amnesic
883
     make_root_read_only
917
     make_root_read_only
884
 
918
 

+ 229
- 0
src/freedombone-mesh-connect Visa fil

1
+#!/bin/bash
2
+#
3
+# .---.                  .              .
4
+# |                      |              |
5
+# |--- .--. .-.  .-.  .-.|  .-. .--.--. |.-.  .-. .--.  .-.
6
+# |    |   (.-' (.-' (   | (   )|  |  | |   )(   )|  | (.-'
7
+# '    '     --'  --'  -' -  -' '  '   -' -'   -' '   -  --'
8
+#
9
+#                    Freedom in the Cloud
10
+#
11
+# Blogging functions for mesh clients
12
+#
13
+# License
14
+# =======
15
+#
16
+# This program is free software: you can redistribute it and/or modify
17
+# it under the terms of the GNU Affero General Public License as published by
18
+# the Free Software Foundation, either version 3 of the License, or
19
+# (at your option) any later version.
20
+#
21
+# This program is distributed in the hope that it will be useful,
22
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
23
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24
+# GNU Affero General Public License for more details.
25
+#
26
+# You should have received a copy of the GNU Affero General Public License
27
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
28
+
29
+PROJECT_NAME='freedombone'
30
+
31
+export TEXTDOMAIN=${PROJECT_NAME}-mesh-blog
32
+export TEXTDOMAINDIR="/usr/share/locale"
33
+
34
+MY_USERNAME='fbone'
35
+
36
+OPENVPN_SERVER_NAME="server"
37
+OPENVPN_KEY_FILENAME='client.ovpn'
38
+VPN_COUNTRY_CODE="US"
39
+VPN_AREA="Apparent Free Speech Zone"
40
+VPN_LOCATION="Freedomville"
41
+VPN_ORGANISATION="Freedombone"
42
+VPN_UNIT="Freedombone Unit"
43
+STUNNEL_PORT=3439
44
+VPN_MESH_TLS_PORT=653
45
+
46
+function vpn_generate_keys {
47
+    # generate host keys
48
+    if [ ! -f /etc/openvpn/dh2048.pem ]; then
49
+        ${PROJECT_NAME}-dhparam -o /etc/openvpn/dh2048.pem
50
+    fi
51
+    if [ ! -f /etc/openvpn/dh2048.pem ]; then
52
+        echo $'vpn dhparams were not generated' >> /var/log/${PROJECT_NAME}.log
53
+        exit 73724523
54
+    fi
55
+    cp /etc/openvpn/dh2048.pem /etc/openvpn/easy-rsa/keys/dh2048.pem
56
+
57
+    cd /etc/openvpn/easy-rsa
58
+    . ./vars
59
+    ./clean-all
60
+    vpn_openssl_version='1.0.0'
61
+    if [ ! -f openssl-${vpn_openssl_version}.cnf ]; then
62
+        echo $"openssl-${vpn_openssl_version}.cnf was not found" >> /var/log/${PROJECT_NAME}.log
63
+        exit 7392353
64
+    fi
65
+    cp openssl-${vpn_openssl_version}.cnf openssl.cnf
66
+
67
+    if [ -f /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.crt ]; then
68
+        rm /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.crt
69
+    fi
70
+    if [ -f /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.key ]; then
71
+        rm /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.key
72
+    fi
73
+    if [ -f /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.csr ]; then
74
+        rm /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.csr
75
+    fi
76
+    sed -i 's| --interact||g' build-key-server
77
+    sed -i 's| --interact||g' build-ca
78
+    ./build-ca
79
+    ./build-key-server ${OPENVPN_SERVER_NAME}
80
+    if [ ! -f /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.crt ]; then
81
+        echo $'OpenVPN crt not found' >> /var/log/${PROJECT_NAME}.log
82
+        exit 7823352
83
+    fi
84
+    server_cert=$(cat /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.crt)
85
+    if [ ${#server_cert} -lt 10 ]; then
86
+        cat /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.crt
87
+        echo $'Server cert generation failed' >> /var/log/${PROJECT_NAME}.log
88
+        exit 3284682
89
+    fi
90
+
91
+    if [ ! -f /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.key ]; then
92
+        echo $'OpenVPN key not found' >> /var/log/${PROJECT_NAME}.log
93
+        exit 6839436
94
+    fi
95
+    if [ ! -f /etc/openvpn/easy-rsa/keys/ca.key ]; then
96
+        echo $'OpenVPN ca not found' >> /var/log/${PROJECT_NAME}.log
97
+        exit 7935203
98
+    fi
99
+    cp /etc/openvpn/easy-rsa/keys/{$OPENVPN_SERVER_NAME.crt,$OPENVPN_SERVER_NAME.key,ca.crt} /etc/openvpn
100
+
101
+    create_user_vpn_key ${MY_USERNAME}
102
+}
103
+
104
+function generate_stunnel_keys {
105
+    echo "Creating stunnel keys" >> /var/log/${PROJECT_NAME}.log
106
+    openssl req -x509 -nodes -days 3650 -sha256 \
107
+            -subj "/O=$VPN_ORGANISATION/OU=$VPN_UNIT/C=$VPN_COUNTRY_CODE/ST=$VPN_AREA/L=$VPN_LOCATION/CN=$HOSTNAME" \
108
+            -newkey rsa:2048 -keyout /etc/stunnel/key.pem \
109
+            -out /etc/stunnel/cert.pem
110
+    if [ ! -f /etc/stunnel/key.pem ]; then
111
+        echo $'stunnel key not created' >> /var/log/${PROJECT_NAME}.log
112
+        exit 793530
113
+    fi
114
+    if [ ! -f /etc/stunnel/cert.pem ]; then
115
+        echo $'stunnel cert not created' >> /var/log/${PROJECT_NAME}.log
116
+        exit 204587
117
+    fi
118
+    chmod 400 /etc/stunnel/key.pem
119
+    chmod 640 /etc/stunnel/cert.pem
120
+
121
+    cat /etc/stunnel/key.pem /etc/stunnel/cert.pem >> /etc/stunnel/stunnel.pem
122
+    chmod 640 /etc/stunnel/stunnel.pem
123
+
124
+    openssl pkcs12 -export -out /etc/stunnel/stunnel.p12 -inkey /etc/stunnel/key.pem -in /etc/stunnel/cert.pem -passout pass:
125
+    if [ ! -f /etc/stunnel/stunnel.p12 ]; then
126
+        echo $'stunnel pkcs12 not created' >> /var/log/${PROJECT_NAME}.log
127
+        exit 639353
128
+    fi
129
+    chmod 640 /etc/stunnel/stunnel.p12
130
+
131
+    cp /etc/stunnel/stunnel.pem /home/$MY_USERNAME/stunnel.pem
132
+    cp /etc/stunnel/stunnel.p12 /home/$MY_USERNAME/stunnel.p12
133
+    chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/stunnel*
134
+    echo "stunnel keys created" >> /var/log/${PROJECT_NAME}.log
135
+}
136
+
137
+function mesh_setup_vpn {
138
+    vpn_generate_keys
139
+
140
+    cp /etc/stunnel/stunnel-client.conf /home/$MY_USERNAME/stunnel-client.conf
141
+    chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/stunnel*
142
+
143
+    generate_stunnel_keys
144
+
145
+    sed -i 's|tun-mtu .*|tun-mtu 1532|g' /home/$MY_USERNAME/client.ovpn
146
+    chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/client.ovpn
147
+    chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/stunnel*
148
+
149
+    # create an archive of the vpn client files
150
+    cd /home/$MY_USERNAME
151
+    tar -czvf vpn.tar.gz stunnel* client.ovpn
152
+    chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/vpn.tar.gz
153
+
154
+    if [ -f vpn.tar.gz ]; then
155
+        dialog --title $"Generate VPN client keys" \
156
+               --msgbox $"\nNew VPN client keys have been generated in the /home/fbone directory.\n\nYou can find it by selecting \"Places\" then \"Home Directory\" on the top menu bar. Transmit the vpn.tar.gz file to whoever is running the other mesh network so that they can connect to yours.\n\nThey should uncompress vpn.tar.gz to their /home/fbone directory, forward port $VPN_MESH_TLS_PORT then connect using your IP address or domain name." 15 70
157
+    fi
158
+}
159
+
160
+function connect_to_vpn {
161
+    dialog --title $"VPN Connect to another mesh network" \
162
+           --backtitle $"Freedombone Mesh" \
163
+           --defaultno \
164
+           --yesno $"\nHave you received the vpn.tar.gz file from the other mesh administrator, uncompressed it into the /home/fbone directory and also forwarded port $VPN_MESH_TLS_PORT from your internet router to this system?" 10 70
165
+    sel=$?
166
+    case $sel in
167
+        1) return;;
168
+        255) return;;
169
+    esac
170
+
171
+    data=$(tempfile 2>/dev/null)
172
+    trap "rm -f $data" 0 1 2 5 15
173
+    dialog --title $"VPN Connect to another mesh network" \
174
+           --backtitle $"Freedombone Mesh" \
175
+           --inputbox $'Enter the IP address or domain name of the other mesh.' 10 60 2>$data
176
+    sel=$?
177
+    case $sel in
178
+        0)
179
+            ip_or_domain=$(<$data)
180
+            if [ ${#ip_or_domain} -gt 1 ]; then
181
+                if [[ "$ip_or_domain" == *'.'* ]]; then
182
+
183
+                    if [ ! -f ~/client.ovpn ]; then
184
+                        rm $data
185
+                        exit 1
186
+                    fi
187
+                    if [ ! -f ~/stunnel.pem ]; then
188
+                        rm $data
189
+                        exit 1
190
+                    fi
191
+                    if [ ! -f ~/stunnel.p12 ]; then
192
+                        rm $data
193
+                        exit 1
194
+                    fi
195
+
196
+                    sed -i "s|route .*|route $ip_or_domain 255.255.255.255 net_gateway|g" ~/client.ovpn
197
+
198
+                    clear
199
+                    cd ~/
200
+                    sudo stunnel stunnel-client.conf
201
+                    sudo openvpn client.ovpn
202
+                fi
203
+            fi
204
+            ;;
205
+    esac
206
+
207
+    rm $data
208
+}
209
+
210
+data=$(tempfile 2>/dev/null)
211
+trap "rm -f $data" 0 1 2 5 15
212
+dialog --backtitle $"Freedombone Mesh" \
213
+       --title $"Connect to another mesh network" \
214
+       --radiolist $"Choose an operation:" 10 75 2 \
215
+       1 $"Connect to another mesh network" on \
216
+       2 $"Generate VPN keys for another mesh network to connect to me" off 2> $data
217
+sel=$?
218
+case $sel in
219
+    1) exit 1;;
220
+    255) exit 1;;
221
+esac
222
+case $(cat $data) in
223
+    1) rm $data
224
+       connect_to_vpn;;
225
+    2) rm $data
226
+       mesh_setup_vpn;;
227
+esac
228
+
229
+exit 0

+ 2
- 2
src/freedombone-utils-dns Visa fil

33
 NAMESERVER2='85.214.20.141'
33
 NAMESERVER2='85.214.20.141'
34
 NAMESERVER3='213.73.91.35'
34
 NAMESERVER3='213.73.91.35'
35
 NAMESERVER4='85.214.73.63'
35
 NAMESERVER4='85.214.73.63'
36
-NAMESERVER5='8.8.8.8'
37
-NAMESERVER6='4.4.4.4'
36
+NAMESERVER5='84.200.69.80'
37
+NAMESERVER6='84.200.70.40'
38
 
38
 
39
 # parameters used when adding a new domain
39
 # parameters used when adding a new domain
40
 DDNS_PROVIDER="default@freedns.afraid.org"
40
 DDNS_PROVIDER="default@freedns.afraid.org"

+ 2
- 0
src/freedombone-utils-guile Visa fil

50
     export GUILE_CFLAGS="-I${GUILE_BASE_PATH}/include"
50
     export GUILE_CFLAGS="-I${GUILE_BASE_PATH}/include"
51
     export GUILE_LIBS="-L${GUILE_BASE_PATH}/lib -lguile -lqthreads -ldl -ltermcap -lsocket -lnsl -lm"
51
     export GUILE_LIBS="-L${GUILE_BASE_PATH}/lib -lguile -lqthreads -ldl -ltermcap -lsocket -lnsl -lm"
52
     ./bootstrap.sh
52
     ./bootstrap.sh
53
+    sed -i 's|PKG_CHECK_MODULES|##PKG_CHECK_MODULES|g' configure
53
     configure
54
     configure
54
     make
55
     make
55
     make install
56
     make install
57
+    export GUILE_LOAD_COMPILED_PATH="$INSTALL_DIR/8sync"
56
 }
58
 }
57
 
59
 
58
 function install_guile {
60
 function install_guile {

+ 2
- 2
website/EN/index.html Visa fil

3
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
4
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
5
 <head>
5
 <head>
6
-<!-- 2017-10-05 Thu 13:21 -->
6
+<!-- 2017-10-15 Sun 11:26 -->
7
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
7
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
8
 <meta name="viewport" content="width=device-width, initial-scale=1" />
8
 <meta name="viewport" content="width=device-width, initial-scale=1" />
9
 <title>&lrm;</title>
9
 <title>&lrm;</title>
300
 </p>
300
 </p>
301
 
301
 
302
 <p>
302
 <p>
303
-Ready made disk images which can be copied onto USB or microSD drives are [[./downloads/v3][available here].
303
+Ready made disk images which can be copied onto USB or microSD drives are <a href="./downloads/current">available here</a>.
304
 </p>
304
 </p>
305
 
305
 
306
 <div class="org-center">
306
 <div class="org-center">

+ 106
- 81
website/EN/mesh.html Visa fil

3
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
4
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
5
 <head>
5
 <head>
6
-<!-- 2017-10-07 Sat 10:19 -->
6
+<!-- 2017-10-25 Wed 20:24 -->
7
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
7
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
8
 <meta name="viewport" content="width=device-width, initial-scale=1" />
8
 <meta name="viewport" content="width=device-width, initial-scale=1" />
9
 <title>&lrm;</title>
9
 <title>&lrm;</title>
274
 </colgroup>
274
 </colgroup>
275
 <tbody>
275
 <tbody>
276
 <tr>
276
 <tr>
277
-<td class="org-left"><a href="#org459477a">What the system can do</a></td>
277
+<td class="org-left"><a href="#orga5044ee">What the system can do</a></td>
278
 <td class="org-left">-</td>
278
 <td class="org-left">-</td>
279
-<td class="org-left"><a href="#org0164602">Disk Images</a></td>
279
+<td class="org-left"><a href="#orge35044f">Disk Images</a></td>
280
 <td class="org-left">-</td>
280
 <td class="org-left">-</td>
281
-<td class="org-left"><a href="#orgac711fb">Building Disk Images</a></td>
281
+<td class="org-left"><a href="#org042ab96">Building Disk Images</a></td>
282
 <td class="org-left">-</td>
282
 <td class="org-left">-</td>
283
-<td class="org-left"><a href="#orgb7403cc">How to use it</a></td>
283
+<td class="org-left"><a href="#org90e6351">How to use it</a></td>
284
 </tr>
284
 </tr>
285
 </tbody>
285
 </tbody>
286
 </table>
286
 </table>
324
 <li><b>Evolvable</b>: The network should be built with future development in mind. The platform should be flexible enough to support technologies, protocols and modes of usage that have not yet been developed.</li>
324
 <li><b>Evolvable</b>: The network should be built with future development in mind. The platform should be flexible enough to support technologies, protocols and modes of usage that have not yet been developed.</li>
325
 </ul>
325
 </ul>
326
 
326
 
327
-<div id="outline-container-org459477a" class="outline-2">
328
-<h2 id="org459477a">What the system can do</h2>
329
-<div class="outline-text-2" id="text-org459477a">
327
+<div id="outline-container-orga5044ee" class="outline-2">
328
+<h2 id="orga5044ee">What the system can do</h2>
329
+<div class="outline-text-2" id="text-orga5044ee">
330
 <ul class="org-ul">
330
 <ul class="org-ul">
331
 <li>Discovery of other users on the network</li>
331
 <li>Discovery of other users on the network</li>
332
 <li>Text based chat, one-to-one and in groups</li>
332
 <li>Text based chat, one-to-one and in groups</li>
333
 <li>Voice chat (VoIP) and video calls</li>
333
 <li>Voice chat (VoIP) and video calls</li>
334
 <li>Private and public sharing of files</li>
334
 <li>Private and public sharing of files</li>
335
 <li>Blogging</li>
335
 <li>Blogging</li>
336
+<li>Collaborative editing of documents and presentations</li>
336
 <li>Creating and broadcasting audio media/podcasts</li>
337
 <li>Creating and broadcasting audio media/podcasts</li>
337
 <li>Social network stream. Follow/unfollow other peers</li>
338
 <li>Social network stream. Follow/unfollow other peers</li>
338
 <li>No network administration required</li>
339
 <li>No network administration required</li>
350
 </div>
351
 </div>
351
 </div>
352
 </div>
352
 
353
 
353
-<div id="outline-container-org0164602" class="outline-2">
354
-<h2 id="org0164602">Disk Images</h2>
355
-<div class="outline-text-2" id="text-org0164602">
354
+<div id="outline-container-orge35044f" class="outline-2">
355
+<h2 id="orge35044f">Disk Images</h2>
356
+<div class="outline-text-2" id="text-orge35044f">
356
 </div>
357
 </div>
357
-<div id="outline-container-orge7a4bb5" class="outline-3">
358
-<h3 id="orge7a4bb5">Writing many images quickly</h3>
359
-<div class="outline-text-3" id="text-orge7a4bb5">
358
+<div id="outline-container-org1e0493b" class="outline-3">
359
+<h3 id="org1e0493b">Writing many images quickly</h3>
360
+<div class="outline-text-3" id="text-org1e0493b">
360
 <p>
361
 <p>
361
 There may be situations where you need to write the same disk image to multiple drives at the same time in order to maximize rate of deployment. In the instructions given below the <b>dd</b> command is used for writing to the target drive, but to write to multiple drives you can use a tool such as <a href="https://wiki.gnome.org/Apps/MultiWriter">GNOME MultiWriter</a>.
362
 There may be situations where you need to write the same disk image to multiple drives at the same time in order to maximize rate of deployment. In the instructions given below the <b>dd</b> command is used for writing to the target drive, but to write to multiple drives you can use a tool such as <a href="https://wiki.gnome.org/Apps/MultiWriter">GNOME MultiWriter</a>.
362
 </p>
363
 </p>
384
 </p>
385
 </p>
385
 </div>
386
 </div>
386
 </div>
387
 </div>
387
-<div id="outline-container-org937e4d8" class="outline-3">
388
-<h3 id="org937e4d8">Client images</h3>
389
-<div class="outline-text-3" id="text-org937e4d8">
388
+<div id="outline-container-orgb14f6b2" class="outline-3">
389
+<h3 id="orgb14f6b2">Client images</h3>
390
+<div class="outline-text-3" id="text-orgb14f6b2">
390
 <div class="org-center">
391
 <div class="org-center">
391
 
392
 
392
 <div class="figure">
393
 <div class="figure">
435
 </div>
436
 </div>
436
 </div>
437
 </div>
437
 
438
 
438
-<div id="outline-container-org4b4e016" class="outline-3">
439
-<h3 id="org4b4e016">Router images</h3>
440
-<div class="outline-text-3" id="text-org4b4e016">
439
+<div id="outline-container-orgab76248" class="outline-3">
440
+<h3 id="orgab76248">Router images</h3>
441
+<div class="outline-text-3" id="text-orgab76248">
441
 <p>
442
 <p>
442
 Routers are intended to build network coverage for an area using small and low cost hardware. You can bolt them to walls or leave them on window ledges. They don't have any user interface and their only job is to haul network traffic across the mesh and to enable peers to find each other via running bootstrap nodes for Tox and IPFS. Copy the image to a microSD card and insert it into the router, plug in an Atheros wifi dongle and power on. That should be all you need to do.
443
 Routers are intended to build network coverage for an area using small and low cost hardware. You can bolt them to walls or leave them on window ledges. They don't have any user interface and their only job is to haul network traffic across the mesh and to enable peers to find each other via running bootstrap nodes for Tox and IPFS. Copy the image to a microSD card and insert it into the router, plug in an Atheros wifi dongle and power on. That should be all you need to do.
443
 </p>
444
 </p>
444
 </div>
445
 </div>
445
-<div id="outline-container-org139719d" class="outline-4">
446
-<h4 id="org139719d">Beaglebone Black</h4>
447
-<div class="outline-text-4" id="text-org139719d">
446
+<div id="outline-container-org0b3b781" class="outline-4">
447
+<h4 id="org0b3b781">Beaglebone Black</h4>
448
+<div class="outline-text-4" id="text-org0b3b781">
448
 <div class="org-center">
449
 <div class="org-center">
449
 
450
 
450
 <div class="figure">
451
 <div class="figure">
481
 </div>
482
 </div>
482
 </div>
483
 </div>
483
 
484
 
484
-<div id="outline-container-orgac711fb" class="outline-2">
485
-<h2 id="orgac711fb">Building Disk Images</h2>
486
-<div class="outline-text-2" id="text-orgac711fb">
485
+<div id="outline-container-org042ab96" class="outline-2">
486
+<h2 id="org042ab96">Building Disk Images</h2>
487
+<div class="outline-text-2" id="text-org042ab96">
487
 <p>
488
 <p>
488
 It's better not to trust images downloaded from random places on the interwebs. Chances are that unless you are in the web of trust of the above GPG signatures then they don't mean very much to you. If you actually want something trustworthy then build the images from scratch. It will take some time. Here's how to do it.
489
 It's better not to trust images downloaded from random places on the interwebs. Chances are that unless you are in the web of trust of the above GPG signatures then they don't mean very much to you. If you actually want something trustworthy then build the images from scratch. It will take some time. Here's how to do it.
489
 </p>
490
 </p>
571
 </div>
572
 </div>
572
 </div>
573
 </div>
573
 
574
 
574
-<div id="outline-container-org9625de2" class="outline-2">
575
-<h2 id="org9625de2">Customisation</h2>
576
-<div class="outline-text-2" id="text-org9625de2">
575
+<div id="outline-container-org320b796" class="outline-2">
576
+<h2 id="org320b796">Customisation</h2>
577
+<div class="outline-text-2" id="text-org320b796">
577
 <p>
578
 <p>
578
 If you want to make your own specially branded version, such as for a particular event, then to change the default desktop backgrounds edit the images within <b>img/backgrounds</b> and to change the available avatars and desktop icons edit the images within <b>img/avatars</b>. Re-create disk images using the instructions shown previously.
579
 If you want to make your own specially branded version, such as for a particular event, then to change the default desktop backgrounds edit the images within <b>img/backgrounds</b> and to change the available avatars and desktop icons edit the images within <b>img/avatars</b>. Re-create disk images using the instructions shown previously.
579
 </p>
580
 </p>
583
 </p>
584
 </p>
584
 </div>
585
 </div>
585
 </div>
586
 </div>
586
-<div id="outline-container-orgb7403cc" class="outline-2">
587
-<h2 id="orgb7403cc">How to use it</h2>
588
-<div class="outline-text-2" id="text-orgb7403cc">
587
+<div id="outline-container-org90e6351" class="outline-2">
588
+<h2 id="org90e6351">How to use it</h2>
589
+<div class="outline-text-2" id="text-org90e6351">
589
 <p>
590
 <p>
590
 When you first boot from the USB drive the system will create some encryption keys, assign a unique network address to the system and then reboot itself. When that's done you should see a prompt asking for a username. This username just makes it easy for others to initially find you on the mesh and will appear in the list of users.
591
 When you first boot from the USB drive the system will create some encryption keys, assign a unique network address to the system and then reboot itself. When that's done you should see a prompt asking for a username. This username just makes it easy for others to initially find you on the mesh and will appear in the list of users.
591
 </p>
592
 </p>
595
 </p>
596
 </p>
596
 </div>
597
 </div>
597
 
598
 
598
-<div id="outline-container-org70dd907" class="outline-3">
599
-<h3 id="org70dd907">Boot trouble</h3>
600
-<div class="outline-text-3" id="text-org70dd907">
599
+<div id="outline-container-orgaf18aab" class="outline-3">
600
+<h3 id="orgaf18aab">Boot trouble</h3>
601
+<div class="outline-text-3" id="text-orgaf18aab">
601
 <p>
602
 <p>
602
 If the system doesn't boot and reports an error which includes <b>/dev/mapper/loop0p1</b> then reboot with <b>Ctrl-Alt-Del</b> and when you see the grub menu press <b>e</b> and manually change <b>/dev/mapper/loop0p1</b> to <b>/dev/sdb1</b>, then press <b>Ctrl-x</b>. If that doesn't work then reboot and try <b>/dev/sdc1</b> instead.
603
 If the system doesn't boot and reports an error which includes <b>/dev/mapper/loop0p1</b> then reboot with <b>Ctrl-Alt-Del</b> and when you see the grub menu press <b>e</b> and manually change <b>/dev/mapper/loop0p1</b> to <b>/dev/sdb1</b>, then press <b>Ctrl-x</b>. If that doesn't work then reboot and try <b>/dev/sdc1</b> instead.
603
 </p>
604
 </p>
607
 </p>
608
 </p>
608
 </div>
609
 </div>
609
 </div>
610
 </div>
610
-<div id="outline-container-orge861d36" class="outline-3">
611
-<h3 id="orge861d36">Set the Date</h3>
612
-<div class="outline-text-3" id="text-orge861d36">
611
+<div id="outline-container-org17b251b" class="outline-3">
612
+<h3 id="org17b251b">Set the Date</h3>
613
+<div class="outline-text-3" id="text-org17b251b">
613
 <p>
614
 <p>
614
 On the ordinary internet the date and time of your system would be set automatically via NTP. But this is not the internet and so you will need to manually ensure that your date and time settings are correct. You might need to periodically do this if your clock drifts. It's not essential that the time on your system be highly accurate, but if it drifts too far or goes back to epoch then things could become a little confusing in regard to the order of blog posts.
615
 On the ordinary internet the date and time of your system would be set automatically via NTP. But this is not the internet and so you will need to manually ensure that your date and time settings are correct. You might need to periodically do this if your clock drifts. It's not essential that the time on your system be highly accurate, but if it drifts too far or goes back to epoch then things could become a little confusing in regard to the order of blog posts.
615
 </p>
616
 </p>
619
 </p>
620
 </p>
620
 </div>
621
 </div>
621
 </div>
622
 </div>
622
-<div id="outline-container-org15c35d8" class="outline-3">
623
-<h3 id="org15c35d8">Check network status</h3>
624
-<div class="outline-text-3" id="text-org15c35d8">
623
+<div id="outline-container-org271731e" class="outline-3">
624
+<h3 id="org271731e">Check network status</h3>
625
+<div class="outline-text-3" id="text-org271731e">
625
 <p>
626
 <p>
626
 Unlike with ordinary wifi, on the mesh you don't get a signal strength icon and so it's not simple to see if you have a good connection.
627
 Unlike with ordinary wifi, on the mesh you don't get a signal strength icon and so it's not simple to see if you have a good connection.
627
 </p>
628
 </p>
644
 </p>
645
 </p>
645
 </div>
646
 </div>
646
 </div>
647
 </div>
647
-<div id="outline-container-org1a60165" class="outline-3">
648
-<h3 id="org1a60165">Connecting to the internet</h3>
649
-<div class="outline-text-3" id="text-org1a60165">
648
+<div id="outline-container-org91c530e" class="outline-3">
649
+<h3 id="org91c530e">Connecting to the internet</h3>
650
+<div class="outline-text-3" id="text-org91c530e">
650
 <p>
651
 <p>
651
 If you need to be able to access the internet from the mesh then connect one of the peers to an internet router using an ethernet cable, then reboot it. Other peers in the mesh, including any attached mobile devices, will then be able to access the internet using the ethernet attached peer as a gateway. <a href="https://en.wikipedia.org/wiki/Freifunk">Freifunk</a> works in a similar way.
652
 If you need to be able to access the internet from the mesh then connect one of the peers to an internet router using an ethernet cable, then reboot it. Other peers in the mesh, including any attached mobile devices, will then be able to access the internet using the ethernet attached peer as a gateway. <a href="https://en.wikipedia.org/wiki/Freifunk">Freifunk</a> works in a similar way.
652
 </p>
653
 </p>
669
 </p>
670
 </p>
670
 </div>
671
 </div>
671
 </div>
672
 </div>
672
-<div id="outline-container-orgc23a852" class="outline-3">
673
-<h3 id="orgc23a852">Connecting two meshes over the internet via a VPN tunnel</h3>
674
-<div class="outline-text-3" id="text-orgc23a852">
673
+<div id="outline-container-orgad68675" class="outline-3">
674
+<h3 id="orgad68675">Connecting two meshes over the internet via a VPN tunnel</h3>
675
+<div class="outline-text-3" id="text-orgad68675">
675
 <p>
676
 <p>
676
-Maybe the internet exists, but you don't care about getting any content from it and just want to use it as a way to connect mesh networks from different geographical locations together. VPN configuration, pem and stunnel files exist within the home directory. Edit the configuration with:
677
+Maybe the internet exists, but you don't care about getting any content from it and just want to use it as a way to connect mesh networks from different geographical locations together.
677
 </p>
678
 </p>
678
 
679
 
679
-<div class="org-src-container">
680
-<pre class="src src-bash">nano ~/client.ovpn
681
-</pre>
682
-</div>
683
-
684
 <p>
680
 <p>
685
-Edit the IP address or domain for the mesh that you wish to connect to within the <i>route</i> command:
681
+In your home directory on a system connected via ethernet to an internet router you'll find a file called <b>vpn.tar.gz</b>. If you want another mesh to be able to connect to yours then send them this file and get them to uncompress it into their home directory also on an internet gateway machine. If they have an external IP address or domain name for your router then they will be able to VPN connect using the <b>Connect Meshes</b> icon. They should also forward port 653 from their internet router to the mesh gateway machine.
686
 </p>
682
 </p>
687
 
683
 
688
-<div class="org-src-container">
689
-<pre class="src src-bash">route [mesh IP or domain] 255.255.255.255 net_gateway
690
-</pre>
684
+<div class="org-center">
685
+
686
+<div class="figure">
687
+<p><img src="images/mesh_connect.jpg" alt="mesh_connect.jpg" />
688
+</p>
689
+</div>
691
 </div>
690
 </div>
692
 
691
 
693
 <p>
692
 <p>
694
-Then you can connect to the other mesh with:
693
+You should create a new <b>vpn.tar.gz</b> file for every other mesh which wants to be able to connect to yours. If you are prompted for a password it is 'freedombone'.
695
 </p>
694
 </p>
696
 
695
 
697
-<div class="org-src-container">
698
-<pre class="src src-bash"><span class="org-builtin">cd</span> /home/fbone
699
-sudo stunnel stunnel-client.conf
700
-sudo openvpn client.ovpn
701
-</pre>
702
-</div>
703
-
704
 <p>
696
 <p>
705
-Using the password "<i>freedombone</i>". From a deep packet inspection point of view the traffic going over the internet will just look like any other TLS connection to a server.
697
+From a deep packet inspection point of view the traffic going over the internet between mesh gateways will just look like any other TLS connection to a server.
706
 </p>
698
 </p>
707
 </div>
699
 </div>
708
 </div>
700
 </div>
709
 
701
 
710
-<div id="outline-container-orgfb80d50" class="outline-3">
711
-<h3 id="orgfb80d50">Mobile devices (phones, etc)</h3>
712
-<div class="outline-text-3" id="text-orgfb80d50">
702
+<div id="outline-container-org538360a" class="outline-3">
703
+<h3 id="org538360a">Mobile devices (phones, etc)</h3>
704
+<div class="outline-text-3" id="text-org538360a">
713
 <p>
705
 <p>
714
 To allow mobile devices to connect to the mesh you will need a second wifi adapter connected to your laptop/netbook/SBC. Plug in a second wifi adapter then reboot the system. The second adaptor will then create a wifi hotspot which mobile devices can connect to. The hotspot name also contains its local IP address (eg. "<i>mesh-192.168.1.83</i>").
706
 To allow mobile devices to connect to the mesh you will need a second wifi adapter connected to your laptop/netbook/SBC. Plug in a second wifi adapter then reboot the system. The second adaptor will then create a wifi hotspot which mobile devices can connect to. The hotspot name also contains its local IP address (eg. "<i>mesh-192.168.1.83</i>").
715
 </p>
707
 </p>
731
 </p>
723
 </p>
732
 </div>
724
 </div>
733
 </div>
725
 </div>
734
-<div id="outline-container-org8cef3f4" class="outline-3">
735
-<h3 id="org8cef3f4">Chat System</h3>
736
-<div class="outline-text-3" id="text-org8cef3f4">
726
+<div id="outline-container-orgef6e799" class="outline-3">
727
+<h3 id="orgef6e799">Chat System</h3>
728
+<div class="outline-text-3" id="text-orgef6e799">
737
 <p>
729
 <p>
738
 Ensure that you're within wifi range of at least one other mesh peer (could be a router or client) and then you should see that the <i>Chat</i> and <i>Other Users</i> icons appear. Select the users icon and you should see a list of users on the mesh. Select the <i>Chat</i> icon and once you are connected you should see the status light turn green. If after a few minutes you don't get the green status light then try closing and re-opening the Tox chat application. Select the plus button to add a friend and then copy and paste in a Tox ID from the users list.
730
 Ensure that you're within wifi range of at least one other mesh peer (could be a router or client) and then you should see that the <i>Chat</i> and <i>Other Users</i> icons appear. Select the users icon and you should see a list of users on the mesh. Select the <i>Chat</i> icon and once you are connected you should see the status light turn green. If after a few minutes you don't get the green status light then try closing and re-opening the Tox chat application. Select the plus button to add a friend and then copy and paste in a Tox ID from the users list.
739
 </p>
731
 </p>
792
 </div>
784
 </div>
793
 </div>
785
 </div>
794
 
786
 
795
-<div id="outline-container-org1bfb325" class="outline-3">
796
-<h3 id="org1bfb325">Social Network</h3>
797
-<div class="outline-text-3" id="text-org1bfb325">
787
+<div id="outline-container-org9a11098" class="outline-3">
788
+<h3 id="org9a11098">Collaborative document editing</h3>
789
+<div class="outline-text-3" id="text-org9a11098">
790
+<p>
791
+The mesh system includes the ability to collaboratively edit various sorts of documents using CryptPad. CryptPad is an almost peer-to-peer system in that it is designed for a client/server environment but that the server aspect of it is very minimal and limited to orchestrating the connected clients. With CryptPad installed on each mesh peer it effectively enables peer-to-peer collaborative editing. Documents are ephemeral and forgotten unless they're exported or copy-pasted to permanent storage.
792
+</p>
793
+
794
+<div class="org-center">
795
+
796
+<div class="figure">
797
+<p><img src="images/mesh_cryptpad1.jpg" alt="mesh_cryptpad1.jpg" />
798
+</p>
799
+</div>
800
+</div>
801
+
802
+<p>
803
+To create a document click on the CryptPad icon. Depending upon the specifications of your system it may take a few seconds to load, so don't be too disturned if the browser contents look blank for a while. Select <span class="underline">Rich Text Pad</span> and give yourself a username.
804
+</p>
805
+
806
+<div class="org-center">
807
+
808
+<div class="figure">
809
+<p><img src="images/mesh_cryptpad2.jpg" alt="mesh_cryptpad2.jpg" />
810
+</p>
811
+</div>
812
+</div>
813
+
814
+<p>
815
+If you have the chat system running you can then copy and paste the URL for your pad into the chat, and the other user can then open the link and edit the document with you. You can repeat that for however many other users you wish to be able to edit.
816
+</p>
817
+</div>
818
+</div>
819
+
820
+<div id="outline-container-org05473b7" class="outline-3">
821
+<h3 id="org05473b7">Social Network</h3>
822
+<div class="outline-text-3" id="text-org05473b7">
798
 <p>
823
 <p>
799
 Patchwork is available as a social networking system for the mesh. Like all social network systems it has a stream of posts and you can follow or unfollow other users. You can also send private messages to other users with end-to-end encryption.
824
 Patchwork is available as a social networking system for the mesh. Like all social network systems it has a stream of posts and you can follow or unfollow other users. You can also send private messages to other users with end-to-end encryption.
800
 </p>
825
 </p>
829
 </div>
854
 </div>
830
 </div>
855
 </div>
831
 
856
 
832
-<div id="outline-container-org2d4c2ef" class="outline-3">
833
-<h3 id="org2d4c2ef">Sharing Files</h3>
834
-<div class="outline-text-3" id="text-org2d4c2ef">
857
+<div id="outline-container-orgc7f141c" class="outline-3">
858
+<h3 id="orgc7f141c">Sharing Files</h3>
859
+<div class="outline-text-3" id="text-orgc7f141c">
835
 <p>
860
 <p>
836
 You can make files publicly available on the network simply by dragging and dropping them into the <i>Public</i> folder on the desktop. To view the files belonging to another user select the desktop icon called <i>Visit a site</i> and enter the username or Tox ID of the other user.
861
 You can make files publicly available on the network simply by dragging and dropping them into the <i>Public</i> folder on the desktop. To view the files belonging to another user select the desktop icon called <i>Visit a site</i> and enter the username or Tox ID of the other user.
837
 </p>
862
 </p>
846
 </div>
871
 </div>
847
 </div>
872
 </div>
848
 
873
 
849
-<div id="outline-container-org47a1d04" class="outline-3">
850
-<h3 id="org47a1d04">Blogging</h3>
851
-<div class="outline-text-3" id="text-org47a1d04">
874
+<div id="outline-container-orgc6faf49" class="outline-3">
875
+<h3 id="orgc6faf49">Blogging</h3>
876
+<div class="outline-text-3" id="text-orgc6faf49">
852
 <p>
877
 <p>
853
 To create a blog post select the <i>Blog</i> icon on the desktop and then use the up and down cursor keys, space bar and enter key to add a new entry. Edit the title of the entry and add your text. You can also include photos if you wish - just copy them to the <b>CreateBlog/content/images</b> directory and then link to them as shown.
878
 To create a blog post select the <i>Blog</i> icon on the desktop and then use the up and down cursor keys, space bar and enter key to add a new entry. Edit the title of the entry and add your text. You can also include photos if you wish - just copy them to the <b>CreateBlog/content/images</b> directory and then link to them as shown.
854
 </p>
879
 </p>