Procházet zdrojové kódy

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

Bob Mottram před 7 roky
rodič
revize
2e10444237

+ 83
- 0
doc/EN/app_vpn.org Zobrazit soubor

1
+#+TITLE:
2
+#+AUTHOR: Bob Mottram
3
+#+EMAIL: bob@freedombone.net
4
+#+KEYWORDS: freedombone, openvpn
5
+#+DESCRIPTION: How to use OpenVPN on Freedombone
6
+#+OPTIONS: ^:nil toc:nil
7
+#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="freedombone.css" />
8
+
9
+#+BEGIN_CENTER
10
+[[file:images/logo.png]]
11
+#+END_CENTER
12
+
13
+#+BEGIN_EXPORT html
14
+<center>
15
+<h1>OpenVPN</h1>
16
+</center>
17
+#+END_EXPORT
18
+
19
+#+begin_quote
20
+"/The Net interprets censorship as damage and routes around it./" -- John Gilmore
21
+#+end_quote
22
+
23
+A Virtual Private Network (VPN) allows you to move your internet traffic to a different machine in a different geographical location by creating a private cryptographically protected route to that location. The usual use cases are to get around local censorship of the internet such as when you see the message "/this content is not available in your area/" when trying to play a video. Maybe you're on holiday and your hotel or workplace internet connection is censored. Using a VPN you can connect to your home server and then use the internet normally.
24
+
25
+Using a Tor browser is another way to get around censorship, but there might be occasions where you don't want to use a Tor browser or where Tor relays and bridges are blocked or where you want to run internet apps which aren't within a browser.
26
+
27
+On Freedombone the VPN is wrapped within a TLS layer of encryption, making it difficult for any deep packet inspection systems to know whether you are using a VPN or not. Since there is lots of TLS traffic on the internet your connection looks like any other TLS connection to a server, and this may help to avoid being censored. It's probably not possible for your local ISP to block TLS traffic without immediately generating a lot of irate customers, and stopping any kind of commercial activity.
28
+
29
+* Installation
30
+
31
+ssh into the system with:
32
+
33
+#+BEGIN_SRC bash
34
+ssh myusername@mydomainname -p 2222
35
+#+END_SRC
36
+
37
+Select *Administrator controls* then *Add/Remove apps* then *vpn*. Choose the port which you want the VPN to operate on and then the install will continue.
38
+
39
+Only use ports 443 or 80 for VPN as an /absolute last resort/, since doing so will prevent other web based apps from running on your server.
40
+
41
+* Usage
42
+
43
+When the installation is complete you can download your VPN keys and configuration files onto your local machine.
44
+
45
+#+begin_src bash
46
+scp -P 2222 myusername@mydomainname:/home/myusername/client.ovpn .
47
+scp -P 2222 myusername@mydomainname:/home/myusername/stunnel* .
48
+#+end_src
49
+
50
+You will need to ensure that the /openvpn/ and /stunnel/ packages are installed. On an Arch based system:
51
+
52
+#+begin_src bash
53
+sudp pacman -S openvpn stunnel4
54
+#+end_src
55
+
56
+Or on a Debian based system:
57
+
58
+#+begin_src bash
59
+sudo apt-get install openvpn stunnel4
60
+#+end_src
61
+
62
+Now you can connect to your VPN with:
63
+
64
+#+begin_src bash
65
+sudo stunnel stunnel-client.conf
66
+sudo openvpn client.ovpn
67
+#+end_src
68
+
69
+You should see a series of messages with "/Initialization Sequence Completed/" showing at the end. Leave the terminal open and perhaps minimize it to remain connected to the VPN. To leave the VPN close the terminal window.
70
+
71
+* Changing port number
72
+
73
+Avoiding censorship can be a cat and mouse game, and so if the port you're using for VPN gets blocked then you may want to change it.
74
+
75
+#+BEGIN_SRC bash
76
+ssh myusername@mydomainname -p 2222
77
+#+END_SRC
78
+
79
+Select *Administrator controls* then *App Settings* then *vpn*. Choose *Change TLS port* and enter a new port value. You can then either manually change the port within your VPN configuration files, or download them again as described in the [[Usage]] section above.
80
+
81
+* Generating new keys
82
+
83
+It's possible that your VPN keys might get lost or compromised on your local machine. If that happens you can generate new ones from the *Administrator controls* by going to *App Settings* then *vpn* then choosing *Regenerate keys for a user* and downloading the new keys as described in the [[Usage]] section above.

+ 4
- 0
doc/EN/apps.org Zobrazit soubor

154
 * Vim
154
 * Vim
155
 If you use the Mutt client to read your email then this will set it up to use vim for composing new mail.
155
 If you use the Mutt client to read your email then this will set it up to use vim for composing new mail.
156
 
156
 
157
+* Virtual Private Network (VPN)
158
+Set up a VPN on your server so that you can bypass local internet censorship.
159
+
160
+[[./app_vpn.html][How to use it]]
157
 * XMPP
161
 * XMPP
158
 Chat server which can be used together with client such as Gajim or Conversations to provide end-to-end content security and also onion routed metadata security. Includes advanced features such as /client state notification/ to save battery power on your mobile devices, support for seamless roaming between networks and /message carbons/ so that you can receive the same messages while being simultaneously logged in to your account on more than one device.
162
 Chat server which can be used together with client such as Gajim or Conversations to provide end-to-end content security and also onion routed metadata security. Includes advanced features such as /client state notification/ to save battery power on your mobile devices, support for seamless roaming between networks and /message carbons/ so that you can receive the same messages while being simultaneously logged in to your account on more than one device.
159
 
163
 

+ 1
- 1
src/freedombone-addcert Zobrazit soubor

49
 remove_cert=
49
 remove_cert=
50
 LETSENCRYPT_HOSTNAME=
50
 LETSENCRYPT_HOSTNAME=
51
 COUNTRY_CODE="US"
51
 COUNTRY_CODE="US"
52
-AREA="Free Speech Zone"
52
+AREA="Apparent Free Speech Zone"
53
 LOCATION="Freedomville"
53
 LOCATION="Freedomville"
54
 ORGANISATION="Freedombone"
54
 ORGANISATION="Freedombone"
55
 UNIT="Freedombone Unit"
55
 UNIT="Freedombone Unit"

+ 585
- 21
src/freedombone-app-vpn Zobrazit soubor

9
 #                    Freedom in the Cloud
9
 #                    Freedom in the Cloud
10
 #
10
 #
11
 # VPN functions
11
 # VPN functions
12
+# https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-debian-8
13
+# https://jamielinux.com/blog/force-all-network-traffic-through-openvpn-using-iptables/
14
+# http://www.farrellf.com/projects/software/2016-05-04_Running_a_VPN_Server_with_OpenVPN_and_Stunnel/index_.php
12
 #
15
 #
13
 # License
16
 # License
14
 # =======
17
 # =======
15
 #
18
 #
16
-# Copyright (C) 2014-2016 Bob Mottram <bob@freedombone.net>
19
+# Copyright (C) 2014-2017 Bob Mottram <bob@freedombone.net>
17
 #
20
 #
18
 # This program is free software: you can redistribute it and/or modify
21
 # This program is free software: you can redistribute it and/or modify
19
 # it under the terms of the GNU Affero General Public License as published by
22
 # it under the terms of the GNU Affero General Public License as published by
28
 # You should have received a copy of the GNU Affero General Public License
31
 # You should have received a copy of the GNU Affero General Public License
29
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
32
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
30
 
33
 
31
-VARIANTS=''
34
+VARIANTS='full full-vim'
32
 
35
 
33
 IN_DEFAULT_INSTALL=0
36
 IN_DEFAULT_INSTALL=0
34
 SHOW_ON_ABOUT=0
37
 SHOW_ON_ABOUT=0
35
 
38
 
36
-vpn_variables=()
39
+OPENVPN_SERVER_NAME="server"
40
+OPENVPN_KEY_FILENAME='client.ovpn'
41
+
42
+VPN_COUNTRY_CODE="US"
43
+VPN_AREA="Apparent Free Speech Zone"
44
+VPN_LOCATION="Freedomville"
45
+VPN_ORGANISATION="Freedombone"
46
+VPN_UNIT="Freedombone Unit"
47
+STUNNEL_PORT=3439
48
+VPN_TLS_PORT=553
49
+
50
+vpn_variables=(MY_EMAIL_ADDRESS
51
+               DEFAULT_DOMAIN_NAME
52
+               MY_USERNAME
53
+               VPN_COUNTRY_CODE
54
+               VPN_AREA
55
+               VPN_LOCATION
56
+               VPN_ORGANISATION
57
+               VPN_UNIT
58
+               VPN_TLS_PORT)
37
 
59
 
38
 function logging_on_vpn {
60
 function logging_on_vpn {
39
     echo -n ''
61
     echo -n ''
44
 }
66
 }
45
 
67
 
46
 function install_interactive_vpn {
68
 function install_interactive_vpn {
47
-    echo -n ''
69
+    read_config_param VPN_TLS_PORT
70
+    if [ ! $VPN_TLS_PORT ]; then
71
+        VPN_TLS_PORT=553
72
+    fi
73
+    VPN_DETAILS_COMPLETE=
74
+    while [ ! $VPN_DETAILS_COMPLETE ]
75
+    do
76
+        data=$(tempfile 2>/dev/null)
77
+        trap "rm -f $data" 0 1 2 5 15
78
+        currtlsport=$(grep 'VPN_TLS_PORT' temp.cfg | awk -F '=' '{print $2}')
79
+        if [ $currtlsport ]; then
80
+            VPN_TLS_PORT=$currtlsport
81
+        fi
82
+        dialog --backtitle $"Freedombone Configuration" \
83
+               --title $"VPN Configuration" \
84
+               --form $"\nPlease enter your VPN details. Changing the port to 443 will help defend against censorship but will prevent other web apps from running." 12 65 1 \
85
+               $"TLS port:" 1 1 "$VPN_TLS_PORT" 1 12 5 5 \
86
+               2> $data
87
+        sel=$?
88
+        case $sel in
89
+            1) exit 1;;
90
+            255) exit 1;;
91
+        esac
92
+        tlsport=$(cat $data | sed -n 1p)
93
+        if [ ${#tlsport} -gt 1 ]; then
94
+            if [[ "$tlsport" != *' '* && "$tlsport" != *'.'* ]]; then
95
+                VPN_TLS_PORT="$tlsport"
96
+                VPN_DETAILS_COMPLETE="yes"
97
+                write_config_param "VPN_TLS_PORT" "$VPN_TLS_PORT"
98
+            fi
99
+        fi
100
+    done
101
+    clear
48
     APP_INSTALLED=1
102
     APP_INSTALLED=1
49
 }
103
 }
50
 
104
 
