Procházet zdrojové kódy

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

Bob Mottram před 6 roky
rodič
revize
53938c9856

binární
man/freedombone-archive-mail.1.gz Zobrazit soubor


binární
man/freedombone-client.1.gz Zobrazit soubor


binární
man/freedombone-template.1.gz Zobrazit soubor


binární
man/freedombone.1.gz Zobrazit soubor


+ 1
- 0
src/freedombone-app-jitsi Zobrazit soubor

33
 IN_DEFAULT_INSTALL=0
33
 IN_DEFAULT_INSTALL=0
34
 SHOW_ON_ABOUT=0
34
 SHOW_ON_ABOUT=0
35
 NOT_ON_ONION=1
35
 NOT_ON_ONION=1
36
+NOT_ON_ARM=1
36
 
37
 
37
 VIDEOBRIDGE_PORT=5347
38
 VIDEOBRIDGE_PORT=5347
38
 JITSI_ONION_PORT=8102
39
 JITSI_ONION_PORT=8102

+ 1
- 0
src/freedombone-app-peertube Zobrazit soubor

33
 
33
 
34
 IN_DEFAULT_INSTALL=0
34
 IN_DEFAULT_INSTALL=0
35
 SHOW_ON_ABOUT=1
35
 SHOW_ON_ABOUT=1
36
+NOT_ON_ONION=1
36
 
37
 
37
 PEERTUBE_DOMAIN_NAME=
38
 PEERTUBE_DOMAIN_NAME=
38
 PEERTUBE_CODE=
39
 PEERTUBE_CODE=

+ 3
- 1
src/freedombone-base-email Zobrazit soubor

1669
     { echo '#!/bin/bash';
1669
     { echo '#!/bin/bash';
1670
       echo "exim_ctr=\$(pgrep \"exim4\" | wc -l)";
1670
       echo "exim_ctr=\$(pgrep \"exim4\" | wc -l)";
1671
       echo "if [ \"\$exim_ctr\" -gt 5 ]; then";
1671
       echo "if [ \"\$exim_ctr\" -gt 5 ]; then";
1672
-      echo '    exim -bp | exiqgrep -i | xargs exim -Mrm';
1672
+      echo '    systemctl stop exim4';
1673
+      echo '    exim -bp | exiqgrep -i | xargs exim -Mrm 2> /dev/null';
1674
+      echo '    systemctl start exim4';
1673
       echo 'fi'; } > /usr/bin/exim_check
1675
       echo 'fi'; } > /usr/bin/exim_check
1674
     chmod +x /usr/bin/exim_check
1676
     chmod +x /usr/bin/exim_check
1675
     cron_add_mins 5 '/usr/bin/exim_check'
1677
     cron_add_mins 5 '/usr/bin/exim_check'

+ 0
- 2
src/freedombone-image-customise Zobrazit soubor

1990
     git clone "$BDSMAIL_REPO" "$rootdir/repos/bdsmail"
1990
     git clone "$BDSMAIL_REPO" "$rootdir/repos/bdsmail"
1991
     #git clone "$WEKAN_REPO" "$rootdir/repos/wekan"
1991
     #git clone "$WEKAN_REPO" "$rootdir/repos/wekan"
1992
     #git clone "$FLOW_ROUTER_REPO" "$rootdir/repos/flowrouter"
1992
     #git clone "$FLOW_ROUTER_REPO" "$rootdir/repos/flowrouter"
1993
-    #git clone "$METEOR_USERACCOUNTS_REPO" "$rootdir/repos/meteoruseraccounts"
1994
-    #git clone "$METEOR_REPO" "$rootdir/repos/meteor"
1995
     #git clone "$ZERONET_REPO" "$rootdir/repos/zeronet"
1993
     #git clone "$ZERONET_REPO" "$rootdir/repos/zeronet"
1996
     #git clone "$QTOX_REPO" "$rootdir/repos/qtox"
1994
     #git clone "$QTOX_REPO" "$rootdir/repos/qtox"
1997
 }
1995
 }

+ 65
- 21
src/freedombone-template Zobrazit soubor

55
     echo $'Creates a new app script which can then be filled in'
55
     echo $'Creates a new app script which can then be filled in'
56
     echo ''
56
     echo ''
57
     echo ''
57
     echo ''
