浏览代码

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

Bob Mottram 8 年前
父节点
当前提交
85757ed3ed

+ 18
- 6
doc/EN/app_pihole.org 查看文件

@@ -32,21 +32,33 @@ When that's done select *About this system* from the control panel and see the I
32 32
 
33 33
 * On each client system within your local network
34 34
 
35
+Make sure that you add the static IP address for the server to */etc/hosts*.
36
+
35 37
 #+begin_src bash
36
-sudo chattr -i /etc/resolv.conf
37
-sudo nano /etc/resolv.conf
38
+STATIC_IP=[your server static IP]
39
+sudo echo "$STATIC_IP [your domain name]" >> /etc/hosts
38 40
 #+end_src
39 41
 
40
-Comment out any existing entries with a # character and add:
42
+On Arch/Parabola:
41 43
 
42 44
 #+begin_src bash
43
-nameserver [IPv4 address from the About screen]
45
+sudo pacman -S openresolv
46
+sudo sed -i "s|#name_servers=.*|name_servers=$STATIC_IP|g" /etc/resolvconf.conf
47
+sudo sed -i "s|name_servers=.*|name_servers=$STATIC_IP|g" /etc/resolvconf.conf
48
+sudo chattr -i /etc/resolv.conf
49
+sudo resolvconf -u
44 50
 #+end_src
45 51
 
46
-Normally /resolv.conf/ will be overwritten every time your reboot, but you can prevent this with:
52
+Or on a Debian based system:
47 53
 
48 54
 #+begin_src bash
49
-sudo chattr +i /etc/resolv.conf
55
+sudo apt-get install resolvconf
56
+echo 'domain localdomain' > /tmp/resolvconf
57
+echo 'search localdomain' >> /tmp/resolvconf
58
+echo "nameserver $STATIC_IP" >> /tmp/resolvconf
59
+sudo mv /tmp/resolvconf /etc/resolvconf/resolv.conf.d/head
60
+sudo chattr -i /etc/resolv.conf
61
+sudo resolvconf -u
50 62
 #+end_src
51 63
 
52 64
 * On your internet router

+ 21
- 1
src/freedombone-app-cryptpad 查看文件

@@ -37,7 +37,7 @@ SHOW_ICANN_ADDRESS_ON_ABOUT=0
37 37
 CRYPTPAD_ONION_PORT=8119
38 38
 CRYPTPAD_PORT=9003
39 39
 CRYPTPAD_REPO="https://github.com/xwiki-labs/cryptpad"
40
-CRYPTPAD_COMMIT='0b69973c179efc6f770a1127f07f67de3d6724d1'
40
+CRYPTPAD_COMMIT='52d344c3d1404d75d2bf4ae8845e5c024e85ec7f'
41 41
 CRYPTPAD_DIR=/etc/cryptpad
42 42
 
43 43
 cryptpad_variables=(ONION_ONLY)