105
+function vpn_change_tls_port {
106
+    EXISTING_VPN_TLS_PORT=$VPN_TLS_PORT
107
+
108
+    data=$(tempfile 2>/dev/null)
109
+    trap "rm -f $data" 0 1 2 5 15
110
+    dialog --title $"VPN Configuration" \
111
+           --backtitle $"Freedombone Control Panel" \
112
+           --inputbox $'Change TLS port' 10 50 $VPN_TLS_PORT 2>$data
113
+    sel=$?
114
+    case $sel in
115
+        0)
116
+            tlsport=$(<$data)
117
+            if [ ${#tlsport} -gt 0 ]; then
118
+                if [[ "$tlsport" != "$EXISTING_VPN_TLS_PORT" ]]; then
119
+                    clear
120
+                    VPN_TLS_PORT=$tlsport
121
+                    write_config_param "VPN_TLS_PORT" "$VPN_TLS_PORT"
122
+                    sed -i "s|accept =.*|accept = $VPN_TLS_PORT|g" /etc/stunnel/stunnel.conf
123
+                    sed -i "s|accept =.*|accept = $VPN_TLS_PORT|g" /etc/stunnel/stunnel-client.conf
124
+
125
+                    for d in /home/*/ ; do
126
+                        USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
127
+                        if [ -f /home/$USERNAME/stunnel-client.conf ]; then
128
+                            cp /etc/stunnel/stunnel-client.conf /home/$USERNAME/stunnel-client.conf
129
+                            chown $USERNAME:$USERNAME /home/$USERNAME/stunnel-client.conf
130
+                        fi
131
+                    done
132
+
133
+                    if [ $VPN_TLS_PORT -eq 443 ]; then
134
+                        systemctl stop nginx
135
+                        systemctl disable nginx
136
+                    else
137
+                        systemctl enable nginx
138
+                        systemctl restart nginx
139
+                    fi
140
+
141
+                    systemctl restart stunnel
142
+
143
+                    dialog --title $"VPN Configuration" \
144
+                           --msgbox $"TLS port changed to $VPN_TLS_PORT" 6 60
145
+                fi
146
+            fi
147
+            ;;
148
+    esac
149
+}
150
+
151
+function vpn_regenerate_client_keys {
152
+    data=$(tempfile 2>/dev/null)
153
+    trap "rm -f $data" 0 1 2 5 15
154
+    dialog --title $"Regenerate VPN keys for a user" \
155
+           --backtitle $"Freedombone Control Panel" \
156
+           --inputbox $'username' 10 50 2>$data
157
+    sel=$?
158
+    case $sel in
159
+        0)
160
+            USERNAME=$(<$data)
161
+            if [ ${#USERNAME} -gt 0 ]; then
162
+                if [ -d /home/$USERNAME ]; then
163
+                    clear
164
+                    create_user_vpn_key $USERNAME
165
+                    dialog --title $"Regenerate VPN keys for a user" \
166
+                           --msgbox $"VPN keys were regenerated for $USERNAME" 6 60
167
+                fi
168
+            fi
169
+            ;;
170
+    esac
171
+}
172
+
173
+function configure_interactive_vpn {
174
+    read_config_param VPN_TLS_PORT
175
+    while true
176
+    do
177
+        data=$(tempfile 2>/dev/null)
178
+        trap "rm -f $data" 0 1 2 5 15
179
+        dialog --backtitle $"Freedombone Control Panel" \
180
+               --title $"VPN Configuration" \
181
+               --radiolist $"Choose an operation:" 13 70 3 \
182
+               1 $"Change TLS port (currently $VPN_TLS_PORT)" off \
183
+               2 $"Regenerate keys for a user" off \
184
+               3 $"Exit" on 2> $data
185
+        sel=$?
186
+        case $sel in
187
+            1) return;;
188
+            255) return;;
189
+        esac
190
+        case $(cat $data) in
191
+            1) vpn_change_tls_port;;
192
+            2) vpn_regenerate_client_keys;;
193
+            3) break;;
194
+        esac
195
+    done
196
+}
197
+
51
 function reconfigure_vpn {
198
 function reconfigure_vpn {
52
     echo -n ''
199
     echo -n ''
53
 }
200
 }
57
 }
204
 }
58
 
205
 
59
 function backup_local_vpn {
206
 function backup_local_vpn {
60
-    echo -n ''
207
+    for d in /home/*/ ; do
208
+        USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
209
+        if [ -f /home/$USERNAME/$OPENVPN_KEY_FILENAME ]; then
210
+            cp /home/$USERNAME/$OPENVPN_KEY_FILENAME /etc/openvpn/easy-rsa/keys/${USERNAME}_${OPENVPN_KEY_FILENAME}
211
+        fi
212
+    done
213
+
214
+    function_check backup_directory_to_usb
215
+    backup_directory_to_usb /etc/openvpn/easy-rsa/keys vpn
216
+    backup_directory_to_usb /etc/stunnel vpnstunnel
61
 }
217
 }
62
 
218
 
63
 function restore_local_vpn {
219
 function restore_local_vpn {
64
-    echo -n ''
220
+    temp_restore_dir=/root/tempvpn
221
+    restore_directory_from_usb $temp_restore_dir vpn
222
+    if [ -d ${temp_restore_dir} ]; then
223
+        cp -r ${temp_restore_dir}/* /etc/openvpn/easy-rsa/keys
224
+        cp -r ${temp_restore_dir}/${OPENVPN_SERVER_NAME}* /etc/openvpn/
225
+        cp -r ${temp_restore_dir}/dh* /etc/openvpn/
226
+        rm -rf ${temp_restore_dir}
227
+
228
+        for d in /home/*/ ; do
229
+            USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
230
+            if [ -f /etc/openvpn/easy-rsa/keys/${USERNAME}_${OPENVPN_KEY_FILENAME} ]; then
231
+                cp /etc/openvpn/easy-rsa/keys/${USERNAME}_${OPENVPN_KEY_FILENAME} /home/$USERNAME/$OPENVPN_KEY_FILENAME
232
+                chown $USERNAME:$USERNAME /home/$USERNAME/$OPENVPN_KEY_FILENAME
233
+            fi
234
+        done
235
+    fi
236
+    temp_restore_dir=/root/tempvpnstunnel
237
+    restore_directory_from_usb $temp_restore_dir vpnstunnel
238
+    if [ -d ${temp_restore_dir} ]; then
239
+        cp -r ${temp_restore_dir}/* /etc/stunnel
240
+        rm -rf ${temp_restore_dir}
241
+        for d in /home/*/ ; do
242
+            USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
243
+            if [ -f /home/$USERNAME/stunnel.pem ]; then
244
+                cp /etc/stunnel/stunnel.pem /home/$USERNAME/stunnel.pem
245
+                chown $USERNAME:$USERNAME /home/$USERNAME/stunnel.pem
246
+            fi
247
+            if [ -f /home/$USERNAME/stunnel.p12 ]; then
248
+                cp /etc/stunnel/stunnel.p12 /home/$USERNAME/stunnel.p12
249
+                chown $USERNAME:$USERNAME /home/$USERNAME/stunnel.p12
250
+            fi
251
+        done
252
+    fi
65
 }
253
 }
66
 
254
 
67
 function backup_remote_vpn {
255
 function backup_remote_vpn {
68
-    echo -n ''
256
+    for d in /home/*/ ; do
257
+        USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
258
+        if [ -f /home/$USERNAME/$OPENVPN_KEY_FILENAME ]; then
259
+            cp /home/$USERNAME/$OPENVPN_KEY_FILENAME /etc/openvpn/easy-rsa/keys/${USERNAME}_${OPENVPN_KEY_FILENAME}
260
+        fi
261
+    done
262
+
263
+    function_check backup_directory_to_friend
264
+    backup_directory_to_friend /etc/openvpn/easy-rsa/keys vpn
265
+    backup_directory_to_friend /etc/stunnel vpnstunnel
69
 }
266
 }
70
 
267
 
71
 function restore_remote_vpn {
268
 function restore_remote_vpn {
72
-    echo -n ''
269
+    temp_restore_dir=/root/tempvpn
270
+    restore_directory_from_friend $temp_restore_dir vpn
271
+    if [ -d ${temp_restore_dir} ]; then
272
+        cp -r ${temp_restore_dir}/* /etc/openvpn/easy-rsa/keys
273
+        cp -r ${temp_restore_dir}/${OPENVPN_SERVER_NAME}* /etc/openvpn/
274
+        cp -r ${temp_restore_dir}/dh* /etc/openvpn/
275
+        rm -rf ${temp_restore_dir}
276
+
277
+        for d in /home/*/ ; do
278
+            USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
279
+            if [ -f /etc/openvpn/easy-rsa/keys/${USERNAME}_${OPENVPN_KEY_FILENAME} ]; then
280
+                cp /etc/openvpn/easy-rsa/keys/${USERNAME}_${OPENVPN_KEY_FILENAME} /home/$USERNAME/$OPENVPN_KEY_FILENAME
281
+                chown $USERNAME:$USERNAME /home/$USERNAME/$OPENVPN_KEY_FILENAME
282
+            fi
283
+        done
284
+    fi
285
+    temp_restore_dir=/root/tempvpnstunnel
286
+    restore_directory_from_friend $temp_restore_dir vpnstunnel
287
+    if [ -d ${temp_restore_dir} ]; then
288
+        cp -r ${temp_restore_dir}/* /etc/stunnel
289
+        rm -rf ${temp_restore_dir}
290
+        for d in /home/*/ ; do
291
+            USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
292
+            if [ -f /home/$USERNAME/stunnel.pem ]; then
293
+                cp /etc/stunnel/stunnel.pem /home/$USERNAME/stunnel.pem
294
+                chown $USERNAME:$USERNAME /home/$USERNAME/stunnel.pem
295
+            fi
296
+            if [ -f /home/$USERNAME/stunnel.p12 ]; then
297
+                cp /etc/stunnel/stunnel.p12 /home/$USERNAME/stunnel.p12
298
+                chown $USERNAME:$USERNAME /home/$USERNAME/stunnel.p12
299
+            fi
300
+        done
301
+    fi
73
 }
302
 }
74
 
303
 