58
-    echo $'  -h --help                            Show help'
59
-    echo $'  -a --app [name]                      Name of the application'
60
-    echo $'  -n --name [name]                     Your name'
61
-    echo $'  -e --email [address]                 Your email address'
62
-    echo $'  -r --repo [url]                      Git repo url for the app'
63
-    echo $'  -c --commit [hash]                   Git commit'
64
-    echo $'     --port [number]                   Port number for the app'
65
-    echo $'     --portinternal [number]           Internal port between a daemon and the web server'
66
-    echo $'     --node [yes|no]                   Is this a nodejs app?'
67
-    echo $'     --nodeapp [package]               Specify a nodejs package to install'
68
-    echo $'  -o --onion [yes|no]                  Is this app only available on an onion address?'
69
-    echo $'  -p --php [yes|no]                    Is this a PHP app?'
70
-    echo $'  -s --daemon [yes|no]                 Add a daemon'
71
-    echo $'  -d --database [mariadb|postgresql]   Type of database'
72
-    echo $'  -w --web [yes|no]                    Whether there is a web user interface (default is yes)'
73
-    echo $'     --dir [directory]                 Where to install to'
58
+    echo $'  -h --help                                   Show help'
59
+    echo $'  -a --app [name]                             Name of the application'
60
+    echo $'  -n --name [name]                            Your name'
61
+    echo $'  -e --email [address]                        Your email address'
62
+    echo $'  -r --repo [url]                             Git repo url for the app'
63
+    echo $'  -c --commit [hash]                          Git commit'
64
+    echo $'     --port [number]                          Port number for the app'
65
+    echo $'     --portinternal [number]                  Internal port between a daemon and the web server'
66
+    echo $'     --node [yes|no]                          Is this a nodejs app?'
67
+    echo $'     --nodeapp [package]                      Specify a nodejs package to install'
68
+    echo $'  -o --onion [yes|no]                         Is this app only available on an onion address?'
69
+    echo $'  -p --php [yes|no]                           Is this a PHP app?'
70
+    echo $'  -s --daemon [yes|no]                        Add a daemon'
71
+    echo $'  -d --database [mariadb|postgresql|mongodb]  Type of database'
72
+    echo $'  -w --web [yes|no]                           Whether there is a web user interface (default is yes)'
73
+    echo $'     --dir [directory]                        Where to install to'
74
     echo ''
74
     echo ''
75
     exit 0
75
     exit 0
76
 }
76
 }
322
 echo "    \"\${PROJECT_NAME}-pass\" -u \"\$curr_username\" -a ${app_name} -p \"\$new_user_password\""
322
 echo "    \"\${PROJECT_NAME}-pass\" -u \"\$curr_username\" -a ${app_name} -p \"\$new_user_password\""
323
 echo '}'
323
 echo '}'
324
 
324
 
325
-if [[ "$database_type" == "mariadb" || "$database_type" == "mysql" || "$database_type" == "postgres"* ]]; then
325
+if [[ "$database_type" == "mariadb" || "$database_type" == "mysql" || "$database_type" == "postgres"* || "$database_type" == "mongo"* ]]; then
326
     echo ''
326
     echo ''
327
     echo "function ${app_name}_create_database {"
327
     echo "function ${app_name}_create_database {"
328
     echo "    if [ -f \$IMAGE_PASSWORD_FILE ]; then"
328
     echo "    if [ -f \$IMAGE_PASSWORD_FILE ]; then"
336
     echo '        return'
336
     echo '        return'
337
     echo '    fi'
337
     echo '    fi'
338
     echo ''
338
     echo ''
339
-    if [[ "$database_type" != "postgres"* ]]; then
339
+    if [[ "$database_type" = "mysql" || "$database_type" = "mariadb" ]]; then
340
         echo "    create_database ${app_name} \"\$${app_name_upper}_ADMIN_PASSWORD\" \$MY_USERNAME"
340
         echo "    create_database ${app_name} \"\$${app_name_upper}_ADMIN_PASSWORD\" \$MY_USERNAME"
341
-    else
341
+    fi
342
+    if [[ "$database_type" = "mongo"* ]]; then
343
+        echo "    create_database_mongodb ${app_name} \"\$${app_name_upper}_ADMIN_PASSWORD\" \$MY_USERNAME"
344
+    fi
345
+    if [[ "$database_type" == "postgres"* ]]; then
342
         echo '    systemctl restart postgresql'
346
         echo '    systemctl restart postgresql'
343
         echo "    run_system_query_postgresql \"CREATE USER peertube WITH PASSWORD '\$${app_name_upper}_ADMIN_PASSWORD';\""
347
         echo "    run_system_query_postgresql \"CREATE USER peertube WITH PASSWORD '\$${app_name_upper}_ADMIN_PASSWORD';\""
344
         echo "    run_system_query_postgresql \"CREATE DATABASE ${app_name} OWNER ${app_name};\""
348
         echo "    run_system_query_postgresql \"CREATE DATABASE ${app_name} OWNER ${app_name};\""
394
     echo "    set_repo_commit \"${app_dir}\" \"${app_name} commit\" \"\$${app_name_upper}_COMMIT\" \"\$${app_name_upper}_REPO\""
398
     echo "    set_repo_commit \"${app_dir}\" \"${app_name} commit\" \"\$${app_name_upper}_COMMIT\" \"\$${app_name_upper}_REPO\""
395
     echo "    chown -R ${app_name}:${app_name} \"${app_dir}\""