@@ -283,6 +283,26 @@ function install_cryptpad_main {
283 283
     echo '    try_files $uri =404;' >> $cryptpad_nginx_site
284 284
     echo '  }' >> $cryptpad_nginx_site
285 285
     echo '' >> $cryptpad_nginx_site
286
+    echo '  location ^~ /login/ {' >> $cryptpad_nginx_site
287
+    echo '    try_files $uri =404;' >> $cryptpad_nginx_site
288
+    echo '  }' >> $cryptpad_nginx_site
289
+    echo '' >> $cryptpad_nginx_site
290
+    echo '  location ^~ /about.html {' >> $cryptpad_nginx_site
291
+    echo '    try_files $uri =404;' >> $cryptpad_nginx_site
292
+    echo '  }' >> $cryptpad_nginx_site
293
+    echo '' >> $cryptpad_nginx_site
294
+    echo '  location ^~ /contact.html {' >> $cryptpad_nginx_site
295
+    echo '    try_files $uri =404;' >> $cryptpad_nginx_site
296
+    echo '  }' >> $cryptpad_nginx_site
297
+    echo '' >> $cryptpad_nginx_site
298
+    echo '  location ^~ /contact.html {' >> $cryptpad_nginx_site
299
+    echo '    try_files $uri =404;' >> $cryptpad_nginx_site
300
+    echo '  }' >> $cryptpad_nginx_site
301
+    echo '' >> $cryptpad_nginx_site
302
+    echo '  location ^~ /what-is-cryptpad.html {' >> $cryptpad_nginx_site
303
+    echo '    try_files $uri =404;' >> $cryptpad_nginx_site
304
+    echo '  }' >> $cryptpad_nginx_site
305
+    echo '' >> $cryptpad_nginx_site
286 306
     echo '  location ~ ^/(register|login|settings|user|pad|drive|poll|slide|code|whiteboard|file|media)$ {' >> $cryptpad_nginx_site
287 307
     echo '    rewrite ^(.*)$ $1/ redirect;' >> $cryptpad_nginx_site
288 308
     echo '  }' >> $cryptpad_nginx_site

+ 11
- 0
src/freedombone-app-ghost 查看文件

@@ -34,6 +34,7 @@ VARIANTS="full full-vim writer"
34 34
 IN_DEFAULT_INSTALL=0
35 35
 SHOW_ON_ABOUT=1
36 36
 
37
+GHOST_VERSION=1.6.2
37 38
 GHOST_DOMAIN_NAME=
38 39
 GHOST_CODE=
39 40
 GHOST_ONION_PORT=8104
@@ -53,6 +54,9 @@ function ghost_bust {
53 54
 
54 55
     kill_pid=$(ps aux | grep "ghost" | awk -F ' ' '{print $2}' | head -n 1)
55 56
     kill -9 $kill_pid
57
+
58
+    kill_pid=$(ps aux | grep "ghost" | awk -F ' ' '{print $2}' | head -n 1)
59
+    kill -9 $kill_pid
56 60
 }
57 61
 
58 62
 function logging_on_ghost {
@@ -188,6 +192,11 @@ function reconfigure_ghost {
188 192
 }
189 193
 
190 194
 function upgrade_ghost {
195
+    CURR_GHOST_VERSION=$(get_completion_param "ghost version")
196
+    if [[ "${CURR_GHOST_VERSION}" == "${GHOST_VERSION}" ]]; then
197
+        return
198
+    fi
199
+
191 200
     read_config_param GHOST_DOMAIN_NAME
192 201
 
193 202
     if [ ! -d /var/www/$GHOST_DOMAIN_NAME/htdocs ]; then
@@ -195,6 +204,7 @@ function upgrade_ghost {
195 204
     fi
196 205
 
197 206
     systemctl stop ghost
207
+    ghost_bust
198 208
 
199 209
     cd /var/www/$GHOST_DOMAIN_NAME/htdocs
200 210
 
@@ -209,6 +219,7 @@ function upgrade_ghost {
209 219
     chown -R root:root /usr/local/lib
210 220
     chown -R ghost: /var/www/${GHOST_DOMAIN_NAME}/htdocs
211 221
     systemctl restart ghost
222
+    sed -i "s|ghost version.*|ghost version:${GHOST_VERSION}|g" ${COMPLETION_FILE}
212 223
 }
213 224
 
214 225
 function backup_local_ghost {

+ 1
- 1
src/freedombone-app-gnusocial 查看文件

@@ -37,7 +37,7 @@ GNUSOCIAL_DOMAIN_NAME=
37 37
 GNUSOCIAL_CODE=
38 38
 GNUSOCIAL_ONION_PORT=8087
39 39
 GNUSOCIAL_REPO="https://git.gnu.io/gnu/gnu-social.git"
40
-GNUSOCIAL_COMMIT='05a9c11c476b384e5ef3f3cc83b66406fcf7a378'
40
+GNUSOCIAL_COMMIT='d61375cb7fd9e3ac2dbba2b22d0d6461fb753892'
41 41
 GNUSOCIAL_ADMIN_PASSWORD=
42 42
 
43 43
 GNUSOCIAL_BACKGROUND_IMAGE_URL=

+ 5
- 7
src/freedombone-app-matrix 查看文件

@@ -312,18 +312,16 @@ function remove_user_matrix {
312 312
 function add_user_matrix {
313 313
     new_username="$1"
314 314
     new_user_password="$2"
315
-    is_admin_user='-a'
316 315
 
317
-    if [[ "$new_username" != "$MY_USERNAME" ]]; then
318
-        is_admin_user=''
319
-    fi
316
+    read_config_param MY_USERNAME
317
+    read_config_param MATRIX_DOMAIN_NAME
320 318
 
321 319
     ${PROJECT_NAME}-pass -u $new_username -a matrix -p "$new_user_password"
322 320
 
323
-    if [[ $ONION_ONLY == 'no' ]]; then
324
-        retval=$(register_new_matrix_user -c ${MATRIX_DATA_DIR}/homeserver.yaml -u "${new_username}" -p "${new_user_password}" $is_admin_user https://${MATRIX_DOMAIN_NAME})
321
+    if [[ "$new_username" != "$MY_USERNAME" ]]; then
322
+        echo 'no' | register_new_matrix_user -c ${MATRIX_DATA_DIR}/homeserver.yaml -u "${new_username}" -p "${new_user_password}" http://localhost:${MATRIX_PORT}
325 323
     else
326
-        retval=$(register_new_matrix_user -c ${MATRIX_DATA_DIR}/homeserver.yaml -u "${new_username}" -p "${new_user_password}" $is_admin_user http://${MATRIX_DOMAIN_NAME})
324
+        echo 'yes' | register_new_matrix_user -c ${MATRIX_DATA_DIR}/homeserver.yaml -u "${new_username}" -p "${new_user_password}" -a http://localhost:${MATRIX_PORT}
327 325
     fi
328 326
     echo "0"
329 327
 }

+ 1
- 1
src/freedombone-app-pihole 查看文件

@@ -47,7 +47,7 @@ PIHOLE_BLACKLIST=$piholeDir/blacklist.txt
47 47
 PIHOLE_WHITELIST=$piholeDir/whitelist.txt
48 48
 
49 49
 PIHOLE_REPO="https://github.com/pi-hole/pi-hole"
50
-PIHOLE_COMMIT='bef0a2fef08b39780610b8885407b855edd3ba49'
50
+PIHOLE_COMMIT='2ceeac41fe8e493f9040b54a7c82f1183ecf5566'
51 51
 
52 52
 pihole_variables=(ONION_ONLY
53 53
                   PIHOLE_IFACE

+ 3
- 1
src/freedombone-utils-gnusocialtools 查看文件

@@ -33,7 +33,7 @@ QVITTER_THEME_REPO="https://git.postactiv.com/bob/Qvitter"
33 33
 QVITTER_THEME_COMMIT='b5791cf935a6391c492cefa1ffa50cc3cea44c12'
34 34
 
35 35
 PLEROMA_REPO="https://gitgud.io/lambadalambda/pleroma-fe"
36
-PLEROMA_COMMIT='7d59051fc5e93585d8d9858ac989d9ebf7aa3cf9'
36
+PLEROMA_COMMIT='cbe652f2d94d81fa54a37378b7ff014c4391ca5e'
37 37
 
38 38
 ARMADILLO_REPO="https://git.postactiv.com/maiya/Armadillo"
39 39
 ARMADILLO_COMMIT='ec3938a678f373156c4cbf37926c9a5ab68222c4'
@@ -409,6 +409,7 @@ function install_pleroma_front_end {
409 409
     npm install -g eslint-plugin-promise@3.5.0
410 410
     npm install -g moment@2.18.1
411 411
     npm install -g node-sass@4.5.2
412
+    npm install -g whatwg-fetch@2.0.3
412 413
     yarn
413 414
     if [ -f $INSTALL_DIR/pleroma/dist/index.html ]; then
414 415
         rm -rf $INSTALL_DIR/pleroma/dist/*
@@ -452,6 +453,7 @@ function upgrade_pleroma {
452 453
     if [ -d $INSTALL_DIR/pleroma ]; then
453 454
         set_repo_commit $INSTALL_DIR/pleroma "${app_name} pleroma commit" "$PLEROMA_COMMIT" $PLEROMA_REPO
454 455
         cd $INSTALL_DIR/pleroma
456
+        yarn
455 457
         npm run build
456 458
         if [ ! -d $INSTALL_DIR/pleroma/dist ]; then
457 459
             echo 'Unable to build pleroma'

+ 41
- 26
website/EN/app_pihole.html 查看文件

@@ -3,7 +3,7 @@
3 3
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4 4
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
5 5
 <head>
6
-<!-- 2016-11-12 Sat 23:53 -->
6
+<!-- 2017-08-22 Tue 10:50 -->
7 7
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
8 8
 <meta name="viewport" content="width=device-width, initial-scale=1" />
9 9
 <title></title>
@@ -71,6 +71,7 @@
71 71
   pre.src-fortran:before { content: 'Fortran'; }
72 72
   pre.src-gnuplot:before { content: 'gnuplot'; }
73 73
   pre.src-haskell:before { content: 'Haskell'; }
74
+  pre.src-hledger:before { content: 'hledger'; }
74 75
   pre.src-java:before { content: 'Java'; }
75 76
   pre.src-js:before { content: 'Javascript'; }
76 77
   pre.src-latex:before { content: 'LaTeX'; }
@@ -188,7 +189,7 @@
188 189
 @licstart  The following is the entire license notice for the
189 190
 JavaScript code in this tag.
190 191
 
191
-Copyright (C) 2012-2013 Free Software Foundation, Inc.
192
+Copyright (C) 2012-2017 Free Software Foundation, Inc.
192 193
 
193 194
 The JavaScript code in this tag is free software: you can
194 195
 redistribute it and/or modify it under the terms of the GNU
@@ -263,9 +264,9 @@ You can block ads for any devices connected to your local network by installing
263 264
 Also don't expect perfection. Though many ads may be blocked by this system some will still get through. It's a constant cat and mouse game between advertisers and blockers.
264 265
 </p>
265 266
 
266
-<div id="outline-container-org28ca84b" class="outline-2">
267
-<h2 id="org28ca84b">Set a static IP address</h2>
268
-<div class="outline-text-2" id="text-org28ca84b">
267
+<div id="outline-container-org4f58654" class="outline-2">
268
+<h2 id="org4f58654">Set a static IP address</h2>
269
+<div class="outline-text-2" id="text-org4f58654">
269 270
 <p>
270 271
 Ensure that your system has a static local IP address (typically 192.168..) using the option on the control panel. You will also need to know the IP address of your internet router, which is usually <b>192.168.1.1</b> or <b>192.168.1.254</b>.
271 272
 </p>
@@ -276,38 +277,52 @@ When that's done select <b>About this system</b> from the control panel and see
276 277
 </div>
277 278
 </div>
278 279
 
279
-<div id="outline-container-org8d14e27" class="outline-2">
280
-<h2 id="org8d14e27">On each client system within your local network</h2>
281
-<div class="outline-text-2" id="text-org8d14e27">
280
+<div id="outline-container-orgc2fe39b" class="outline-2">
281
+<h2 id="orgc2fe39b">On each client system within your local network</h2>
282
+<div class="outline-text-2" id="text-orgc2fe39b">
283
+<p>
284
+Make sure that you add the static IP address for the server to <b>/etc/hosts</b>.
285
+</p>
286
+
282 287
 <div class="org-src-container">
283
-<pre class="src src-bash">sudo chattr -i /etc/resolv.conf
284
-sudo nano /etc/resolv.conf
285
-</pre>
288
+<pre><code class="src src-bash"><span class="org-variable-name">STATIC_IP</span>=[your server static IP]
289
+sudo echo <span class="org-string">"$STATIC_IP [your domain name]"</span> &gt;&gt; /etc/hosts
290
+</code></pre>
286 291
 </div>
287 292
 
288 293
 <p>
289
-Comment out any existing entries with a # character and add:
294
+On Arch/Parabola:
290 295
 </p>
291 296
 
292 297
 <div class="org-src-container">
293
-<pre class="src src-bash">nameserver [IPv4 address from the About screen]
294
-</pre>
298
+<pre><code class="src src-bash">sudo pacman -S openresolv
299
+sudo sed -i <span class="org-string">"s|#name_servers=.*|name_servers=$STATIC_IP|g"</span> /etc/resolvconf.conf
300
+sudo sed -i <span class="org-string">"s|name_servers=.*|name_servers=$STATIC_IP|g"</span> /etc/resolvconf.conf
301
+sudo chattr -i /etc/resolv.conf
302
+sudo resolvconf -u
303
+</code></pre>
295 304
 </div>
296 305
 
297 306
 <p>
298
-Normally <i>resolv.conf</i> will be overwritten every time your reboot, but you can prevent this with:
307
+Or on a Debian based system:
299 308
 </p>
300 309
 
301 310
 <div class="org-src-container">
302
-<pre class="src src-bash">sudo chattr +i /etc/resolv.conf
303
-</pre>
311
+<pre><code class="src src-bash">sudo apt-get install resolvconf
312
+<span class="org-builtin">echo</span> <span class="org-string">'domain localdomain'</span> &gt; /tmp/resolvconf
313
+<span class="org-builtin">echo</span> <span class="org-string">'search localdomain'</span> &gt;&gt; /tmp/resolvconf
314
+<span class="org-builtin">echo</span> <span class="org-string">"nameserver $STATIC_IP"</span> &gt;&gt; /tmp/resolvconf
315
+sudo mv /tmp/resolvconf /etc/resolvconf/resolv.conf.d/head
316
+sudo chattr -i /etc/resolv.conf
317
+sudo resolvconf -u
318
+</code></pre>
304 319
 </div>
305 320
 </div>
306 321
 </div>
307 322
 
308
-<div id="outline-container-orgb95e44f" class="outline-2">
309
-<h2 id="orgb95e44f">On your internet router</h2>
310
-<div class="outline-text-2" id="text-orgb95e44f">
323
+<div id="outline-container-org3124632" class="outline-2">
324
+<h2 id="org3124632">On your internet router</h2>
325
+<div class="outline-text-2" id="text-org3124632">
311 326
 <p>
312 327
 If you can access the settings on your local internet router then this is the simplest way to provide ad blocking for all devices which connect to it. Unfortunately some router models don't let you edit the DNS settings and if that's the case you might want to consider getting a different router.
313 328
 </p>
@@ -317,9 +332,9 @@ Edit the DNS settings and add the IPv4 address which you got from the control pa
317 332
 </p>
318 333
 </div>
319 334
 
320
-<div id="outline-container-orge5bdb7f" class="outline-3">
321
-<h3 id="orge5bdb7f">LibreCMC</h3>
322
-<div class="outline-text-3" id="text-orge5bdb7f">
335
+<div id="outline-container-org2c8b1c5" class="outline-3">
336
+<h3 id="org2c8b1c5">LibreCMC</h3>
337
+<div class="outline-text-3" id="text-org2c8b1c5">
323 338
 <p>
324 339
 On a router running LibreCMC from the <b>Network</b> menu select <b>DHCP and DNS</b>. Enter the static IP address of your Freedombone system within <b>DNS Forwardings</b>, then at the bottom of the page click on <b>Save &amp; Apply</b>. Any devices which connect to your router will now have ad blocking.
325 340
 </p>
@@ -327,9 +342,9 @@ On a router running LibreCMC from the <b>Network</b> menu select <b>DHCP and DNS
327 342
 </div>
328 343
 </div>
329 344
 
330
-<div id="outline-container-org71dabfb" class="outline-2">
331
-<h2 id="org71dabfb">Configuring block lists</h2>
332
-<div class="outline-text-2" id="text-org71dabfb">
345
+<div id="outline-container-orgff38fd6" class="outline-2">
346
+<h2 id="orgff38fd6">Configuring block lists</h2>
347
+<div class="outline-text-2" id="text-orgff38fd6">
333 348
 <p>
334 349
 You can configure the block lists which the system uses by going to the <b>administrator control panel</b>, selecting <b>App Settings</b> then choosing <b>pihole</b>. You can also add any extra domain names to the whitelist if they're being wrongly blocked or to the blacklist if they're not blocked by the current lists.
335 350
 </p>