75
 function remove_vpn {
304
 function remove_vpn {
76
-    apt-get -yq remove --purge fastd
305
+    systemctl stop stunnel
306
+    systemctl disable stunnel
307
+    rm /etc/systemd/system/stunnel.service
308
+
309
+    systemctl stop openvpn
310
+    if [ $VPN_TLS_PORT -ne 443 ]; then
311
+        firewall_remove VPN-TLS $VPN_TLS_PORT
312
+    else
313
+        systemctl enable nginx
314
+        systemctl restart nginx
315
+    fi
316
+
317
+    apt-get -yq remove --purge fastd openvpn easy-rsa
318
+    apt-get -yq remove stunnel4
319
+    if [ -d /etc/openvpn ]; then
320
+        rm -rf /etc/openvpn
321
+    fi
322
+    firewall_disable_vpn
323
+
324
+    echo 0 > /proc/sys/net/ipv4/ip_forward
325
+    sed -i 's|net.ipv4.ip_forward=.*|net.ipv4.ip_forward=0|g' /etc/sysctl.conf
326
+
77
     remove_completion_param install_vpn
327
     remove_completion_param install_vpn
328
+
329
+    # remove any client keys
330
+    for d in /home/*/ ; do
331
+        USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
332
+        if [ -f /home/$USERNAME/$OPENVPN_KEY_FILENAME ]; then
333
+            shred -zu /home/$USERNAME/$OPENVPN_KEY_FILENAME
334
+        fi
335
+        rm /home/$USERNAME/stunnel*
336
+    done
337
+    userdel -f vpn
338
+    groupdel -f vpn
339
+
340
+    if [ -d /etc/stunnel ]; then
341
+        rm -rf /etc/stunnel
342
+    fi
343
+}
344
+
345
+function create_user_vpn_key {
346
+    username=$1
347
+
348
+    if [ ! -d /home/$username ]; then
349
+        return
350
+    fi
351
+
352
+    echo $"Creating VPN key for $username"
353
+
354
+    cd /etc/openvpn/easy-rsa
355
+
356
+    if [ -f /etc/openvpn/easy-rsa/keys/$username.crt ]; then
357
+        rm /etc/openvpn/easy-rsa/keys/$username.crt
358
+    fi
359
+    if [ -f /etc/openvpn/easy-rsa/keys/$username.key ]; then
360
+        rm /etc/openvpn/easy-rsa/keys/$username.key
361
+    fi
362
+    if [ -f /etc/openvpn/easy-rsa/keys/$username.csr ]; then
363
+        rm /etc/openvpn/easy-rsa/keys/$username.csr
364
+    fi
365
+
366
+    sed -i 's| --interact||g' build-key
367
+    ./build-key "$username"
368
+
369
+    if [ ! -f /etc/openvpn/easy-rsa/keys/$username.crt ]; then
370
+        echo $'VPN user cert not generated'
371
+        exit 783528
372
+    fi
373
+    user_cert=$(cat /etc/openvpn/easy-rsa/keys/$username.crt)
374
+    if [ ${#user_cert} -lt 10 ]; then
375
+        cat /etc/openvpn/easy-rsa/keys/$username.crt
376
+        echo $'User cert generation failed'
377
+        exit 634659
378
+    fi
379
+    if [ ! -f /etc/openvpn/easy-rsa/keys/$username.key ]; then
380
+        echo $'VPN user key not generated'
381
+        exit 682523
382
+    fi
383
+    user_key=$(cat /etc/openvpn/easy-rsa/keys/$username.key)
384
+    if [ ${#user_key} -lt 10 ]; then
385
+        cat /etc/openvpn/easy-rsa/keys/$username.key
386
+        echo $'User key generation failed'
387
+        exit 285838
388
+    fi
389
+
390
+    user_vpn_cert_file=/home/$username/$OPENVPN_KEY_FILENAME
391
+
392
+    echo 'client' > $user_vpn_cert_file
393
+    echo 'dev tun' >> $user_vpn_cert_file
394
+    echo 'proto tcp' >> $user_vpn_cert_file
395
+    echo "remote localhost $STUNNEL_PORT" >> $user_vpn_cert_file
396
+    echo "route $DEFAULT_DOMAIN_NAME 255.255.255.255 net_gateway" >> $user_vpn_cert_file
397
+    echo 'resolv-retry infinite' >> $user_vpn_cert_file
398
+    echo 'nobind' >> $user_vpn_cert_file
399
+    echo 'tun-mtu 1500' >> $user_vpn_cert_file
400
+    echo 'tun-mtu-extra 32' >> $user_vpn_cert_file
401
+    echo 'mssfix 1450' >> $user_vpn_cert_file
402
+    echo 'persist-key' >> $user_vpn_cert_file
403
+    echo 'persist-tun' >> $user_vpn_cert_file
404
+    echo 'auth-nocache' >> $user_vpn_cert_file
405
+    echo 'remote-cert-tls server' >> $user_vpn_cert_file
406
+    echo 'comp-lzo' >> $user_vpn_cert_file
407
+    echo 'verb 3' >> $user_vpn_cert_file
408
+    echo '' >> $user_vpn_cert_file
409
+
410
+    echo '<ca>' >> $user_vpn_cert_file
411
+    cat /etc/openvpn/ca.crt >> $user_vpn_cert_file
412
+    echo '</ca>' >> $user_vpn_cert_file
413
+
414
+    echo '<cert>' >> $user_vpn_cert_file
415
+    cat /etc/openvpn/easy-rsa/keys/$username.crt >> $user_vpn_cert_file
416
+    echo '</cert>' >> $user_vpn_cert_file
417
+
418
+    echo '<key>' >> $user_vpn_cert_file
419
+    cat /etc/openvpn/easy-rsa/keys/$username.key >> $user_vpn_cert_file
420
+    echo '</key>' >> $user_vpn_cert_file
421
+
422
+    chown $username:$username $user_vpn_cert_file
423
+
424
+    # keep a backup
425
+    cp $user_vpn_cert_file /etc/openvpn/easy-rsa/keys/$username.ovpn
426
+
427
+    #rm /etc/openvpn/easy-rsa/keys/$username.crt
428
+    #rm /etc/openvpn/easy-rsa/keys/$username.csr
429
+    shred -zu /etc/openvpn/easy-rsa/keys/$username.key
430
+
431
+    echo $"VPN key created at $user_vpn_cert_file"
432
+}
433
+
434
+function add_user_vpn {
435
+    new_username="$1"
436
+    new_user_password="$2"
437
+
438
+    create_user_vpn_key $new_username
439
+    if [ -f /etc/stunnel/stunnel.pem ]; then
440
+        cp /etc/stunnel/stunnel.pem /home/$new_username/stunnel.pem
441
+        chown $new_username:$new_username /home/$new_username/stunnel.pem
442
+    fi
443
+    if [ -f /etc/stunnel/stunnel.p12 ]; then
444
+        cp /etc/stunnel/stunnel.p12 /home/$new_username/stunnel.p12
445
+        chown $new_username:$new_username /home/$new_username/stunnel.p12
446
+    fi
447
+    cp /etc/stunnel/stunnel-client.conf /home/$new_username/stunnel-client.conf
448
+    chown $new_username:$new_username /home/$new_username/stunnel-client.conf
449
+}
450
+
451
+function remove_user_vpn {
452
+    new_username="$1"
453
+}
454
+
455
+function install_stunnel {
456
+    apt-get -yq install stunnel4
457
+
458
+    cd /etc/stunnel
459
+
460
+    openssl req -x509 -nodes -days 3650 -sha256 \
461
+            -subj "/O=$VPN_ORGANISATION/OU=$VPN_UNIT/C=$VPN_COUNTRY_CODE/ST=$VPN_AREA/L=$VPN_LOCATION/CN=$HOSTNAME" \
462
+            -newkey rsa:2048 -keyout key.pem \
463
+            -out cert.pem
464
+    if [ ! -f key.pem ]; then
465
+        echo $'stunnel key not created'
466
+        exit 793530
467
+    fi
468
+    if [ ! -f cert.pem ]; then
469
+        echo $'stunnel cert not created'
470
+        exit 204587
471
+    fi
472
+    chmod 400 key.pem
473
+    chmod 640 cert.pem
474
+
475
+    cat key.pem cert.pem >> stunnel.pem
476
+    chmod 640 stunnel.pem
477
+
478
+    openssl pkcs12 -export -out stunnel.p12 -inkey key.pem -in cert.pem -passout pass:
479
+    if [ ! -f stunnel.p12 ]; then
480
+        echo $'stunnel pkcs12 not created'
481
+        exit 639353
482
+    fi
483
+    chmod 640 stunnel.p12
484
+
485
+    echo 'chroot = /var/lib/stunnel4' > stunnel.conf
486
+    echo 'pid = /stunnel4.pid' >> stunnel.conf
487
+    echo 'setuid = stunnel4' >> stunnel.conf
488
+    echo 'setgid = stunnel4' >> stunnel.conf
489
+    echo 'socket = l:TCP_NODELAY=1' >> stunnel.conf
490
+    echo 'socket = r:TCP_NODELAY=1' >> stunnel.conf
491
+    echo 'cert = /etc/stunnel/stunnel.pem' >> stunnel.conf
492
+    echo '[openvpn]' >> stunnel.conf
493
+    echo "accept = $VPN_TLS_PORT" >> stunnel.conf
494
+    echo 'connect = localhost:1194' >> stunnel.conf
495
+    echo 'cert = /etc/stunnel/stunnel.pem' >> stunnel.conf
496
+
497
+    sed -i 's|ENABLED=.*|ENABLED=1|g' /etc/default/stunnel4
498
+
499
+    echo '[openvpn]' > stunnel-client.conf
500
+    echo 'client = yes' >> stunnel-client.conf
501
+    echo "accept = $STUNNEL_PORT" >> stunnel-client.conf
502
+    echo "connect = $DEFAULT_DOMAIN_NAME:$VPN_TLS_PORT" >> stunnel-client.conf
503
+    echo 'cert = stunnel.pem' >> stunnel-client.conf
504
+
505
+    echo '[Unit]' > /etc/systemd/system/stunnel.service
506
+    echo 'Description=SSL tunnel for network daemons' >> /etc/systemd/system/stunnel.service
507
+    echo 'Documentation=man:stunnel https://www.stunnel.org/docs.html' >> /etc/systemd/system/stunnel.service
508
+    echo 'DefaultDependencies=no' >> /etc/systemd/system/stunnel.service
509
+    echo 'After=network.target' >> /etc/systemd/system/stunnel.service
510
+    echo 'After=syslog.target' >> /etc/systemd/system/stunnel.service
511
+    echo '' >> /etc/systemd/system/stunnel.service
512
+    echo '[Install]' >> /etc/systemd/system/stunnel.service
513
+    echo 'WantedBy=multi-user.target' >> /etc/systemd/system/stunnel.service
514
+    echo 'Alias=stunnel.target' >> /etc/systemd/system/stunnel.service
515
+    echo '' >> /etc/systemd/system/stunnel.service
516
+    echo '[Service]' >> /etc/systemd/system/stunnel.service
517
+    echo 'Type=forking' >> /etc/systemd/system/stunnel.service
518
+    echo 'RuntimeDirectory=stunnel' >> /etc/systemd/system/stunnel.service
519
+    echo 'EnvironmentFile=-/etc/stunnel/stunnel.conf' >> /etc/systemd/system/stunnel.service
520
+    echo 'ExecStart=/usr/bin/stunnel /etc/stunnel/stunnel.conf' >> /etc/systemd/system/stunnel.service
521
+    echo 'ExecStop=/usr/bin/killall -9 stunnel' >> /etc/systemd/system/stunnel.service
522
+    echo 'RemainAfterExit=yes' >> /etc/systemd/system/stunnel.service
523
+
524
+    if [ $VPN_TLS_PORT -eq 443 ]; then
525
+        systemctl stop nginx
526
+        systemctl disable nginx
527
+    else
528
+        systemctl enable nginx
529
+        systemctl restart nginx
530
+    fi
531
+
532
+    systemctl enable stunnel
533
+    systemctl daemon-reload
534
+    systemctl start stunnel
535
+
536
+    cp /etc/stunnel/stunnel.pem /home/$MY_USERNAME/stunnel.pem
537
+    cp /etc/stunnel/stunnel.p12 /home/$MY_USERNAME/stunnel.p12
538
+    cp /etc/stunnel/stunnel-client.conf /home/$MY_USERNAME/stunnel-client.conf
539
+    chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/stunnel*
78
 }
540
 }
79
 
541
 
80
 function install_vpn {
542
 function install_vpn {
81
-    if ! grep -q "repo.universe-factory.net" /etc/apt/sources.list; then
82
-        echo 'deb http://repo.universe-factory.net/debian/ sid main' >> /etc/apt/sources.list
83
-        gpg --keyserver pgpkeys.mit.edu --recv-key 16EF3F64CB201D9C
84
-        if [ ! "$?" = "0" ]; then
85
-            exit 76272
86
-        fi
87
-        gpg -a --export 16EF3F64CB201D9C | sudo apt-key add -
88
-        apt-get update
89
-        apt-get -yq install fastd
90
-        if [ ! "$?" = "0" ]; then
91
-            exit 52026
92
-        fi
543
+    apt-get -yq install fastd openvpn easy-rsa
544
+
545
+    groupadd vpn
546
+    useradd -r -s /bin/false -g vpn vpn
547
+
548
+    # server configuration
549
+    echo 'port 1194' > /etc/openvpn/server.conf
550
+    echo 'proto tcp' >> /etc/openvpn/server.conf
551
+    echo 'dev tun' >> /etc/openvpn/server.conf
552
+    echo 'tun-mtu 1500' >> /etc/openvpn/server.conf
553
+    echo 'tun-mtu-extra 32' >> /etc/openvpn/server.conf
554
+    echo 'mssfix 1450' >> /etc/openvpn/server.conf
555
+    echo 'ca /etc/openvpn/ca.crt' >> /etc/openvpn/server.conf
556
+    echo 'cert /etc/openvpn/server.crt' >> /etc/openvpn/server.conf
557
+    echo 'key /etc/openvpn/server.key' >> /etc/openvpn/server.conf
558
+    echo 'dh /etc/openvpn/dh2048.pem' >> /etc/openvpn/server.conf
559
+    echo 'server 10.8.0.0 255.255.255.0' >> /etc/openvpn/server.conf
560
+    echo 'push "redirect-gateway def1 bypass-dhcp"' >> /etc/openvpn/server.conf
561
+    echo "push \"dhcp-option DNS 85.214.73.63\"" >> /etc/openvpn/server.conf
562
+    echo "push \"dhcp-option DNS 213.73.91.35\"" >> /etc/openvpn/server.conf
563
+    echo 'keepalive 5 30' >> /etc/openvpn/server.conf
564
+    echo 'comp-lzo' >> /etc/openvpn/server.conf
565
+    echo 'persist-key' >> /etc/openvpn/server.conf
566
+    echo 'persist-tun' >> /etc/openvpn/server.conf
567
+    echo 'status /dev/null' >> /etc/openvpn/server.conf
568
+    echo 'verb 3' >> /etc/openvpn/server.conf
569
+    echo '' >> /etc/openvpn/server.conf
570
+
571
+    echo 1 > /proc/sys/net/ipv4/ip_forward
572
+    sed -i 's|# net.ipv4.ip_forward|net.ipv4.ip_forward|g' /etc/sysctl.conf
573
+    sed -i 's|#net.ipv4.ip_forward|net.ipv4.ip_forward|g' /etc/sysctl.conf
574
+    sed -i 's|net.ipv4.ip_forward.*|net.ipv4.ip_forward=1|g' /etc/sysctl.conf
575
+
576
+    cp -r /usr/share/easy-rsa/ /etc/openvpn
577
+    if [ ! -d /etc/openvpn/easy-rsa/keys ]; then
578
+        mkdir /etc/openvpn/easy-rsa/keys
579
+    fi
580
+
581
+    # keys configuration
582
+    sed -i "s|export KEY_COUNTRY.*|export KEY_COUNTRY=\"US\"|g" /etc/openvpn/easy-rsa/vars
583
+    sed -i "s|export KEY_PROVINCE.*|export KEY_PROVINCE=\"TX\"|g" /etc/openvpn/easy-rsa/vars
584
+    sed -i "s|export KEY_CITY.*|export KEY_CITY=\"Dallas\"|g" /etc/openvpn/easy-rsa/vars
585
+    sed -i "s|export KEY_ORG.*|export KEY_ORG=\"$PROJECT_NAME\"|g" /etc/openvpn/easy-rsa/vars
586
+    sed -i "s|export KEY_EMAIL.*|export KEY_EMAIL=\"$MY_EMAIL_ADDRESS\"|g" /etc/openvpn/easy-rsa/vars
587
+    sed -i "s|export KEY_OU=.*|export KEY_OU=\"MoonUnit\"|g" /etc/openvpn/easy-rsa/vars
588
+    sed -i "s|export KEY_NAME.*|export KEY_NAME=\"$OPENVPN_SERVER_NAME\"|g" /etc/openvpn/easy-rsa/vars
589
+
590
+    # generate host keys
591
+    if [ ! -f /etc/openvpn/dh2048.pem ]; then
592
+        openssl dhparam -out /etc/openvpn/dh2048.pem 2048
593
+    fi
594
+    if [ ! -f /etc/openvpn/dh2048.pem ]; then
595
+        echo $'vpn dhparams were not generated'
596
+        exit 73724523
597
+    fi
598
+    cp /etc/openvpn/dh2048.pem /etc/openvpn/easy-rsa/keys/dh2048.pem
599
+
600
+    cd /etc/openvpn/easy-rsa
601
+    . ./vars
602
+    ./clean-all
603
+    vpn_openssl_version='1.0.0'
604
+    if [ ! -f openssl-${vpn_openssl_version}.cnf ]; then
605
+        echo $"openssl-${vpn_openssl_version}.cnf was not found"
606
+        exit 7392353
607
+    fi
608
+    cp openssl-${vpn_openssl_version}.cnf openssl.cnf
609
+
610
+    if [ -f /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.crt ]; then
611
+        rm /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.crt
612
+    fi
613
+    if [ -f /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.key ]; then
614
+        rm /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.key
93
     fi
615
     fi
616
+    if [ -f /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.csr ]; then
617
+        rm /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.csr
618
+    fi
619
+    sed -i 's| --interact||g' build-key-server
620
+    sed -i 's| --interact||g' build-ca
621
+    ./build-ca
622
+    ./build-key-server $OPENVPN_SERVER_NAME
623
+    if [ ! -f /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.crt ]; then
624
+        echo $'OpenVPN crt not found'
625
+        exit 7823352
626
+    fi
627
+    server_cert=$(cat /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.crt)
628
+    if [ ${#server_cert} -lt 10 ]; then
629
+        cat /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.crt
630
+        echo $'Server cert generation failed'
631
+        exit 3284682
632
+    fi
633
+
634
+    if [ ! -f /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.key ]; then
635
+        echo $'OpenVPN key not found'
636
+        exit 6839436
637
+    fi
638
+    if [ ! -f /etc/openvpn/easy-rsa/keys/ca.key ]; then
639
+        echo $'OpenVPN ca not found'
640
+        exit 7935203
641
+    fi
642
+    cp /etc/openvpn/easy-rsa/keys/{$OPENVPN_SERVER_NAME.crt,$OPENVPN_SERVER_NAME.key,ca.crt} /etc/openvpn
643
+
644
+    create_user_vpn_key $MY_USERNAME
645
+
646
+    firewall_enable_vpn
647
+
648
+    if [ $VPN_TLS_PORT -ne 443 ]; then
649
+        firewall_add VPN-TLS $VPN_TLS_PORT tcp
650
+    fi
651
+
652
+    systemctl start openvpn
653
+
654
+    install_stunnel
655
+
656
+    systemctl restart openvpn
657
+
94
     APP_INSTALLED=1
658
     APP_INSTALLED=1
95
 }
659
 }
96
 
660
 

+ 1
- 1
src/freedombone-controlpanel Zobrazit soubor

519
     echo $'IP/DNS addresses'
519
     echo $'IP/DNS addresses'
520
     echo '================'
520
     echo '================'
521
     echo ''
521
     echo ''
522
-    echo -n "IPv4: $(get_ipv4_address)"
522
+    echo -n "IPv4: $(get_ipv4_address)/$(get_external_ipv4_address)"
523
     ipv6_address="$(get_ipv6_address)"
523
     ipv6_address="$(get_ipv6_address)"
524
     if [ ${#ipv6_address} -gt 0 ]; then
524
     if [ ${#ipv6_address} -gt 0 ]; then
525
         echo "    IPv6: ${ipv6_address}"
525
         echo "    IPv6: ${ipv6_address}"

+ 26
- 0
src/freedombone-utils-firewall Zobrazit soubor

32
 
32
 
33
 FIREWALL_CONFIG=$HOME/${PROJECT_NAME}-firewall.cfg
33
 FIREWALL_CONFIG=$HOME/${PROJECT_NAME}-firewall.cfg
34
 FIREWALL_DOMAINS=$HOME/${PROJECT_NAME}-firewall-domains.cfg
34
 FIREWALL_DOMAINS=$HOME/${PROJECT_NAME}-firewall-domains.cfg
35
+FIREWALL_EIFACE=eth0
36
+EXTERNAL_IPV4_ADDRESS=
35
 
37
 
36
 function save_firewall_settings {
38
 function save_firewall_settings {
37
     iptables-save > /etc/firewall.conf
39
     iptables-save > /etc/firewall.conf
108
     echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
110
     echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
109
 }
111
 }
110
 
112
 
113
+function firewall_disable_vpn {
114
+    firewall_remove VPN 1194
115
+    iptables -D INPUT -i ${FIREWALL_EIFACE} -m state --state NEW -p tcp --dport 1194 -j ACCEPT
116
+    iptables -D INPUT -i tun+ -j ACCEPT
117
+    iptables -D FORWARD -i tun+ -j ACCEPT
118
+    iptables -D FORWARD -i tun+ -o ${FIREWALL_EIFACE} -m state --state RELATED,ESTABLISHED -j ACCEPT
119
+    iptables -D FORWARD -i ${FIREWALL_EIFACE} -o tun+ -m state --state RELATED,ESTABLISHED -j ACCEPT
120
+    iptables -t nat -D POSTROUTING -s 10.8.0.0/24 -o ${FIREWALL_EIFACE} -j MASQUERADE
121
+    iptables -D OUTPUT -o tun+ -j ACCEPT
122
+    save_firewall_settings
123
+}
124
+
125
+function firewall_enable_vpn {
126
+    firewall_add VPN 1194 tcp
127
+    iptables -A INPUT -i ${FIREWALL_EIFACE} -m state --state NEW -p tcp --dport 1194 -j ACCEPT
128
+    iptables -A INPUT -i tun+ -j ACCEPT
129
+    iptables -A FORWARD -i tun+ -j ACCEPT
130
+    iptables -A FORWARD -i tun+ -o ${FIREWALL_EIFACE} -m state --state RELATED,ESTABLISHED -j ACCEPT
131
+    iptables -A FORWARD -i ${FIREWALL_EIFACE} -o tun+ -m state --state RELATED,ESTABLISHED -j ACCEPT
132
+    iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o ${FIREWALL_EIFACE} -j MASQUERADE
133
+    iptables -A OUTPUT -o tun+ -j ACCEPT
134
+    save_firewall_settings
135
+}
136
+
111
 function configure_firewall {
137
 function configure_firewall {
112
     if [ $INSTALLING_MESH ]; then
138
     if [ $INSTALLING_MESH ]; then
113
         mesh_firewall
139
         mesh_firewall

+ 27
- 2
src/freedombone-utils-network Zobrazit soubor

31
 # If the system is on an IPv6 network
31
 # If the system is on an IPv6 network
32
 IPV6_NETWORK='2001:470:26:307'
32
 IPV6_NETWORK='2001:470:26:307'
33
 
33
 
34
+# Destinations used to get the local IP address of this system
35
+# Google ipv6 DNS   2001:4860:4860::8888
36
+# OpenDNS ipv6 DNS  2620:0:ccc::2
37
+IPV4_ADDRESS_TEST_DESTINATION='85.214.73.63'
38
+IPV6_ADDRESS_TEST_DESTINATION='2620:0:ccc::2'
39
+EXTERNAL_IP_LOOKUP_URL='ifcfg.me'
40
+
34
 # The static IP address of the system within the local network
41
 # The static IP address of the system within the local network
35
 # By default the IP address is dynamic within your LAN
42
 # By default the IP address is dynamic within your LAN
36
 LOCAL_NETWORK_STATIC_IP_ADDRESS=
43
 LOCAL_NETWORK_STATIC_IP_ADDRESS=
64
     mark_completed $FUNCNAME
71
     mark_completed $FUNCNAME
65
 }
72
 }
66
 
73
 
74
+function get_external_ipv4_address {
75
+    nslookup . $EXTERNAL_IP_LOOKUP_URL | grep Address | tail -n 1 | awk -F ' ' '{print $2}'
76
+}
77
+
67
 function get_ipv4_address {
78
 function get_ipv4_address {
68
-    IPv4dev=$(ip route get 8.8.8.8 | awk '{for(i=1;i<=NF;i++)if($i~/dev/)print $(i+1)}')
79
+    IPv4dev=$(ip route get $IPV4_ADDRESS_TEST_DESTINATION | awk '{for(i=1;i<=NF;i++)if($i~/dev/)print $(i+1)}')
69
     echo $(ip -o -f inet addr show dev "$IPv4dev" | awk '{print $4}' | awk 'END {print}' | awk -F '/' '{print $1}')
80
     echo $(ip -o -f inet addr show dev "$IPv4dev" | awk '{print $4}' | awk 'END {print}' | awk -F '/' '{print $1}')
70
 }
81
 }
71
 
82
 
72
 function get_ipv6_address {
83
 function get_ipv6_address {
73
-    echo $(ip -6 route get 2001:4860:4860::8888 | awk -F " " '{ for(i=1;i<=NF;i++) if ($i == "src") print $(i+1) }')
84
+    retval=$(ip -6 route get $IPV6_ADDRESS_TEST_DESTINATION 2> /dev/null)
85
+    echo $(echo "$retval" | awk -F " " '{ for(i=1;i<=NF;i++) if ($i == "src") print $(i+1) }')
86
+}
87
+
88
+function update_external_ip {
89
+    ip_update_script=/usr/bin/externalipupdate
90
+    echo '#!/bin/bash' >> $ip_update_script
91
+    echo "existing_ip=\$(cat $CONFIGURATION_FILE | grep \"EXTERNAL_IPV4_ADDRESS=\" | head -n 1 | awk -F '=' '{print \$2}')'" >> $ip_update_script
92
+    echo "curr_ip=\$(nslookup . $EXTERNAL_IP_LOOKUP_URL | grep Address | tail -n 1 | awk -F ' ' '{print \$2}')" >> $ip_update_script
93
+    echo 'if [[ "$curr_ip" != "$existing_ip" ]]; then' >> $ip_update_script
94
+    echo "  sed -i \"s|EXTERNAL_IPV4_ADDRESS=.*|EXTERNAL_IPV4_ADDRESS=\${curr_ip}|g\" $CONFIGURATION_FILE" >> $ip_update_script
95
+    echo "  echo \"\$(date)\" >> ~/${PROJECT_NAME}-external-ip-changes.txt" >> $ip_update_script
96
+    echo 'fi' >> $ip_update_script
97
+
98
+    cron_add_mins 10 $ip_update_script
74
 }
99
 }
75
 
100
 
76
 # NOTE: deliberately no exit 0
101
 # NOTE: deliberately no exit 0

+ 390
- 0
website/EN/app_vpn.html Zobrazit soubor

1
+<?xml version="1.0" encoding="utf-8"?>
2
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
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">
5
+<head>
6
+<!-- 2017-09-27 Wed 17:58 -->
7
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
8
+<meta name="viewport" content="width=device-width, initial-scale=1" />
9
+<title>&lrm;</title>
10
+<meta name="generator" content="Org mode" />
11
+<meta name="author" content="Bob Mottram" />
12
+<meta name="description" content="How to use OpenVPN on Freedombone"
13
+ />
14
+<meta name="keywords" content="freedombone, openvpn" />
15
+<style type="text/css">
16
+ <!--/*--><![CDATA[/*><!--*/
17
+  .title  { text-align: center;
18
+             margin-bottom: .2em; }
19
+  .subtitle { text-align: center;
20
+              font-size: medium;
21
+              font-weight: bold;
22
+              margin-top:0; }
23
+  .todo   { font-family: monospace; color: red; }
24
+  .done   { font-family: monospace; color: green; }
25
+  .priority { font-family: monospace; color: orange; }
26
+  .tag    { background-color: #eee; font-family: monospace;
27
+            padding: 2px; font-size: 80%; font-weight: normal; }
28
+  .timestamp { color: #bebebe; }
29
+  .timestamp-kwd { color: #5f9ea0; }
30
+  .org-right  { margin-left: auto; margin-right: 0px;  text-align: right; }
31
+  .org-left   { margin-left: 0px;  margin-right: auto; text-align: left; }
32
+  .org-center { margin-left: auto; margin-right: auto; text-align: center; }
33
+  .underline { text-decoration: underline; }
34
+  #postamble p, #preamble p { font-size: 90%; margin: .2em; }
35
+  p.verse { margin-left: 3%; }
36
+  pre {
37
+    border: 1px solid #ccc;
38
+    box-shadow: 3px 3px 3px #eee;
39
+    padding: 8pt;
40
+    font-family: monospace;
41
+    overflow: auto;
42
+    margin: 1.2em;
43
+  }
44
+  pre.src {
45
+    position: relative;
46
+    overflow: visible;
47
+    padding-top: 1.2em;
48
+  }
49
+  pre.src:before {
50
+    display: none;
51
+    position: absolute;
52
+    background-color: white;
53
+    top: -10px;
54
+    right: 10px;
55
+    padding: 3px;
56
+    border: 1px solid black;
57
+  }
58
+  pre.src:hover:before { display: inline;}
59
+  /* Languages per Org manual */
60
+  pre.src-asymptote:before { content: 'Asymptote'; }
61
+  pre.src-awk:before { content: 'Awk'; }
62
+  pre.src-C:before { content: 'C'; }
63
+  /* pre.src-C++ doesn't work in CSS */
64
+  pre.src-clojure:before { content: 'Clojure'; }
65
+  pre.src-css:before { content: 'CSS'; }
66
+  pre.src-D:before { content: 'D'; }
67
+  pre.src-ditaa:before { content: 'ditaa'; }
68
+  pre.src-dot:before { content: 'Graphviz'; }
69
+  pre.src-calc:before { content: 'Emacs Calc'; }
70
+  pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
71
+  pre.src-fortran:before { content: 'Fortran'; }
72
+  pre.src-gnuplot:before { content: 'gnuplot'; }
73
+  pre.src-haskell:before { content: 'Haskell'; }
74
+  pre.src-hledger:before { content: 'hledger'; }
75
+  pre.src-java:before { content: 'Java'; }
76
+  pre.src-js:before { content: 'Javascript'; }
77
+  pre.src-latex:before { content: 'LaTeX'; }
78
+  pre.src-ledger:before { content: 'Ledger'; }
79
+  pre.src-lisp:before { content: 'Lisp'; }
80
+  pre.src-lilypond:before { content: 'Lilypond'; }
81
+  pre.src-lua:before { content: 'Lua'; }
82
+  pre.src-matlab:before { content: 'MATLAB'; }
83
+  pre.src-mscgen:before { content: 'Mscgen'; }
84
+  pre.src-ocaml:before { content: 'Objective Caml'; }
85
+  pre.src-octave:before { content: 'Octave'; }
86
+  pre.src-org:before { content: 'Org mode'; }
87
+  pre.src-oz:before { content: 'OZ'; }
88
+  pre.src-plantuml:before { content: 'Plantuml'; }
89
+  pre.src-processing:before { content: 'Processing.js'; }
90
+  pre.src-python:before { content: 'Python'; }
91
+  pre.src-R:before { content: 'R'; }
92
+  pre.src-ruby:before { content: 'Ruby'; }
93
+  pre.src-sass:before { content: 'Sass'; }
94
+  pre.src-scheme:before { content: 'Scheme'; }
95
+  pre.src-screen:before { content: 'Gnu Screen'; }
96
+  pre.src-sed:before { content: 'Sed'; }
97
+  pre.src-sh:before { content: 'shell'; }
98
+  pre.src-sql:before { content: 'SQL'; }
99
+  pre.src-sqlite:before { content: 'SQLite'; }
100
+  /* additional languages in org.el's org-babel-load-languages alist */
101
+  pre.src-forth:before { content: 'Forth'; }
102
+  pre.src-io:before { content: 'IO'; }
103
+  pre.src-J:before { content: 'J'; }
104
+  pre.src-makefile:before { content: 'Makefile'; }
105
+  pre.src-maxima:before { content: 'Maxima'; }
106
+  pre.src-perl:before { content: 'Perl'; }
107
+  pre.src-picolisp:before { content: 'Pico Lisp'; }
108
+  pre.src-scala:before { content: 'Scala'; }
109
+  pre.src-shell:before { content: 'Shell Script'; }
110
+  pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
111
+  /* additional language identifiers per "defun org-babel-execute"
112
+       in ob-*.el */
113
+  pre.src-cpp:before  { content: 'C++'; }
114
+  pre.src-abc:before  { content: 'ABC'; }
115
+  pre.src-coq:before  { content: 'Coq'; }
116
+  pre.src-groovy:before  { content: 'Groovy'; }
117
+  /* additional language identifiers from org-babel-shell-names in
118
+     ob-shell.el: ob-shell is the only babel language using a lambda to put
119
+     the execution function name together. */
120
+  pre.src-bash:before  { content: 'bash'; }
121
+  pre.src-csh:before  { content: 'csh'; }
122
+  pre.src-ash:before  { content: 'ash'; }
123
+  pre.src-dash:before  { content: 'dash'; }
124
+  pre.src-ksh:before  { content: 'ksh'; }
125
+  pre.src-mksh:before  { content: 'mksh'; }
126
+  pre.src-posh:before  { content: 'posh'; }
127
+  /* Additional Emacs modes also supported by the LaTeX listings package */
128
+  pre.src-ada:before { content: 'Ada'; }
129
+  pre.src-asm:before { content: 'Assembler'; }
130
+  pre.src-caml:before { content: 'Caml'; }
131
+  pre.src-delphi:before { content: 'Delphi'; }
132
+  pre.src-html:before { content: 'HTML'; }
133
+  pre.src-idl:before { content: 'IDL'; }
134
+  pre.src-mercury:before { content: 'Mercury'; }
135
+  pre.src-metapost:before { content: 'MetaPost'; }
136
+  pre.src-modula-2:before { content: 'Modula-2'; }
137
+  pre.src-pascal:before { content: 'Pascal'; }
138
+  pre.src-ps:before { content: 'PostScript'; }
139
+  pre.src-prolog:before { content: 'Prolog'; }
140
+  pre.src-simula:before { content: 'Simula'; }
141
+  pre.src-tcl:before { content: 'tcl'; }
142
+  pre.src-tex:before { content: 'TeX'; }
143
+  pre.src-plain-tex:before { content: 'Plain TeX'; }
144
+  pre.src-verilog:before { content: 'Verilog'; }
145
+  pre.src-vhdl:before { content: 'VHDL'; }
146
+  pre.src-xml:before { content: 'XML'; }
147
+  pre.src-nxml:before { content: 'XML'; }
148
+  /* add a generic configuration mode; LaTeX export needs an additional
149
+     (add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
150
+  pre.src-conf:before { content: 'Configuration File'; }
151
+
152
+  table { border-collapse:collapse; }
153
+  caption.t-above { caption-side: top; }
154
+  caption.t-bottom { caption-side: bottom; }
155
+  td, th { vertical-align:top;  }
156
+  th.org-right  { text-align: center;  }
157
+  th.org-left   { text-align: center;   }
158
+  th.org-center { text-align: center; }
159
+  td.org-right  { text-align: right;  }
160
+  td.org-left   { text-align: left;   }
161
+  td.org-center { text-align: center; }
162
+  dt { font-weight: bold; }
163
+  .footpara { display: inline; }
164
+  .footdef  { margin-bottom: 1em; }
165
+  .figure { padding: 1em; }
166
+  .figure p { text-align: center; }
167
+  .inlinetask {
168
+    padding: 10px;
169
+    border: 2px solid gray;
170
+    margin: 10px;
171
+    background: #ffffcc;
172
+  }
173
+  #org-div-home-and-up
174
+   { text-align: right; font-size: 70%; white-space: nowrap; }
175
+  textarea { overflow-x: auto; }
176
+  .linenr { font-size: smaller }
177
+  .code-highlighted { background-color: #ffff00; }
178
+  .org-info-js_info-navigation { border-style: none; }
179
+  #org-info-js_console-label
180
+    { font-size: 10px; font-weight: bold; white-space: nowrap; }
181
+  .org-info-js_search-highlight
182
+    { background-color: #ffff00; color: #000000; font-weight: bold; }
183
+  .org-svg { width: 90%; }
184
+  /*]]>*/-->
185
+</style>
186
+<link rel="stylesheet" type="text/css" href="freedombone.css" />
187
+<script type="text/javascript">
188
+/*
189
+@licstart  The following is the entire license notice for the
190
+JavaScript code in this tag.
191
+
192
+Copyright (C) 2012-2017 Free Software Foundation, Inc.
193
+
194
+The JavaScript code in this tag is free software: you can
195
+redistribute it and/or modify it under the terms of the GNU
196
+General Public License (GNU GPL) as published by the Free Software
197
+Foundation, either version 3 of the License, or (at your option)
198
+any later version.  The code is distributed WITHOUT ANY WARRANTY;
199
+without even the implied warranty of MERCHANTABILITY or FITNESS
200
+FOR A PARTICULAR PURPOSE.  See the GNU GPL for more details.
201
+
202
+As additional permission under GNU GPL version 3 section 7, you
203
+may distribute non-source (e.g., minimized or compacted) forms of
204
+that code without the copy of the GNU GPL normally required by
205
+section 4, provided you include this license notice and a URL
206
+through which recipients can access the Corresponding Source.
207
+
208
+
209
+@licend  The above is the entire license notice
210
+for the JavaScript code in this tag.
211
+*/
212
+<!--/*--><![CDATA[/*><!--*/
213
+ function CodeHighlightOn(elem, id)
214
+ {
215
+   var target = document.getElementById(id);
216
+   if(null != target) {
217
+     elem.cacheClassElem = elem.className;
218
+     elem.cacheClassTarget = target.className;
219
+     target.className = "code-highlighted";
220
+     elem.className   = "code-highlighted";
221
+   }
222
+ }
223
+ function CodeHighlightOff(elem, id)
224
+ {
225
+   var target = document.getElementById(id);
226
+   if(elem.cacheClassElem)
227
+     elem.className = elem.cacheClassElem;
228
+   if(elem.cacheClassTarget)
229
+     target.className = elem.cacheClassTarget;
230
+ }
231
+/*]]>*///-->
232
+</script>
233
+</head>
234
+<body>
235
+<div id="preamble" class="status">
236
+<a name="top" id="top"></a>
237
+</div>
238
+<div id="content">
239
+<div class="org-center">
240
+
241
+<div class="figure">
242
+<p><img src="images/logo.png" alt="logo.png" />
243
+</p>
244
+</div>
245
+</div>
246
+
247
+<center>
248
+<h1>OpenVPN</h1>
249
+</center>
250
+
251
+<blockquote>
252
+<p>
253
+"<i>The Net interprets censorship as damage and routes around it.</i>" &#x2013; John Gilmore
254
+</p>
255
+</blockquote>
256
+
257
+<p>
258
+A Virtual Private Network (VPN) allows you to move your internet traffic to a different machine in a different geographical location by creating a private cryptographically protected route to that location. The usual use cases are to get around local censorship of the internet such as when you see the message "<i>this content is not available in your area</i>" when trying to play a video. Maybe you're on holiday and your hotel or workplace internet connection is censored. Using a VPN you can connect to your home server and then use the internet normally.
259
+</p>
260
+
261
+<p>
262
+Using a Tor browser is another way to get around censorship, but there might be occasions where you don't want to use a Tor browser or where Tor relays and bridges are blocked or where you want to run internet apps which aren't within a browser.
263
+</p>
264
+
265
+<p>
266
+On Freedombone the VPN is wrapped within a TLS layer of encryption, making it difficult for any deep packet inspection systems to know whether you are using a VPN or not. Since there is lots of TLS traffic on the internet your connection looks like any other TLS connection to a server, and this may help to avoid being censored. It's probably not possible for your local ISP to block TLS traffic without immediately generating a lot of irate customers, and stopping any kind of commercial activity.
267
+</p>
268
+
269
+<div id="outline-container-org778c839" class="outline-2">
270
+<h2 id="org778c839">Installation</h2>
271
+<div class="outline-text-2" id="text-org778c839">
272
+<p>
273
+ssh into the system with:
274
+</p>
275
+
276
+<div class="org-src-container">
277
+<pre class="src src-bash">ssh myusername@mydomainname -p 2222
278
+</pre>
279
+</div>
280
+
281
+<p>
282
+Select <b>Administrator controls</b> then <b>Add/Remove apps</b> then <b>vpn</b>. Choose the port which you want the VPN to operate on and then the install will continue.
283
+</p>
284
+
285
+<p>
286
+Only use ports 443 or 80 for VPN as an <i>absolute last resort</i>, since doing so will prevent other web based apps from running on your server.
287
+</p>
288
+</div>
289
+</div>
290
+
291
+<div id="outline-container-org2cfcc49" class="outline-2">
292
+<h2 id="org2cfcc49">Usage</h2>
293
+<div class="outline-text-2" id="text-org2cfcc49">
294
+<p>
295
+When the installation is complete you can download your VPN keys and configuration files onto your local machine.
296
+</p>
297
+
298
+<div class="org-src-container">
299
+<pre class="src src-bash">scp -P 2222 myusername@mydomainname:/home/myusername/client.ovpn .
300
+scp -P 2222 myusername@mydomainname:/home/myusername/stunnel* .
301
+</pre>
302
+</div>
303
+
304
+<p>
305
+You will need to ensure that the <i>openvpn</i> and <i>stunnel</i> packages are installed. On an Arch based system:
306
+</p>
307
+
308
+<div class="org-src-container">
309
+<pre class="src src-bash">sudp pacman -S openvpn stunnel4
310
+</pre>
311
+</div>
312
+
313
+<p>
314
+Or on a Debian based system:
315
+</p>
316
+
317
+<div class="org-src-container">
318
+<pre class="src src-bash">sudo apt-get install openvpn stunnel4
319
+</pre>
320
+</div>
321
+
322
+<p>
323
+Now you can connect to your VPN with:
324
+</p>
325
+
326
+<div class="org-src-container">
327
+<pre class="src src-bash">sudo stunnel stunnel-client.conf
328
+sudo openvpn client.ovpn
329
+</pre>
330
+</div>
331
+
332
+<p>
333
+You should see a series of messages with "<i>Initialization Sequence Completed</i>" showing at the end. Leave the terminal open and perhaps minimize it to remain connected to the VPN. To leave the VPN close the terminal window.
334
+</p>
335
+</div>
336
+</div>
337
+
338
+<div id="outline-container-orgc7282cd" class="outline-2">
339
+<h2 id="orgc7282cd">Changing port number</h2>
340
+<div class="outline-text-2" id="text-orgc7282cd">
341
+<p>
342
+Avoiding censorship can be a cat and mouse game, and so if the port you're using for VPN gets blocked then you may want to change it.
343
+</p>
344
+
345
+<div class="org-src-container">
346
+<pre class="src src-bash">ssh myusername@mydomainname -p 2222
347
+</pre>
348
+</div>
349
+
350
+<p>
351
+Select <b>Administrator controls</b> then <b>App Settings</b> then <b>vpn</b>. Choose <b>Change TLS port</b> and enter a new port value. You can then either manually change the port within your VPN configuration files, or download them again as described in the <a href="#org2cfcc49">Usage</a> section above.
352
+</p>
353
+</div>
354
+</div>
355
+
356
+<div id="outline-container-orgbe4ddea" class="outline-2">
357
+<h2 id="orgbe4ddea">Generating new keys</h2>
358
+<div class="outline-text-2" id="text-orgbe4ddea">
359
+<p>
360
+It's possible that your VPN keys might get lost or compromised on your local machine. If that happens you can generate new ones from the <b>Administrator controls</b> by going to <b>App Settings</b> then <b>vpn</b> then choosing <b>Regenerate keys for a user</b> and downloading the new keys as described in the <a href="#org2cfcc49">Usage</a> section above.
361
+</p>
362
+</div>
363
+</div>
364
+</div>
365
+<div id="postamble" class="status">
366
+
367
+<style type="text/css">
368
+.back-to-top {
369
+    position: fixed;
370
+    bottom: 2em;
371
+    right: 0px;
372
+    text-decoration: none;
373
+    color: #000000;
374
+    background-color: rgba(235, 235, 235, 0.80);
375
+    font-size: 12px;
376
+    padding: 1em;
377
+    display: none;
378
+}
379
+
380
+.back-to-top:hover {
381
+    background-color: rgba(135, 135, 135, 0.50);
382
+}
383
+</style>
384
+
385
+<div class="back-to-top">
386
+<a href="#top">Back to top</a> | <a href="mailto:bob@freedombone.net">E-mail me</a>
387
+</div>
388
+</div>
389
+</body>
390
+</html>

+ 116
- 104
website/EN/apps.html Zobrazit soubor

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-07-28 Fri 22:42 -->
6
+<!-- 2017-09-27 Wed 17:45 -->
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></title>
9
+<title>&lrm;</title>
10
 <meta name="generator" content="Org mode" />
10
 <meta name="generator" content="Org mode" />
11
 <meta name="author" content="Bob Mottram" />
11
 <meta name="author" content="Bob Mottram" />
12
 <meta name="description" content="List of apps available on freedombone"
12
 <meta name="description" content="List of apps available on freedombone"
264
 </div>
264
 </div>
265
 </div>
265
 </div>
266
 
266
 
267
-<div id="outline-container-orgbe17d63" class="outline-2">
268
-<h2 id="orgbe17d63">CryptPad</h2>
269
-<div class="outline-text-2" id="text-orgbe17d63">
267
+<div id="outline-container-orge12e0d4" class="outline-2">
268
+<h2 id="orge12e0d4">CryptPad</h2>
269
+<div class="outline-text-2" id="text-orge12e0d4">
270
 <p>
270
 <p>
271
 Collaborate on editing documents, presentations and source code, or vote on things. All with a good level of security.
271
 Collaborate on editing documents, presentations and source code, or vote on things. All with a good level of security.
272
 </p>
272
 </p>
276
 </p>
276
 </p>
277
 </div>
277
 </div>
278
 </div>
278
 </div>
279
-<div id="outline-container-orgeb85cd1" class="outline-2">
280
-<h2 id="orgeb85cd1">DLNA</h2>
281
-<div class="outline-text-2" id="text-orgeb85cd1">
279
+<div id="outline-container-orgaaead32" class="outline-2">
280
+<h2 id="orgaaead32">DLNA</h2>
281
+<div class="outline-text-2" id="text-orgaaead32">
282
 <p>
282
 <p>
283
 Enables you to use the system as a music server which any DLNA compatible devices can connect to within your home network.
283
 Enables you to use the system as a music server which any DLNA compatible devices can connect to within your home network.
284
 </p>
284
 </p>
288
 </p>
288
 </p>
289
 </div>
289
 </div>
290
 </div>
290
 </div>
291
-<div id="outline-container-orge7dce56" class="outline-2">
292
-<h2 id="orge7dce56">Dokuwiki</h2>
293
-<div class="outline-text-2" id="text-orge7dce56">
291
+<div id="outline-container-orga0c144d" class="outline-2">
292
+<h2 id="orga0c144d">Dokuwiki</h2>
293
+<div class="outline-text-2" id="text-orga0c144d">
294
 <p>
294
 <p>
295
 A databaseless wiki system.
295
 A databaseless wiki system.
296
 </p>
296
 </p>
300
 </p>
300
 </p>
301
 </div>
301
 </div>
302
 </div>
302
 </div>
303
-<div id="outline-container-org16980fe" class="outline-2">
304
-<h2 id="org16980fe">Emacs</h2>
305
-<div class="outline-text-2" id="text-org16980fe">
303
+<div id="outline-container-orgad65042" class="outline-2">
304
+<h2 id="orgad65042">Emacs</h2>
305
+<div class="outline-text-2" id="text-orgad65042">
306
 <p>
306
 <p>
307
 If you use the Mutt client to read your email then this will set it up to use emacs for composing new mail.
307
 If you use the Mutt client to read your email then this will set it up to use emacs for composing new mail.
308
 </p>
308
 </p>
312
 </p>
312
 </p>
313
 </div>
313
 </div>
314
 </div>
314
 </div>
315
-<div id="outline-container-orge6eede4" class="outline-2">
316
-<h2 id="orge6eede4">Etherpad</h2>
317
-<div class="outline-text-2" id="text-orge6eede4">
315
+<div id="outline-container-org7ba525b" class="outline-2">
316
+<h2 id="org7ba525b">Etherpad</h2>
317
+<div class="outline-text-2" id="text-org7ba525b">
318
 <p>
318
 <p>
319
 Collaborate on creating documents in real time. Maybe you're planning a holiday with other family members or creating documentation for a Free Software project along with other volunteers. Etherpad is hard to beat for simplicity and speed. Only users of the system will be able to access it.
319
 Collaborate on creating documents in real time. Maybe you're planning a holiday with other family members or creating documentation for a Free Software project along with other volunteers. Etherpad is hard to beat for simplicity and speed. Only users of the system will be able to access it.
320
 </p>
320
 </p>
324
 </p>
324
 </p>
325
 </div>
325
 </div>
326
 </div>
326
 </div>
327
-<div id="outline-container-org72aea62" class="outline-2">
328
-<h2 id="org72aea62">Friendica</h2>
329
-<div class="outline-text-2" id="text-org72aea62">
327
+<div id="outline-container-orgb7656a4" class="outline-2">
328
+<h2 id="orgb7656a4">Friendica</h2>
329
+<div class="outline-text-2" id="text-orgb7656a4">
330
 <p>
330
 <p>
331
 Federated social network system.
331
 Federated social network system.
332
 </p>
332
 </p>
336
 </p>
336
 </p>
337
 </div>
337
 </div>
338
 </div>
338
 </div>
339
-<div id="outline-container-org75bbd1d" class="outline-2">
340
-<h2 id="org75bbd1d">Ghost</h2>
341
-<div class="outline-text-2" id="text-org75bbd1d">
339
+<div id="outline-container-org9b12dc6" class="outline-2">
340
+<h2 id="org9b12dc6">Ghost</h2>
341
+<div class="outline-text-2" id="text-org9b12dc6">
342
 <p>
342
 <p>
343
 Modern looking blogging system.
343
 Modern looking blogging system.
344
 </p>
344
 </p>
348
 </p>
348
 </p>
349
 </div>
349
 </div>
350
 </div>
350
 </div>
351
-<div id="outline-container-org879241a" class="outline-2">
352
-<h2 id="org879241a">GNU Social</h2>
353
-<div class="outline-text-2" id="text-org879241a">
351
+<div id="outline-container-org507ecb0" class="outline-2">
352
+<h2 id="org507ecb0">GNU Social</h2>
353
+<div class="outline-text-2" id="text-org507ecb0">
354
 <p>
354
 <p>
355
 Federated social network. You can "<i>remote follow</i>" other users within the GNU Social federation.
355
 Federated social network. You can "<i>remote follow</i>" other users within the GNU Social federation.
356
 </p>
356
 </p>
360
 </p>
360
 </p>
361
 </div>
361
 </div>
362
 </div>
362
 </div>
363
-<div id="outline-container-org0c63c0d" class="outline-2">
364
-<h2 id="org0c63c0d">Gogs</h2>
365
-<div class="outline-text-2" id="text-org0c63c0d">
363
+<div id="outline-container-org8309404" class="outline-2">
364
+<h2 id="org8309404">Gogs</h2>
365
+<div class="outline-text-2" id="text-org8309404">
366
 <p>
366
 <p>
367
 Lightweight git project hosting system. You can mirror projects from Github, or if Github turns evil then just host your own projects while retaining the familiar <i>fork-and-pull</i> workflow. If you can use Github then you can also use Gogs.
367
 Lightweight git project hosting system. You can mirror projects from Github, or if Github turns evil then just host your own projects while retaining the familiar <i>fork-and-pull</i> workflow. If you can use Github then you can also use Gogs.
368
 </p>
368
 </p>
372
 </p>
372
 </p>
373
 </div>
373
 </div>
374
 </div>
374
 </div>
375
-<div id="outline-container-org8d5a195" class="outline-2">
376
-<h2 id="org8d5a195">HTMLy</h2>
377
-<div class="outline-text-2" id="text-org8d5a195">
375
+<div id="outline-container-orgc12018c" class="outline-2">
376
+<h2 id="orgc12018c">HTMLy</h2>
377
+<div class="outline-text-2" id="text-orgc12018c">
378
 <p>
378
 <p>
379
 Databaseless blogging system. Quite simple and with a markdown-like format.
379
 Databaseless blogging system. Quite simple and with a markdown-like format.
380
 </p>
380
 </p>
384
 </p>
384
 </p>
385
 </div>
385
 </div>
386
 </div>
386
 </div>
387
-<div id="outline-container-orgbc0a684" class="outline-2">
388
-<h2 id="orgbc0a684">Hubzilla</h2>
389
-<div class="outline-text-2" id="text-orgbc0a684">
387
+<div id="outline-container-org7c97a23" class="outline-2">
388
+<h2 id="org7c97a23">Hubzilla</h2>
389
+<div class="outline-text-2" id="text-org7c97a23">
390
 <p>
390
 <p>
391
 Web publishing platform with social network like features and good privacy controls so that it's possible to specify who can see which content. Includes photo albums, calendar, wiki and file storage.
391
 Web publishing platform with social network like features and good privacy controls so that it's possible to specify who can see which content. Includes photo albums, calendar, wiki and file storage.
392
 </p>
392
 </p>
396
 </p>
396
 </p>
397
 </div>
397
 </div>
398
 </div>
398
 </div>
399
-<div id="outline-container-org4f18360" class="outline-2">
400
-<h2 id="org4f18360">IRC Server (ngirc)</h2>
401
-<div class="outline-text-2" id="text-org4f18360">
399
+<div id="outline-container-org15dcaac" class="outline-2">
400
+<h2 id="org15dcaac">IRC Server (ngirc)</h2>
401
+<div class="outline-text-2" id="text-org15dcaac">
402
 <p>
402
 <p>
403
 Run your own IRC chat channel which can be secured with a password and accessible via an onion address. A bouncer is included so that you can receive messages sent while you were offline. Works with Hexchat and other popular clients.
403
 Run your own IRC chat channel which can be secured with a password and accessible via an onion address. A bouncer is included so that you can receive messages sent while you were offline. Works with Hexchat and other popular clients.
404
 </p>
404
 </p>
408
 </p>
408
 </p>
409
 </div>
409
 </div>
410
 </div>
410
 </div>
411
-<div id="outline-container-orgc105f39" class="outline-2">
412
-<h2 id="orgc105f39">Jitsi Meet</h2>
413
-<div class="outline-text-2" id="text-orgc105f39">
411
+<div id="outline-container-orga195719" class="outline-2">
412
+<h2 id="orga195719">Jitsi Meet</h2>
413
+<div class="outline-text-2" id="text-orga195719">
414
 <p>
414
 <p>
415
 Experimental WebRTC video conferencing system, similar to Google Hangouts. This may not be fully functional, but is hoped to be in the near future.
415
 Experimental WebRTC video conferencing system, similar to Google Hangouts. This may not be fully functional, but is hoped to be in the near future.
416
 </p>
416
 </p>
417
 </div>
417
 </div>
418
 </div>
418
 </div>
419
 
419
 
420
-<div id="outline-container-org10fbc88" class="outline-2">
421
-<h2 id="org10fbc88">KanBoard</h2>
422
-<div class="outline-text-2" id="text-org10fbc88">
420
+<div id="outline-container-org67269ac" class="outline-2">
421
+<h2 id="org67269ac">KanBoard</h2>
422
+<div class="outline-text-2" id="text-org67269ac">
423
 <p>
423
 <p>
424
 A simple kanban system for managing projects or TODO lists.
424
 A simple kanban system for managing projects or TODO lists.
425
 </p>
425
 </p>
429
 </p>
429
 </p>
430
 </div>
430
 </div>
431
 </div>
431
 </div>
432
-<div id="outline-container-orgb3097e7" class="outline-2">
433
-<h2 id="orgb3097e7">Key Server</h2>
434
-<div class="outline-text-2" id="text-orgb3097e7">
432
+<div id="outline-container-org5db580b" class="outline-2">
433
+<h2 id="org5db580b">Key Server</h2>
434
+<div class="outline-text-2" id="text-org5db580b">
435
 <p>
435
 <p>
436
 An OpenPGP key server for storing and retrieving GPG public keys.
436
 An OpenPGP key server for storing and retrieving GPG public keys.
437
 </p>
437
 </p>
441
 </p>
441
 </p>
442
 </div>
442
 </div>
443
 </div>
443
 </div>
444
-<div id="outline-container-orga3542ee" class="outline-2">
445
-<h2 id="orga3542ee">Koel</h2>
446
-<div class="outline-text-2" id="text-orga3542ee">
444
+<div id="outline-container-org6675f8f" class="outline-2">
445
+<h2 id="org6675f8f">Koel</h2>
446
+<div class="outline-text-2" id="text-org6675f8f">
447
 <p>
447
 <p>
448
 Access your music collection from any internet connected device.
448
 Access your music collection from any internet connected device.
449
 </p>
449
 </p>
453
 </p>
453
 </p>
454
 </div>
454
 </div>
455
 </div>
455
 </div>
456
-<div id="outline-container-orga662c8f" class="outline-2">
457
-<h2 id="orga662c8f">Lychee</h2>
458
-<div class="outline-text-2" id="text-orga662c8f">
456
+<div id="outline-container-orgdfd8572" class="outline-2">
457
+<h2 id="orgdfd8572">Lychee</h2>
458
+<div class="outline-text-2" id="text-orgdfd8572">
459
 <p>
459
 <p>
460
 Make your photo albums available on the web.
460
 Make your photo albums available on the web.
461
 </p>
461
 </p>
465
 </p>
465
 </p>
466
 </div>
466
 </div>
467
 </div>
467
 </div>
468
-<div id="outline-container-orgccf23ee" class="outline-2">
469
-<h2 id="orgccf23ee">Mailpile</h2>
470
-<div class="outline-text-2" id="text-orgccf23ee">
468
+<div id="outline-container-org5f70509" class="outline-2">
469
+<h2 id="org5f70509">Mailpile</h2>
470
+<div class="outline-text-2" id="text-org5f70509">
471
 <p>
471
 <p>
472
 Modern email client which supports GPG encryption.
472
 Modern email client which supports GPG encryption.
473
 </p>
473
 </p>
477
 </p>
477
 </p>
478
 </div>
478
 </div>
479
 </div>
479
 </div>
480
-<div id="outline-container-orgdee374a" class="outline-2">
481
-<h2 id="orgdee374a">Matrix</h2>
482
-<div class="outline-text-2" id="text-orgdee374a">
480
+<div id="outline-container-orgacaf2b5" class="outline-2">
481
+<h2 id="orgacaf2b5">Matrix</h2>
482
+<div class="outline-text-2" id="text-orgacaf2b5">
483
 <p>
483
 <p>
484
 Multi-user chat with some security and moderation controls.
484
 Multi-user chat with some security and moderation controls.
485
 </p>
485
 </p>
489
 </p>
489
 </p>
490
 </div>
490
 </div>
491
 </div>
491
 </div>
492
-<div id="outline-container-org7faaca0" class="outline-2">
493
-<h2 id="org7faaca0">Mediagoblin</h2>
494
-<div class="outline-text-2" id="text-org7faaca0">
492
+<div id="outline-container-org4c6673d" class="outline-2">
493
+<h2 id="org4c6673d">Mediagoblin</h2>
494
+<div class="outline-text-2" id="text-org4c6673d">
495
 <p>
495
 <p>
496
 Publicly host video and audio files so that you don't need to use YouTube/Vimeo/etc.
496
 Publicly host video and audio files so that you don't need to use YouTube/Vimeo/etc.
497
 </p>
497
 </p>
501
 </p>
501
 </p>
502
 </div>
502
 </div>
503
 </div>
503
 </div>
504
-<div id="outline-container-orgfa87291" class="outline-2">
505
-<h2 id="orgfa87291">Mumble</h2>
506
-<div class="outline-text-2" id="text-orgfa87291">
504
+<div id="outline-container-org5778590" class="outline-2">
505
+<h2 id="org5778590">Mumble</h2>
506
+<div class="outline-text-2" id="text-org5778590">
507
 <p>
507
 <p>
508
 The popular VoIP and text chat system. Say goodbye to old-fashioned telephony conferences with silly dial codes. Also works well on mobile.
508
 The popular VoIP and text chat system. Say goodbye to old-fashioned telephony conferences with silly dial codes. Also works well on mobile.
509
 </p>
509
 </p>
513
 </p>
513
 </p>
514
 </div>
514
 </div>
515
 </div>
515
 </div>
516
-<div id="outline-container-org88bc444" class="outline-2">
517
-<h2 id="org88bc444">NextCloud</h2>
518
-<div class="outline-text-2" id="text-org88bc444">
516
+<div id="outline-container-orgbecac51" class="outline-2">
517
+<h2 id="orgbecac51">NextCloud</h2>
518
+<div class="outline-text-2" id="text-orgbecac51">
519
 <p>
519
 <p>
520
 Store files on your server and sync them with laptops or mobile devices. Includes many plugins including videoconferencing and collaborative document editing.
520
 Store files on your server and sync them with laptops or mobile devices. Includes many plugins including videoconferencing and collaborative document editing.
521
 </p>
521
 </p>
525
 </p>
525
 </p>
526
 </div>
526
 </div>
527
 </div>
527
 </div>
528
-<div id="outline-container-orgd909087" class="outline-2">
529
-<h2 id="orgd909087">PI-Hole</h2>
530
-<div class="outline-text-2" id="text-orgd909087">
528
+<div id="outline-container-org4e52617" class="outline-2">
529
+<h2 id="org4e52617">PI-Hole</h2>
530
+<div class="outline-text-2" id="text-org4e52617">
531
 <p>
531
 <p>
532
 The black hole for web adverts. Block adverts at the domain name level within your local network. It can significantly reduce bandwidth, speed up page load times and protect your systems from being tracked by spyware.
532
 The black hole for web adverts. Block adverts at the domain name level within your local network. It can significantly reduce bandwidth, speed up page load times and protect your systems from being tracked by spyware.
533
 </p>
533
 </p>
537
 </p>
537
 </p>
538
 </div>
538
 </div>
539
 </div>
539
 </div>
540
-<div id="outline-container-org54cc393" class="outline-2">
541
-<h2 id="org54cc393">PostActiv</h2>
542
-<div class="outline-text-2" id="text-org54cc393">
540
+<div id="outline-container-org77c5c76" class="outline-2">
541
+<h2 id="org77c5c76">PostActiv</h2>
542
+<div class="outline-text-2" id="text-org77c5c76">
543
 <p>
543
 <p>
544
 An alternative federated social networking system compatible with GNU Social. It includes some optimisations and fixes currently not available within the main GNU Social project.
544
 An alternative federated social networking system compatible with GNU Social. It includes some optimisations and fixes currently not available within the main GNU Social project.
545
 </p>
545
 </p>
549
 </p>
549
 </p>
550
 </div>
550
 </div>
551
 </div>
551
 </div>
552
-<div id="outline-container-orgbf4385b" class="outline-2">
553
-<h2 id="orgbf4385b">Profanity</h2>
554
-<div class="outline-text-2" id="text-orgbf4385b">
552
+<div id="outline-container-org0bf6985" class="outline-2">
553
+<h2 id="org0bf6985">Profanity</h2>
554
+<div class="outline-text-2" id="text-org0bf6985">
555
 <p>
555
 <p>
556
 A shell based XMPP client which you can run on the Freedombone server via ssh.
556
 A shell based XMPP client which you can run on the Freedombone server via ssh.
557
 </p>
557
 </p>
561
 </p>
561
 </p>
562
 </div>
562
 </div>
563
 </div>
563
 </div>
564
-<div id="outline-container-orgda318c9" class="outline-2">
565
-<h2 id="orgda318c9">Riot Web</h2>
566
-<div class="outline-text-2" id="text-orgda318c9">
564
+<div id="outline-container-org3a8644d" class="outline-2">
565
+<h2 id="org3a8644d">Riot Web</h2>
566
+<div class="outline-text-2" id="text-org3a8644d">
567
 <p>
567
 <p>
568
 A browser based user interface for the Matrix federated communications system, including WebRTC audio and video chat.
568
 A browser based user interface for the Matrix federated communications system, including WebRTC audio and video chat.
569
 </p>
569
 </p>
573
 </p>
573
 </p>
574
 </div>
574
 </div>
575
 </div>
575
 </div>
576
-<div id="outline-container-org99449d0" class="outline-2">
577
-<h2 id="org99449d0">SearX</h2>
578
-<div class="outline-text-2" id="text-org99449d0">
576
+<div id="outline-container-org072b2ee" class="outline-2">
577
+<h2 id="org072b2ee">SearX</h2>
578
+<div class="outline-text-2" id="text-org072b2ee">
579
 <p>
579
 <p>
580
 A metasearch engine for customised and private web searches.
580
 A metasearch engine for customised and private web searches.
581
 </p>
581
 </p>
585
 </p>
585
 </p>
586
 </div>
586
 </div>
587
 </div>
587
 </div>
588
-<div id="outline-container-org761a652" class="outline-2">
589
-<h2 id="org761a652">tt-rss</h2>
590
-<div class="outline-text-2" id="text-org761a652">
588
+<div id="outline-container-orge6d7a97" class="outline-2">
589
+<h2 id="orge6d7a97">tt-rss</h2>
590
+<div class="outline-text-2" id="text-orge6d7a97">
591
 <p>
591
 <p>
592
 Private RSS reader. Pulls in RSS/Atom feeds via Tor and is only accessible via an onion address. Have "<i>the right to read</i>" without the Surveillance State knowing what you're reading. Also available with a user interface suitable for viewing on mobile devices via a browser such as OrFox.
592
 Private RSS reader. Pulls in RSS/Atom feeds via Tor and is only accessible via an onion address. Have "<i>the right to read</i>" without the Surveillance State knowing what you're reading. Also available with a user interface suitable for viewing on mobile devices via a browser such as OrFox.
593
 </p>
593
 </p>
597
 </p>
597
 </p>
598
 </div>
598
 </div>
599
 </div>
599
 </div>
600
-<div id="outline-container-orga6e23d7" class="outline-2">
601
-<h2 id="orga6e23d7">Syncthing</h2>
602
-<div class="outline-text-2" id="text-orga6e23d7">
600
+<div id="outline-container-orgb533fa3" class="outline-2">
601
+<h2 id="orgb533fa3">Syncthing</h2>
602
+<div class="outline-text-2" id="text-orgb533fa3">
603
 <p>
603
 <p>
604
 Possibly the best way to synchronise files across all of your devices. Once it has been set up it "just works" with no user intervention needed.
604
 Possibly the best way to synchronise files across all of your devices. Once it has been set up it "just works" with no user intervention needed.
605
 </p>
605
 </p>
609
 </p>
609
 </p>
610
 </div>
610
 </div>
611
 </div>
611
 </div>
612
-<div id="outline-container-org643b86b" class="outline-2">
613
-<h2 id="org643b86b">Tahoe-LAFS</h2>
614
-<div class="outline-text-2" id="text-org643b86b">
612
+<div id="outline-container-orgae3276a" class="outline-2">
613
+<h2 id="orgae3276a">Tahoe-LAFS</h2>
614
+<div class="outline-text-2" id="text-orgae3276a">
615
 <p>
615
 <p>
616
 Robust and encrypted storage of files on one or more server.
616
 Robust and encrypted storage of files on one or more server.
617
 </p>
617
 </p>
621
 </p>
621
 </p>
622
 </div>
622
 </div>
623
 </div>
623
 </div>
624
-<div id="outline-container-org8eb9d12" class="outline-2">
625
-<h2 id="org8eb9d12">Tox</h2>
626
-<div class="outline-text-2" id="text-org8eb9d12">
624
+<div id="outline-container-orga445624" class="outline-2">
625
+<h2 id="orga445624">Tox</h2>
626
+<div class="outline-text-2" id="text-orga445624">
627
 <p>
627
 <p>
628
 Client and bootstrap node for the Tox chat/VoIP system.
628
 Client and bootstrap node for the Tox chat/VoIP system.
629
 </p>
629
 </p>
633
 </p>
633
 </p>
634
 </div>
634
 </div>
635
 </div>
635
 </div>
636
-<div id="outline-container-org5a0e4e5" class="outline-2">
637
-<h2 id="org5a0e4e5">Turtl</h2>
638
-<div class="outline-text-2" id="text-org5a0e4e5">
636
+<div id="outline-container-org176644c" class="outline-2">
637
+<h2 id="org176644c">Turtl</h2>
638
+<div class="outline-text-2" id="text-org176644c">
639
 <p>
639
 <p>
640
 A system for privately creating and sharing notes and images, similar to Evernote but without the spying.
640
 A system for privately creating and sharing notes and images, similar to Evernote but without the spying.
641
 </p>
641
 </p>
645
 </p>
645
 </p>
646
 </div>
646
 </div>
647
 </div>
647
 </div>
648
-<div id="outline-container-orgdeeab5b" class="outline-2">
649
-<h2 id="orgdeeab5b">Vim</h2>
650
-<div class="outline-text-2" id="text-orgdeeab5b">
648
+<div id="outline-container-org8d3d9ed" class="outline-2">
649
+<h2 id="org8d3d9ed">Vim</h2>
650
+<div class="outline-text-2" id="text-org8d3d9ed">
651
 <p>
651
 <p>
652
 If you use the Mutt client to read your email then this will set it up to use vim for composing new mail.
652
 If you use the Mutt client to read your email then this will set it up to use vim for composing new mail.
653
 </p>
653
 </p>
654
 </div>
654
 </div>
655
 </div>
655
 </div>
656
 
656
 
657
-<div id="outline-container-orgdbd802c" class="outline-2">
658
-<h2 id="orgdbd802c">XMPP</h2>
659
-<div class="outline-text-2" id="text-orgdbd802c">
657
+<div id="outline-container-orgbab78c1" class="outline-2">
658
+<h2 id="orgbab78c1">Virtual Private Network (VPN)</h2>
659
+<div class="outline-text-2" id="text-orgbab78c1">
660
+<p>
661
+Set up a VPN on your server so that you can bypass local internet censorship.
662
+</p>
663
+
664
+<p>
665
+<a href="./app_vpn.html">How to use it</a>
666
+</p>
667
+</div>
668
+</div>
669
+<div id="outline-container-org76fcabc" class="outline-2">
670
+<h2 id="org76fcabc">XMPP</h2>
671
+<div class="outline-text-2" id="text-org76fcabc">
660
 <p>
672
 <p>
661
 Chat server which can be used together with client such as Gajim or Conversations to provide end-to-end content security and also onion routed metadata security. Includes advanced features such as <i>client state notification</i> to save battery power on your mobile devices, support for seamless roaming between networks and <i>message carbons</i> so that you can receive the same messages while being simultaneously logged in to your account on more than one device.
673
 Chat server which can be used together with client such as Gajim or Conversations to provide end-to-end content security and also onion routed metadata security. Includes advanced features such as <i>client state notification</i> to save battery power on your mobile devices, support for seamless roaming between networks and <i>message carbons</i> so that you can receive the same messages while being simultaneously logged in to your account on more than one device.
662
 </p>
674
 </p>