399
     echo "    chown -R ${app_name}:${app_name} \"${app_dir}\""
396
 fi
400
 fi
401
+if [ $app_daemon ]; then
402
+    echo "    systemctl restart ${app_name}"
403
+fi
397
 echo '}'
404
 echo '}'
398
 echo ''
405
 echo ''
399
 echo "function backup_local_${app_name} {"
406
 echo "function backup_local_${app_name} {"
430
     echo "    backup_database_to_usb ${app_name}"
437
     echo "    backup_database_to_usb ${app_name}"
431
     echo ''
438
     echo ''
432
 fi
439
 fi
440
+if [[ "$database_type" == "mongo"* ]]; then
441
+    echo '    USE_MONGODB=1'
442
+    echo "    backup_database_to_usb ${app_name}"
443
+    echo ''
444
+fi
433
 if [ $app_webui ]; then
445
 if [ $app_webui ]; then
434
     echo '    restart_site'
446
     echo '    restart_site'
435
 fi
447
 fi
481
     echo '    fi'
493
     echo '    fi'
482
     echo ''
494
     echo ''
483
 fi
495
 fi
496
+if [[ "$database_type" == "mongo"* ]]; then
497
+    echo "    ${app_name}_create_database"
498
+    echo ''
499
+    echo '    USE_MONGODB=1'
500
+    echo "    restore_database ${app_name}"
501
+    echo "    if [ -d \$temp_restore_dir ]; then"
502
+    echo "        rm -rf \$temp_restore_dir"
503
+    echo '    fi'
504
+    echo ''
505
+fi
484
 echo "    restore_directory_from_usb \$temp_restore_dir ${app_name}"
506
 echo "    restore_directory_from_usb \$temp_restore_dir ${app_name}"
485
 echo "    if [ -d \$temp_restore_dir ]; then"
507
 echo "    if [ -d \$temp_restore_dir ]; then"
486
 echo "        if [ -d \"\$temp_restore_dir\$${app_name}_dir\" ]; then"
508
 echo "        if [ -d \"\$temp_restore_dir\$${app_name}_dir\" ]; then"
539
     echo "    backup_database_to_friend ${app_name}"
561
     echo "    backup_database_to_friend ${app_name}"
540
     echo ''
562
     echo ''
541
 fi
563
 fi
564
+if [[ "$database_type" == "mongo"* ]]; then
565
+    echo '    USE_MONGODB=1'
566
+    echo "    backup_database_to_friend ${app_name}"
567
+    echo ''
568
+fi
542
 if [ $app_daemon ]; then
569
 if [ $app_daemon ]; then
543
     echo ''
570
     echo ''
544
     echo "    systemctl start ${app_name}"
571
     echo "    systemctl start ${app_name}"
592
     echo '    fi'
619
     echo '    fi'
593
     echo ''
620
     echo ''
594
 fi
621
 fi
622
+if [[ "$database_type" == "mongo"* ]]; then
623
+    echo "    ${app_name}_create_database"
624
+    echo ''
625
+    echo '    USE_MONGODB=1'
626
+    echo "    restore_database_from_friend ${app_name}"
627
+    echo "    if [ -d \"\$temp_restore_dir\" ]; then"
628
+    echo "        rm -rf \$temp_restore_dir"
629
+    echo '    fi'
630
+    echo ''
631
+fi
595
 echo "    restore_directory_from_friend \$temp_restore_dir ${app_name}"
632
 echo "    restore_directory_from_friend \$temp_restore_dir ${app_name}"
596
 echo "    if [ -d \$temp_restore_dir ]; then"
633
 echo "    if [ -d \$temp_restore_dir ]; then"
597
 echo "        if [ -d \"\$temp_restore_dir\$${app_name}_dir\" ]; then"
634
 echo "        if [ -d \"\$temp_restore_dir\$${app_name}_dir\" ]; then"
655
 if [[ "$database_type" == "postgres"* ]]; then
692
 if [[ "$database_type" == "postgres"* ]]; then
656
     echo "    drop_database_postgresql ${app_name}"
693
     echo "    drop_database_postgresql ${app_name}"
657
 fi
694
 fi
695
+if [[ "$database_type" == "mongo"* ]]; then
696
+    echo "    drop_database_mongodb ${app_name}"
697
+fi
658
 echo "    remove_onion_service ${app_name} \"\${${app_name_upper}_ONION_PORT}\""
698
 echo "    remove_onion_service ${app_name} \"\${${app_name_upper}_ONION_PORT}\""
659
 echo "    if grep -q \"${app_name}\" /etc/crontab; then"
699
 echo "    if grep -q \"${app_name}\" /etc/crontab; then"
660
 echo "        sed -i \"/${app_name}/d\" /etc/crontab"
700
 echo "        sed -i \"/${app_name}/d\" /etc/crontab"
683
     echo '    install_postgresql'
723
     echo '    install_postgresql'
684
     echo ''
724
     echo ''
685
 fi
725
 fi
726
+if [[ "$database_type" == "mongo"* ]]; then
727
+    echo '    install_mongodb'
728
+    echo ''
729
+fi
686
 if [[ "$app_node" == 'yes' ]]; then
730
 if [[ "$app_node" == 'yes' ]]; then
687
     echo "    install_nodejs ${app_name}"
731
     echo "    install_nodejs ${app_name}"
688
 fi
732
 fi
748
     echo "    chown -R www-data:www-data \"/var/www/\$${app_name_upper}_DOMAIN_NAME/htdocs\""
792
     echo "    chown -R www-data:www-data \"/var/www/\$${app_name_upper}_DOMAIN_NAME/htdocs\""
749
 fi
793
 fi
750
 
794
 
751
-if [[ "$database_type" == "mariadb" || "$database_type" == "mysql" || "$database_type" == "postgres"*  ]]; then
795
+if [[ "$database_type" == "mariadb" || "$database_type" == "mysql" || "$database_type" == "postgres"* || "$database_type" == "mongo"*  ]]; then
752
     echo ''
796
     echo ''
753
     echo "    ${app_name}_create_database"
797
     echo "    ${app_name}_create_database"
754
 fi
798
 fi
860
             echo "    { echo \"    try_files \\\$uri \\\$uri/ index.php?\\\$args;\";"
904
             echo "    { echo \"    try_files \\\$uri \\\$uri/ index.php?\\\$args;\";"
861
         fi
905
         fi
862
     else
906
     else
863
-        echo "      echo \"    proxy_pass http://localhost:\$${app_name_upper}_PORT_INTERNAL;\";"
907
+        echo "      { echo \"    proxy_pass http://localhost:\$${app_name_upper}_PORT_INTERNAL;\";"
864
     fi
908
     fi
865
     echo "      echo '  }';"
909
     echo "      echo '  }';"
866
     echo "      echo '}'; } >> \"\$${app_name}_nginx_site\""
910
     echo "      echo '}'; } >> \"\$${app_name}_nginx_site\""

+ 29
- 29
src/freedombone-utils-firewall Zobrazit soubor

54
     # Within firefox source code see submit_telemetry_data.py
54
     # Within firefox source code see submit_telemetry_data.py
55
 
55
 
56
     if ! grep -q 'telemetry.mozilla' /etc/hosts; then
56
     if ! grep -q 'telemetry.mozilla' /etc/hosts; then
57
-	echo '127.0.0.1  telemetry.mozilla.org' >> /etc/hosts
58
-	echo '127.0.0.1  incoming.telemetry.mozilla.org' >> /etc/hosts
57
+    echo '127.0.0.1  telemetry.mozilla.org' >> /etc/hosts
58
+    echo '127.0.0.1  incoming.telemetry.mozilla.org' >> /etc/hosts
59
     fi
59
     fi
60
-        
60
+
61
     if grep -q "$FIREFOX_TELEMETRY_IP" /etc/firewall.conf; then
61
     if grep -q "$FIREFOX_TELEMETRY_IP" /etc/firewall.conf; then
62
         return
62
         return
63
     fi
63
     fi
360
     FIREWALL_FILENAME="${rootdir}/etc/systemd/system/meshfirewall.service"
360
     FIREWALL_FILENAME="${rootdir}/etc/systemd/system/meshfirewall.service"
361
     MESH_FIREWALL_SCRIPT=${rootdir}/usr/bin/mesh-firewall
361
     MESH_FIREWALL_SCRIPT=${rootdir}/usr/bin/mesh-firewall
362
 
362
 
363
-    if ! grep -q 'telemetry.mozilla' ${rootdir}/etc/hosts; then
364
-	echo '127.0.0.1       telemetry.mozilla.org' >> ${rootdir}/etc/hosts
365
-	echo '127.0.0.1       incoming.telemetry.mozilla.org' >> ${rootdir}/etc/hosts
366
-    fi
367
-
368
-    if ! grep -q 'facebook' ${rootdir}/etc/hosts; then
369
-	{ echo '127.0.0.1       www.facebook.com';
370
-	  echo '127.0.0.1       facebook.com';
371
-	  echo '127.0.0.1       static.ak.fbcdn.net';
372
-	  echo '127.0.0.1       www.static.ak.fbcdn.net';
373
-	  echo '127.0.0.1       login.facebook.com';
374
-	  echo '127.0.0.1       www.login.facebook.com';
375
-	  echo '127.0.0.1       fbcdn.net';
376
-	  echo '127.0.0.1       www.fbcdn.net';
377
-	  echo '127.0.0.1       fbcdn.com';
378
-	  echo '127.0.0.1       www.fbcdn.com';
379
-	  echo '127.0.0.1       static.ak.connect.facebook.com';
380
-	  echo '127.0.0.1       www.static.ak.connect.facebook.com'; } >> ${rootdir}/etc/hosts	
381
-    fi
382
-    
383
-    if ! grep -q 'google' ${rootdir}/etc/hosts; then
384
-	{ echo '127.0.0.1       www.google-analytics.com';
385
-	  echo '127.0.0.1       google-analytics.com';
386
-	  echo '127.0.0.1       ssl.google-analytics.com'; } >> ${rootdir}/etc/hosts
387
-    fi    
388
-    
363
+    if ! grep -q 'telemetry.mozilla' "${rootdir}/etc/hosts"; then
364
+    echo '127.0.0.1       telemetry.mozilla.org' >> "${rootdir}/etc/hosts"
365
+    echo '127.0.0.1       incoming.telemetry.mozilla.org' >> "${rootdir}/etc/hosts"
366
+    fi
367
+
368
+    if ! grep -q 'facebook' "${rootdir}/etc/hosts"; then
369
+    { echo '127.0.0.1       www.facebook.com';
370
+      echo '127.0.0.1       facebook.com';
371
+      echo '127.0.0.1       static.ak.fbcdn.net';
372
+      echo '127.0.0.1       www.static.ak.fbcdn.net';
373
+      echo '127.0.0.1       login.facebook.com';
374
+      echo '127.0.0.1       www.login.facebook.com';
375
+      echo '127.0.0.1       fbcdn.net';
376
+      echo '127.0.0.1       www.fbcdn.net';
377
+      echo '127.0.0.1       fbcdn.com';
378
+      echo '127.0.0.1       www.fbcdn.com';
379
+      echo '127.0.0.1       static.ak.connect.facebook.com';
380
+      echo '127.0.0.1       www.static.ak.connect.facebook.com'; } >> "${rootdir}/etc/hosts"
381
+    fi
382
+
383
+    if ! grep -q 'google' "${rootdir}/etc/hosts"; then
384
+    { echo '127.0.0.1       www.google-analytics.com';
385
+      echo '127.0.0.1       google-analytics.com';
386
+      echo '127.0.0.1       ssl.google-analytics.com'; } >> "${rootdir}/etc/hosts"
387
+    fi
388
+
389
     { echo '#!/bin/bash';
389
     { echo '#!/bin/bash';
390
       echo 'iptables -P INPUT ACCEPT';
390
       echo 'iptables -P INPUT ACCEPT';
391
       echo 'ip6tables -P INPUT ACCEPT';
391
       echo 'ip6tables -P INPUT ACCEPT';

+ 0
- 216
src/freedombone-utils-meteor Zobrazit soubor

1
-#!/bin/bash
2
-#  _____               _           _
3
-# |   __|___ ___ ___ _| |___ _____| |_ ___ ___ ___
4
-# |   __|  _| -_| -_| . | . |     | . | . |   | -_|
5
-# |__|  |_| |___|___|___|___|_|_|_|___|___|_|_|___|
6
-#
7
-#                              Freedom in the Cloud
8
-#
9
-# Functions for installing meteor
10
-# See meteor.com
11
-#
12
-# License
13
-# =======
14
-#
15
-# Copyright (C) 2017-2018 Bob Mottram <bob@freedombone.net>
16
-#
17
-# This program is free software: you can redistribute it and/or modify
18
-# it under the terms of the GNU Affero General Public License as published by
19
-# the Free Software Foundation, either version 3 of the License, or
20
-# (at your option) any later version.
21
-#
22
-# This program is distributed in the hope that it will be useful,
23
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
24
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
25
-# GNU Affero General Public License for more details.
26
-#
27
-# You should have received a copy of the GNU Affero General Public License
28
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
29
-
30
-METEOR_RELEASE='1.4.4.1'
31
-METEOR_REPO="https://github.com/meteor/meteor"
32
-METEOR_COMMIT='b52c6587d7542c0f27481a3bee8c65be06068ac1'
33
-METEOR_USERACCOUNTS_REPO="git://github.com/meteor-useraccounts/core.git"
34
-METEOR_USERACCOUNTS_COMMIT='2e8986813b51f321f908d2f6211f6f81f76cd627'
35
-
36
-function meteor_cleanUp {
37
-    rm -rf "$TARBALL_FILE"
38
-    rm -rf "$INSTALL_TMPDIR"
39
-}
40
-
41
-function install_meteor_script {
42
-    meteor_dir="$1"
43
-
44
-    if [ ! "$meteor_dir" ]; then
45
-        echo $'No meteor install directory specified'
46
-        exit 692025
47
-    fi
48
-
49
-    if [ ! -d "$meteor_dir" ]; then
50
-        echo $'Meteor install directory not found'
51
-        exit 845382
52
-    fi
53
-
54
-    if [[ "$(arch)" == "arm"* ]]; then
55
-        echo 'meteor does not support ARM'
56
-        exit 8362952
57
-    fi
58
-    if [[ "$(arch)" == "i386" || "$(arch)" == "x86_32" ]]; then
59
-        PLATFORM="os.linux.x86_32"
60
-    else
61
-        PLATFORM="os.linux.x86_64"
62
-    fi
63
-
64
-    RELEASE="$METEOR_RELEASE"
65
-
66
-    DIR_PREFIX="/usr/local"
67
-
68
-    TARBALL_URL="https://meteorinstall-4168.kxcdn.com/packages-bootstrap/${RELEASE}/meteor-bootstrap-${PLATFORM}.tar.gz"
69
-    INSTALL_TMPDIR="$meteor_dir/.meteor-install-tmp"
70
-    TARBALL_FILE="$meteor_dir/.meteor-tarball-tmp"
71
-
72
-    # Remove temporary files now in case they exist.
73
-    meteor_cleanUp
74
-
75
-    if [ -d "$INSTALL_TMPDIR" ]; then
76
-        rm -rf "$INSTALL_TMPDIR"
77
-    fi
78
-    mkdir "$INSTALL_TMPDIR"
79
-
80
-    if [ ! -f "${TARBALL_FILE}" ]; then
81
-        echo "Downloading Meteor distribution"
82
-        # keep trying to curl the file until it works (resuming where possible)
83
-        MAX_ATTEMPTS=10
84
-        RETRY_DELAY_SECS=5
85
-        set +e
86
-        ATTEMPTS=0
87
-        while [ $ATTEMPTS -lt $MAX_ATTEMPTS ]
88
-        do
89
-            ATTEMPTS=$((ATTEMPTS + 1))
90
-
91
-            if curl --progress-bar --fail --continue-at - \
92
-                    "$TARBALL_URL" --output "$TARBALL_FILE"; then
93
-                break
94
-            fi
95
-
96
-            echo "Retrying download in $RETRY_DELAY_SECS seconds..."
97
-            sleep $RETRY_DELAY_SECS
98
-        done
99
-    fi
100
-
101
-    if [ ! -f "${TARBALL_FILE}" ]; then
102
-        echo $'meteor tarball could not be downloaded'
103
-        exit 7272452
104
-    fi
105
-
106
-    tar -xzf "$TARBALL_FILE" -C "$INSTALL_TMPDIR" -o
107
-
108
-    if [ ! -f "${INSTALL_TMPDIR}/.meteor/meteor" ]; then
109
-        echo $'tarball not extracted'
110
-        exit 693252
111
-    fi
112
-
113
-    # shellcheck disable=SC2086
114
-    mv ${INSTALL_TMPDIR}/.meteor $meteor_dir
115
-
116
-    meteor_cleanUp
117
-
118
-    echo ''
119
-    echo "Meteor ${RELEASE} has been installed in $meteor_dir/.meteor"
120
-
121
-    METEOR_SYMLINK_TARGET="$(readlink "$meteor_dir/.meteor/meteor")"
122
-    METEOR_TOOL_DIRECTORY="$(dirname "$METEOR_SYMLINK_TARGET")"
123
-    LAUNCHER="$meteor_dir/.meteor/$METEOR_TOOL_DIRECTORY/scripts/admin/launch-meteor"
124
-
125
-    if cp "$LAUNCHER" "$DIR_PREFIX/bin/meteor" >/dev/null 2>&1; then
126
-        echo "Writing a launcher script to $DIR_PREFIX/bin/meteor for your convenience."
127
-        cat <<"EOF"
128
-
129
-To get started fast:
130
-
131
-  $ meteor create ~/my_cool_app
132
-  $ cd ~/my_cool_app
133
-  $ meteor
134
-
135
-Or see the docs at:
136
-
137
-  docs.meteor.com
138
-
139
-EOF
140
-    elif type sudo >/dev/null 2>&1; then
141
-        echo "Writing a launcher script to $DIR_PREFIX/bin/meteor for your convenience."
142
-        echo "This may prompt for your password."
143
-
144
-        # New macs (10.9+) don't ship with /usr/local, however it is still in
145
-        # the default PATH. We still install there, we just need to create the
146
-        # directory first.
147
-        # XXX this means that we can run sudo too many times. we should never
148
-        #     run it more than once if it fails the first time
149
-        if [ ! -d "$DIR_PREFIX/bin" ] ; then
150
-            sudo mkdir -m 755 "$DIR_PREFIX" || true
151
-            sudo mkdir -m 755 "$DIR_PREFIX/bin" || true
152
-        fi
153
-
154
-        if sudo cp "$LAUNCHER" "$DIR_PREFIX/bin/meteor"; then
155
-            cat <<"EOF"
156
-
157
-To get started fast:
158
-
159
-  $ meteor create ~/my_cool_app
160
-  $ cd ~/my_cool_app
161
-  $ meteor
162
-
163
-Or see the docs at:
164
-
165
-  docs.meteor.com
166
-
167
-EOF
168
-        else
169
-            cat <<EOF
170
-
171
-Couldn't write the launcher script. Please either:
172
-
173
-  (1) Run the following as root:
174
-        cp "$LAUNCHER" /usr/bin/meteor
175
-  (2) Add "\$meteor_dir/.meteor" to your path, or
176
-  (3) Rerun this command to try again.
177
-
178
-Then to get started, take a look at 'meteor --help' or see the docs at
179
-docs.meteor.com.
180
-EOF
181
-        fi
182
-    else
183
-        cat <<EOF
184
-
185
-Now you need to do one of the following:
186
-
187
-  (1) Add "\$meteor_dir/.meteor" to your path, or
188
-  (2) Run this command as root:
189
-        cp "$LAUNCHER" /usr/bin/meteor
190
-
191
-Then to get started, take a look at 'meteor --help' or see the docs at
192
-docs.meteor.com.
193
-EOF
194
-    fi
195
-
196
-}
197
-
198
-function install_meteor {
199
-    apt-get -yq install curl
200
-    if [ ! -d "$INSTALL_DIR/meteor" ]; then
201
-        mkdir "$INSTALL_DIR/meteor"
202
-    fi
203
-    cd "$INSTALL_DIR/meteor" || exit 72345274
204
-    install_meteor_script
205
-}
206
-
207
-function remove_meteor {
208
-    if [ -f /usr/local/bin/meteor ]; then
209
-        rm /usr/local/bin/meteor
210
-    fi
211
-    if [ -f /usr/bin/meteor ]; then
212
-        rm /usr/bin/meteor
213
-    fi
214
-}
215
-
216
-# NOTE: deliberately no exit 0

+ 1
- 0
src/freedombone-utils-mongodb Zobrazit soubor

29
 # Set this when calling backup and restore commands
29
 # Set this when calling backup and restore commands
30
 USE_MONGODB=
30
 USE_MONGODB=
31
 MONGODB_APPS_FILE=$HOME/.mongodbapps
31
 MONGODB_APPS_FILE=$HOME/.mongodbapps
32
+MONGODB_PORT=27017
32
 
33
 
33
 function store_original_mongodb_password {
34
 function store_original_mongodb_password {
34
     if [ ! -f /root/.mongodboriginal ]; then
35
     if [ ! -f /root/.mongodboriginal ]; then

+ 56
- 35
src/freedombone-utils-selector Zobrazit soubor

286
     echo "1"
286
     echo "1"
287
 }
287
 }
288
 
288
 
289
+function app_not_on_arm {
290
+    app_name="$1"
291
+
292
+    if grep -q "NOT_ON_ARM=1" "/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-${app_name}"; then
293
+        archtype=$(uname -m)
294
+        if [[ "$archtype" == 'arm'* ]]; then
295
+            echo "0"
296
+            return
297
+        fi
298
+    fi
299
+    echo "1"
300
+}
301
+
289
 function enough_ram_for_app {
302
 function enough_ram_for_app {
290
     app_name="$1"
303
     app_name="$1"
291
 
304
 
320
         app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
333
         app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
321
         if [[ $(enough_ram_for_app "$app_name") == "0" ]]; then
334
         if [[ $(enough_ram_for_app "$app_name") == "0" ]]; then
322
             if [[ $(app_not_on_onion_only "$app_name") != "0" ]]; then
335
             if [[ $(app_not_on_onion_only "$app_name") != "0" ]]; then
323
-                # shellcheck disable=SC2068
324
-                if ! item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
325
-                    APPS_AVAILABLE+=("${app_name}")
326
-                    APPS_CHOSEN+=("0")
336
+                if [[ $(app_not_on_arm "$app_name") != "0" ]]; then
337
+                    # shellcheck disable=SC2068
338
+                    if ! item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
339
+                        APPS_AVAILABLE+=("${app_name}")
340
+                        APPS_CHOSEN+=("0")
341
+                    fi
327
                 fi
342
                 fi
328
             fi
343
             fi
329
         fi
344
         fi
356
 
371
 
357
         if [[ $(enough_ram_for_app "$app_name") == "0" ]]; then
372
         if [[ $(enough_ram_for_app "$app_name") == "0" ]]; then
358
             if [[ $(app_not_on_onion_only "$app_name") != "0" ]]; then
373
             if [[ $(app_not_on_onion_only "$app_name") != "0" ]]; then
359
-                # shellcheck disable=SC2068
360
-                if ! item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
361
-                    variants_list=$(app_variants "$filename")
362
-                    # check for empty string
363
-                    if [ ${#variants_list} -gt 0 ]; then
364
-                        APPS_AVAILABLE+=("${app_name}")
365
-                        APPS_CHOSEN+=("0")
366
-                        APPS_INSTALLED+=("$(app_is_installed "$app_name")")
367
-                        if [[ $(app_is_installed "$app_name") == "1" ]]; then
368
-                            APPS_INSTALLED_NAMES+=("$app_name")
374
+                if [[ $(app_not_on_arm "$app_name") != "0" ]]; then
375
+                    # shellcheck disable=SC2068
376
+                    if ! item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
377
+                        variants_list=$(app_variants "$filename")
378
+                        # check for empty string
379
+                        if [ ${#variants_list} -gt 0 ]; then
380
+                            APPS_AVAILABLE+=("${app_name}")
381
+                            APPS_CHOSEN+=("0")
382
+                            APPS_INSTALLED+=("$(app_is_installed "$app_name")")
383
+                            if [[ $(app_is_installed "$app_name") == "1" ]]; then
384
+                                APPS_INSTALLED_NAMES+=("$app_name")
385
+                            fi
369
                         fi
386
                         fi
370
                     fi
387
                     fi
371
                 fi
388
                 fi
392
 
409
 
393
         if [[ $(enough_ram_for_app "$app_name") == "0" ]]; then
410
         if [[ $(enough_ram_for_app "$app_name") == "0" ]]; then
394
             if [[ $(app_not_on_onion_only "$app_name") != "0" ]]; then
411
             if [[ $(app_not_on_onion_only "$app_name") != "0" ]]; then
395
-                if [[ $(app_is_installed "$app_name") == "1" ]]; then
396
-                    # shellcheck disable=SC2068
397
-                    if ! item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
398
-                        variants_list=$(app_variants "$filename")
399
-                        if [ ${#variants_list} -gt 0 ]; then
400
-                            APPS_AVAILABLE+=("${app_name}")
401
-                            APPS_INSTALLED_NAMES+=("$app_name")
412
+                if [[ $(app_not_on_arm "$app_name") != "0" ]]; then
413
+                    if [[ $(app_is_installed "$app_name") == "1" ]]; then
414
+                        # shellcheck disable=SC2068
415
+                        if ! item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
416
+                            variants_list=$(app_variants "$filename")
417
+                            if [ ${#variants_list} -gt 0 ]; then
418
+                                APPS_AVAILABLE+=("${app_name}")
419
+                                APPS_INSTALLED_NAMES+=("$app_name")
420
+                            fi
402
                         fi
421
                         fi
403
                     fi
422
                     fi
404
                 fi
423
                 fi
431
         app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
450
         app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
432
         if [[ $(enough_ram_for_app "$app_name") == "0" ]]; then
451
         if [[ $(enough_ram_for_app "$app_name") == "0" ]]; then
433
             if [[ $(app_not_on_onion_only "$app_name") != "0" ]]; then
452
             if [[ $(app_not_on_onion_only "$app_name") != "0" ]]; then
434
-                # shellcheck disable=SC2068
435
-                if item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
436
-                    if grep -q "VARIANTS=" "${filename}"; then
437
-                        variants_list=$(app_variants "$filename")
438
-                        if [[ "${variants_list}" == 'all'* || \
439
-                                  "${variants_list}" == "$variant_name" || \
440
-                                  "${variants_list}" == "$variant_name "* || \
441
-                                  "${variants_list}" == *" $variant_name "* || \
442
-                                  "${variants_list}" == *" $variant_name" ]]; then
443
-                            if [[ $(app_is_removed "${a}") == "0" ]]; then
444
-                                #echo $"${app_name} chosen"
445
-                                APPS_CHOSEN+=("1")
453
+                if [[ $(app_not_on_arm "$app_name") != "0" ]]; then
454
+                    # shellcheck disable=SC2068
455
+                    if item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
456
+                        if grep -q "VARIANTS=" "${filename}"; then
457
+                            variants_list=$(app_variants "$filename")
458
+                            if [[ "${variants_list}" == 'all'* || \
459
+                                      "${variants_list}" == "$variant_name" || \
460
+                                      "${variants_list}" == "$variant_name "* || \
461
+                                      "${variants_list}" == *" $variant_name "* || \
462
+                                      "${variants_list}" == *" $variant_name" ]]; then
463
+                                if [[ $(app_is_removed "${a}") == "0" ]]; then
464
+                                    #echo $"${app_name} chosen"
465
+                                    APPS_CHOSEN+=("1")
466
+                                else
467
+                                    APPS_CHOSEN+=("0")
468
+                                fi
446
                             else
469
                             else
447
                                 APPS_CHOSEN+=("0")
470
                                 APPS_CHOSEN+=("0")
448
                             fi
471
                             fi
449
                         else
472
                         else
450
                             APPS_CHOSEN+=("0")
473
                             APPS_CHOSEN+=("0")
451
                         fi
474
                         fi
452
-                    else
453
-                        APPS_CHOSEN+=("0")
454
                     fi
475
                     fi
455
                 fi
476
                 fi
456
             fi
477
             fi