Quellcode durchsuchen

Remove owncloud from the main install

Bob Mottram vor 9 Jahren
Ursprung
Commit
60220b6604
1 geänderte Dateien mit 1 neuen und 493 gelöschten Zeilen
  1. 1
    493
      src/freedombone

+ 1
- 493
src/freedombone Datei anzeigen

@@ -231,14 +231,7 @@ GO_PACKAGE_MANAGER_REPO="https://github.com/gpmgo/gopm"
231 231
 GVM_REPO="https://github.com/moovweb/gvm"
232 232
 GVM_COMMIT='25ea8ae158e2861c92e2b22c458e60840157832f'
233 233
 
234
-# Domain name for Owncloud installation
235
-OWNCLOUD_DOMAIN_NAME=
236
-OWNCLOUD_CODE=
237
-OWNCLOUD_ONION_PORT=8088
238
-OWNCLOUD_ADMIN_PASSWORD=
239
-OWNCLOUD_PATH=/var/www/owncloud
240
-OWNCLOUD_UPGRADE_PATH=/root/owncloud_upgrade
241
-
234
+# Syncthing
242 235
 SYNCTHING_ID=
243 236
 SYNCTHING_CONFIG_PATH=/root/.config/syncthing
244 237
 SYNCTHING_CONFIG_FILE=$SYNCTHING_CONFIG_PATH/config.xml
@@ -559,7 +552,6 @@ function show_help {
559 552
     echo $'     --microblogdomain  Microblog domain name'
560 553
     echo $'     --wikidomain       Wiki domain name'
561 554
     echo $'     --blogdomain       Blog domain name'
562
-    echo $'     --ownclouddomain   Owncloud domain name'
563 555
     echo $'     --hubzilladomain   Hubzilla domain name'
564 556
     echo $'     --gitdomain        Git hosting domain name'
565 557
     echo $'  -t --time             Domain used as a TLS time source'
@@ -833,11 +825,6 @@ else
833 825
                 shift
834 826
                 FULLBLOG_DOMAIN_NAME="$1"
835 827
                 ;;
836
-            # owncloud domain name
837
-            --ownclouddomain)
838
-                shift
839
-                OWNCLOUD_DOMAIN_NAME="$1"
840
-                ;;
841 828
             # hubzilla domain name
842 829
             --hubzilladomain)
843 830
                 shift
@@ -1445,12 +1432,6 @@ function read_configuration {
1445 1432
         if grep -q "HUBZILLA_CODE" $CONFIGURATION_FILE; then
1446 1433
             HUBZILLA_CODE=$(grep "HUBZILLA_CODE" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
1447 1434
         fi
1448
-        if grep -q "OWNCLOUD_DOMAIN_NAME" $CONFIGURATION_FILE; then
1449
-            OWNCLOUD_DOMAIN_NAME=$(grep "OWNCLOUD_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
1450
-        fi
1451
-        if grep -q "OWNCLOUD_CODE" $CONFIGURATION_FILE; then
1452
-            OWNCLOUD_CODE=$(grep "OWNCLOUD_CODE" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
1453
-        fi
1454 1435
         if grep -q "WIKI_DOMAIN_NAME" $CONFIGURATION_FILE; then
1455 1436
             WIKI_DOMAIN_NAME=$(grep "WIKI_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
1456 1437
         fi
@@ -1504,9 +1485,6 @@ function set_default_onion_domains {
1504 1485
         return
1505 1486
     fi
1506 1487
 
1507
-    if [ ${#OWNCLOUD_DOMAIN_NAME} -gt 1 ]; then
1508
-        OWNCLOUD_DOMAIN_NAME='owncloud.local'
1509
-    fi
1510 1488
     if [ ${#MICROBLOG_DOMAIN_NAME} -gt 1 ]; then
1511 1489
         MICROBLOG_DOMAIN_NAME='microblog.local'
1512 1490
     fi
@@ -1739,17 +1717,6 @@ function create_avahi_onion_domains {
1739 1717
     if [ ! -d /etc/avahi/services ]; then
1740 1718
         return
1741 1719
     fi
1742
-    if [ $OWNCLOUD_DOMAIN_NAME ]; then
1743
-        echo '<?xml version="1.0" standalone="no"?><!--*-nxml-*-->' > /etc/avahi/services/owncloud.service
1744
-        echo '<!DOCTYPE service-group SYSTEM "avahi-service.dtd">' >> /etc/avahi/services/owncloud.service
1745
-        echo '<service-group>' >> /etc/avahi/services/owncloud.service
1746
-        echo '  <name replace-wildcards="yes">%h HTTP</name>' >> /etc/avahi/services/owncloud.service
1747
-        echo '  <service>' >> /etc/avahi/services/owncloud.service
1748
-        echo '    <type>_http._tcp</type>' >> /etc/avahi/services/owncloud.service
1749
-        echo "    <port>$OWNCLOUD_ONION_PORT</port>" >> /etc/avahi/services/owncloud.service
1750
-        echo '  </service>' >> /etc/avahi/services/owncloud.service
1751
-        echo '</service-group>' >> /etc/avahi/services/owncloud.service
1752
-    fi
1753 1720
     if [ $MICROBLOG_DOMAIN_NAME ]; then
1754 1721
         echo '<?xml version="1.0" standalone="no"?><!--*-nxml-*-->' > /etc/avahi/services/microblog.service
1755 1722
         echo '<!DOCTYPE service-group SYSTEM "avahi-service.dtd">' >> /etc/avahi/services/microblog.service
@@ -1813,10 +1780,6 @@ function check_domains {
1813 1780
     if [ ${#WIKI_DOMAIN_NAME} -gt 1 ]; then
1814 1781
         test_domain_name "$WIKI_DOMAIN_NAME"
1815 1782
 
1816
-        if [[ "$test_domain_name" == "$OWNCLOUD_DOMAIN_NAME" ]]; then
1817
-            echo $'Wiki domain name is the same as Owncloud domain name. They must be different'
1818
-            exit 73863
1819
-        fi
1820 1783
         if [[ "$test_domain_name" == "$FULLBLOG_DOMAIN_NAME" ]]; then
1821 1784
             echo $'Wiki domain name is the same as blog domain name. They must be different'
1822 1785
             exit 97326
@@ -1837,33 +1800,6 @@ function check_domains {
1837 1800
         fi
1838 1801
     fi
1839 1802
 
1840
-    if [ ${#OWNCLOUD_DOMAIN_NAME} -gt 1 ]; then
1841
-        test_domain_name "$OWNCLOUD_DOMAIN_NAME"
1842
-
1843
-        if [[ "$test_domain_name" == "$WIKI_DOMAIN_NAME" ]]; then
1844
-            echo $'Owncloud domain name is the same as wiki domain name. They must be different'
1845
-            exit 37994
1846
-        fi
1847
-        if [[ "$test_domain_name" == "$FULLBLOG_DOMAIN_NAME" ]]; then
1848
-            echo $'Owncloud domain name is the same as blog domain name. They must be different'
1849
-            exit 37936
1850
-        fi
1851
-        if [[ "$test_domain_name" == "$MICROBLOG_DOMAIN_NAME" ]]; then
1852
-            echo $'Owncloud domain name is the same as microblog domain name. They must be different'
1853
-            exit 36896
1854
-        fi
1855
-        if [[ "$test_domain_name" == "$HUBZILLA_DOMAIN_NAME" ]]; then
1856
-            echo $'Owncloud domain name is the same as hubzilla domain name. They must be different'
1857
-            exit 68365
1858
-        fi
1859
-        if [ $GIT_DOMAIN_NAME ]; then
1860
-            if [[ "$test_domain_name" == "$GIT_DOMAIN_NAME" ]]; then
1861
-                echo $'Owncloud domain name is the same as Gogs domain name. They must be different'
1862
-                exit 27692
1863
-            fi
1864
-        fi
1865
-    fi
1866
-
1867 1803
     if [ ${#FULLBLOG_DOMAIN_NAME} -gt 1 ]; then
1868 1804
         test_domain_name "$FULLBLOG_DOMAIN_NAME"
1869 1805
 
@@ -1871,10 +1807,6 @@ function check_domains {
1871 1807
             echo $'Blog domain name is the same as wiki domain name. They must be different'
1872 1808
             exit 62348
1873 1809
         fi
1874
-        if [[ "$test_domain_name" == "$OWNCLOUD_DOMAIN_NAME" ]]; then
1875
-            echo $'Blog domain name is the same as Owncloud domain name. They must be different'
1876
-            exit 84682
1877
-        fi
1878 1810
         if [[ "$test_domain_name" == "$MICROBLOG_DOMAIN_NAME" ]]; then
1879 1811
             echo $'Blog domain name is the same as microblog domain name. They must be different'
1880 1812
             exit 38236
@@ -1898,10 +1830,6 @@ function check_domains {
1898 1830
             echo $'Microblog domain name is the same as wiki domain name. They must be different'
1899 1831
             exit 73924
1900 1832
         fi
1901
-        if [[ "$test_domain_name" == "$OWNCLOUD_DOMAIN_NAME" ]]; then
1902
-            echo $'Microblog domain name is the same as Owncloud domain name. They must be different'
1903
-            exit 73683
1904
-        fi
1905 1833
         if [[ "$test_domain_name" == "$FULLBLOG_DOMAIN_NAME" ]]; then
1906 1834
             echo $'Microblog domain name is the same as blog domain name. They must be different'
1907 1835
             exit 26832
@@ -1925,10 +1853,6 @@ function check_domains {
1925 1853
             echo $'Hubzilla domain name is the same as wiki domain name. They must be different'
1926 1854
             exit 83682
1927 1855
         fi
1928
-        if [[ "$test_domain_name" == "$OWNCLOUD_DOMAIN_NAME" ]]; then
1929
-            echo $'Hubzilla domain name is the same as Owncloud domain name. They must be different'
1930
-            exit 65192
1931
-        fi
1932 1856
         if [[ "$test_domain_name" == "$FULLBLOG_DOMAIN_NAME" ]]; then
1933 1857
             echo $'Hubzilla domain name is the same as blog domain name. They must be different'
1934 1858
             exit 74817
@@ -1952,10 +1876,6 @@ function check_domains {
1952 1876
             echo $'Hubzilla domain name is the same as wiki domain name. They must be different'
1953 1877
             exit 83682
1954 1878
         fi
1955
-        if [[ "$test_domain_name" == "$OWNCLOUD_DOMAIN_NAME" ]]; then
1956
-            echo $'Hubzilla domain name is the same as Owncloud domain name. They must be different'
1957
-            exit 65192
1958
-        fi
1959 1879
         if [[ "$test_domain_name" == "$FULLBLOG_DOMAIN_NAME" ]]; then
1960 1880
             echo $'Hubzilla domain name is the same as blog domain name. They must be different'
1961 1881
             exit 74817
@@ -3251,14 +3171,6 @@ function get_mariadb_hubzilla_admin_password {
3251 3171
     fi
3252 3172
 }
3253 3173
 
3254
-function get_mariadb_owncloud_admin_password {
3255
-    if [ -f /home/$MY_USERNAME/README ]; then
3256
-        if grep -q "Owncloud database password" /home/$MY_USERNAME/README; then
3257
-            OWNCLOUD_ADMIN_PASSWORD=$(cat /home/$MY_USERNAME/README | grep "Owncloud database password" | awk -F ':' '{print $2}' | sed 's/^ *//')
3258
-        fi
3259
-    fi
3260
-}
3261
-
3262 3174
 function create_freedns_updater {
3263 3175
     if [[ $ONION_ONLY != "no" ]]; then
3264 3176
         return
@@ -3301,12 +3213,6 @@ function create_freedns_updater {
3301 3213
             echo "$FREEDNS_WGET$HUBZILLA_CODE=" >> /usr/bin/dynamicdns
3302 3214
         fi
3303 3215
     fi
3304
-    if [ $OWNCLOUD_CODE ]; then
3305
-        if [[ $OWNCLOUD_CODE != "$DEFAULT_DOMAIN_CODE" ]]; then
3306
-            echo "# $OWNCLOUD_DOMAIN_NAME" >> /usr/bin/dynamicdns
3307
-            echo "$FREEDNS_WGET$OWNCLOUD_CODE=" >> /usr/bin/dynamicdns
3308
-        fi
3309
-    fi
3310 3216
     if [ $MICROBLOG_CODE ]; then
3311 3217
         if [[ $MICROBLOG_CODE != "$DEFAULT_DOMAIN_CODE" ]]; then
3312 3218
             echo "# $MICROBLOG_DOMAIN_NAME" >> /usr/bin/dynamicdns
@@ -5961,7 +5867,6 @@ function install_web_server {
5961 5867
     echo '        limit_conn_zone $binary_remote_addr zone=conn_limit_per_ip:10m;' >> /etc/nginx/nginx.conf
5962 5868
     echo '' >> /etc/nginx/nginx.conf
5963 5869
     echo '        # limit the number of requests for a given session' >> /etc/nginx/nginx.conf
5964
-    echo '        # Note that the Owncloud web interface seems to require a rate of around 140r/s' >> /etc/nginx/nginx.conf
5965 5870
     echo '        limit_req_zone $binary_remote_addr zone=req_limit_per_ip:10m rate=140r/s;' >> /etc/nginx/nginx.conf
5966 5871
     echo '' >> /etc/nginx/nginx.conf
5967 5872
     echo '        # if the request body size is more than the buffer size, then the entire (or partial) request body is written into a temporary file' >> /etc/nginx/nginx.conf
@@ -6202,47 +6107,6 @@ function add_ddns_domain {
6202 6107
     systemctl daemon-reload
6203 6108
 }
6204 6109
 
6205
-function upgrade_owncloud_start {
6206
-    # copies data and config directories to a temporary upgrade directory
6207
-    if [ ! -d /etc/owncloud ]; then
6208
-        return
6209
-    fi
6210
-
6211
-    echo $'Starting upgrade of Owncloud'
6212
-
6213
-    # remove any owncloud entries from completion
6214
-    sed -i '/install_owncloud/d' $COMPLETION_FILE
6215
-    sed -i '/owncloud/d' $COMPLETION_FILE
6216
-    sed -i '/Owncloud/d' $COMPLETION_FILE
6217
-
6218
-    # create directories
6219
-    if [ ! -d $OWNCLOUD_UPGRADE_PATH/data ]; then
6220
-        mkdir -p $OWNCLOUD_UPGRADE_PATH/data
6221
-    fi
6222
-    if [ ! -d $OWNCLOUD_UPGRADE_PATH/config ]; then
6223
-        mkdir -p $OWNCLOUD_UPGRADE_PATH/config
6224
-    fi
6225
-
6226
-    # copy data to the temporary directory
6227
-    if [ -d /var/lib/owncloud/data ]; then
6228
-        cp -rf /var/lib/owncloud/data/* $OWNCLOUD_UPGRADE_PATH/data/
6229
-    fi
6230
-
6231
-    # copy the config files to the temporary directory
6232
-    if [ -d /etc/owncloud ]; then
6233
-        cp -rf /etc/owncloud/* $OWNCLOUD_UPGRADE_PATH/config/
6234
-    fi
6235
-
6236
-    # remove the previous owncloud install
6237
-    apt-get -y remove --purge owncloud
6238
-
6239
-    # ensure directories do not exist
6240
-    rm -rf /etc/owncloud
6241
-    if [ -d /var/lib/owncloud ]; then
6242
-        rm -rf /var/lib/owncloud
6243
-    fi
6244
-}
6245
-
6246 6110
 function install_syncthing {
6247 6111
     if [[ $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_MAILBOX" || $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_DEVELOPER" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
6248 6112
         return
@@ -6287,361 +6151,6 @@ function install_syncthing {
6287 6151
     echo 'install_syncthing' >> $COMPLETION_FILE
6288 6152
 }
6289 6153
 
6290
-function upgrade_owncloud_finish {
6291
-    # copies data from a temporary upgrade directory to the new
6292
-    # owncloud install
6293
-    if [ ! -d $OWNCLOUD_PATH ]; then
6294
-        return
6295
-    fi
6296
-    if [ ! -d $OWNCLOUD_UPGRADE_PATH ]; then
6297
-        return
6298
-    fi
6299
-
6300
-    echo $'Finishing upgrade of Owncloud'
6301
-
6302
-    if [ ! -d $OWNCLOUD_PATH/data ]; then
6303
-        mkdir $OWNCLOUD_PATH/data
6304
-    fi
6305
-    cp -r $OWNCLOUD_UPGRADE_PATH/data/* $OWNCLOUD_PATH/data/
6306
-    chown -R www-data:www-data $OWNCLOUD_PATH/data
6307
-
6308
-    # remove the temporary upgrade
6309
-    rm -rf $OWNCLOUD_UPGRADE_PATH
6310
-}
6311
-
6312
-function install_owncloud_official_deb {
6313
-    # new version not based on debian package
6314
-    if [[ $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_MAILBOX" || $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_DEVELOPER" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
6315
-        return
6316
-    fi
6317
-    # if this is exclusively a cloud setup
6318
-    if [[ $SYSTEM_TYPE == "$VARIANT_CLOUD" ]]; then
6319
-        if [ ! $DEFAULT_DOMAIN_NAME ]; then
6320
-            echo $'No default domain name when installing cloud variant'
6321
-            exit 5380
6322
-        fi
6323
-    fi
6324
-    if [ ! $OWNCLOUD_DOMAIN_NAME ]; then
6325
-        echo $'No Owncloud domain name was specified'
6326
-        exit 3095
6327
-    fi
6328
-    if [[ $SYSTEM_TYPE != "$VARIANT_CLOUD" ]]; then
6329
-        if [[ $SYSTEM_TYPE != "$VARIANT_FULL" ]]; then
6330
-            echo $"Owncloud install did not recognise the system type $SYSTEM_TYPE"
6331
-            exit 6746
6332
-        fi
6333
-    fi
6334
-
6335
-    UPGRADING_OWNCLOUD=
6336
-    if [ -d /etc/owncloud ]; then
6337
-        UPGRADING_OWNCLOUD='yes'
6338
-    fi
6339
-
6340
-    # begin doing an upgrade if needed
6341
-    upgrade_owncloud_start
6342
-
6343
-    OWNCLOUD_COMPLETION_MSG1=$" *** ${PROJECT_NAME} $SYSTEM_TYPE is now installed ***"
6344
-    OWNCLOUD_COMPLETION_MSG2=$"Open $OWNCLOUD_DOMAIN_NAME in a web browser to complete the setup"
6345
-    if grep -Fxq "install_owncloud_official_deb" $COMPLETION_FILE; then
6346
-        if [[ $SYSTEM_TYPE == "$VARIANT_CLOUD" ]]; then
6347
-            backup_to_friends_servers
6348
-            intrusion_detection
6349
-            split_gpg_key_into_fragments
6350
-            # unmount any attached usb drive
6351
-            if [ -d $USB_MOUNT ]; then
6352
-                umount $USB_MOUNT
6353
-                rm -rf $USB_MOUNT
6354
-            fi
6355
-            echo ''
6356
-            echo "$OWNCLOUD_COMPLETION_MSG1"
6357
-            echo "$OWNCLOUD_COMPLETION_MSG2"
6358
-            exit 0
6359
-        fi
6360
-        return
6361
-    fi
6362
-
6363
-    apt-get -y install fonts-linuxlibertine fonts-sil-gentium-basic fonts-way-microhei
6364
-    apt-get -y install libjs-twitter-bootstrap
6365
-
6366
-    # ensure that apache hasn't been inadvertantly installed
6367
-    apt-get -y remove --purge apache*
6368
-    if [ -d /etc/apache2 ]; then
6369
-        rm -rf /etc/apache2
6370
-        echo $'Removed Apache installation after Owncloud install'
6371
-    fi
6372
-
6373
-    # get the official owncloud deb package. Note that this is not the same as the one
6374
-    # from the debian repos, and doesn't follow the debian packaging guidelines
6375
-    if [ ! -d $INSTALL_DIR ]; then
6376
-        mkdir $INSTALL_DIR
6377
-    fi
6378
-
6379
-    cd $INSTALL_DIR
6380
-    wget -nv https://download.owncloud.org/download/repositories/stable/Debian_8.0/Release.key -O owncloud.key
6381
-    apt-key add - < owncloud.key
6382
-    if [ ! -f /etc/apt/sources.list.d/owncloud.list ]; then
6383
-        echo 'deb http://download.owncloud.org/download/repositories/stable/Debian_8.0/ /' >> /etc/apt/sources.list.d/owncloud.list
6384
-    fi
6385
-    apt-get update
6386
-    apt-get -y install owncloud
6387
-
6388
-    install_mariadb
6389
-    get_mariadb_password
6390
-    if [ ! -d $OWNCLOUD_PATH ]; then
6391
-        echo $'Owncloud was not installed'
6392
-        exit 82584
6393
-    fi
6394
-
6395
-    get_mariadb_owncloud_admin_password
6396
-    if [ ! $OWNCLOUD_ADMIN_PASSWORD ]; then
6397
-        if [ -f $IMAGE_PASSWORD_FILE ]; then
6398
-            OWNCLOUD_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
6399
-        else
6400
-            OWNCLOUD_ADMIN_PASSWORD="$(openssl rand -base64 32 | cut -c1-30)"
6401
-        fi
6402
-    fi
6403
-
6404
-    if ! grep -q "Owncloud database user" /home/$MY_USERNAME/README; then
6405
-        echo '' >> /home/$MY_USERNAME/README
6406
-        echo '' >> /home/$MY_USERNAME/README
6407
-        echo 'Owncloud' >> /home/$MY_USERNAME/README
6408
-        echo '========' >> /home/$MY_USERNAME/README
6409
-        echo $'Owncloud database user: owncloudadmin' >> /home/$MY_USERNAME/README
6410
-        echo $"Owncloud database password: $OWNCLOUD_ADMIN_PASSWORD" >> /home/$MY_USERNAME/README
6411
-        echo $'Owncloud database name: owncloud' >> /home/$MY_USERNAME/README
6412
-        echo '' >> /home/$MY_USERNAME/README
6413
-        echo $'After creating an administrator account then create a user account via' >> /home/$MY_USERNAME/README
6414
-        echo $"the Users dropdown menu entry. The username should be '$MY_USERNAME'." >> /home/$MY_USERNAME/README
6415
-        echo '' >> /home/$MY_USERNAME/README
6416
-        echo $'On mobile devices you can download the Owncloud client via F-Droid.' >> /home/$MY_USERNAME/README
6417
-        echo '' >> /home/$MY_USERNAME/README
6418
-        echo $'To synchronise calendar entries with Android "install CalDAV Sync Adapter"' >> /home/$MY_USERNAME/README
6419
-        echo $'using F-Droid then go to settings/accounts and add a CalDav account with' >> /home/$MY_USERNAME/README
6420
-        echo $"the URL https://$OWNCLOUD_DOMAIN_NAME/remote.php/caldav/principals/$MY_USERNAME" >> /home/$MY_USERNAME/README
6421
-        echo $'and the username and password shown above.' >> /home/$MY_USERNAME/README
6422
-        chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
6423
-        chmod 600 /home/$MY_USERNAME/README
6424
-    fi
6425
-
6426
-    if [ $UPGRADING_OWNCLOUD ]; then
6427
-        remove_database owncloud
6428
-    fi
6429
-
6430
-    create_database owncloud "$OWNCLOUD_ADMIN_PASSWORD"
6431
-
6432
-    if [[ $ONION_ONLY == "no" ]]; then
6433
-        nginx_http_redirect $OWNCLOUD_DOMAIN_NAME
6434
-        echo 'server {' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6435
-        echo '    listen 443 ssl;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6436
-        echo "    root $OWNCLOUD_PATH;" >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6437
-        echo "    server_name $OWNCLOUD_DOMAIN_NAME;" >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6438
-        echo '    access_log off;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6439
-        echo "    error_log /var/log/nginx/${OWNCLOUD_DOMAIN_NAME}_error.log $WEBSERVER_LOG_LEVEL;" >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6440
-        echo '' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6441
-        nginx_limits $OWNCLOUD_DOMAIN_NAME '10G'
6442
-        echo '' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6443
-        nginx_ssl $OWNCLOUD_DOMAIN_NAME
6444
-        nginx_disable_sniffing $OWNCLOUD_DOMAIN_NAME
6445
-        echo '    add_header Strict-Transport-Security max-age=15768000;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6446
-        echo '    # if you want to be able to access the site via HTTP' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6447
-        echo '    # then replace the above with the following:' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6448
-        echo '    # add_header Strict-Transport-Security "max-age=0;";' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6449
-        echo "    # make sure webfinger and other well known services aren't blocked" >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6450
-        echo '    # by denying dot files and rewrite request to the front controller' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6451
-        echo '    location ^~ /.well-known/ {' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6452
-        echo '        allow all;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6453
-        echo '    }' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6454
-        echo '' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6455
-        echo '    fastcgi_buffers 64 4K;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6456
-        echo '' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6457
-        echo '    rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6458
-        echo '    rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6459
-        echo '    rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6460
-        echo '' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6461
-        echo '    index index.php;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6462
-        echo '    error_page 403 /core/templates/403.php;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6463
-        echo '    error_page 404 /core/templates/404.php;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6464
-        echo '' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6465
-        echo '    location = /robots.txt {' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6466
-        echo '        allow all;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6467
-        echo '        log_not_found off;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6468
-        echo '        access_log off;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6469
-        echo '    }' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6470
-        echo '' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6471
-        echo '    location ~ ^/(data|config|\.ht|db_structure\.xml|README) {' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6472
-        echo '        deny all;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6473
-        echo '    }' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6474
-        echo '' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6475
-        echo '    location / {' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6476
-        echo '        # The following 2 rules are only needed with webfinger' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6477
-        echo '        rewrite ^/.well-known/host-meta /public.php?service=host-meta last;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6478
-        echo '        rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6479
-        echo '        rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6480
-        echo '        rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6481
-        echo '        rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6482
-        echo '        try_files $uri $uri/ index.php;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6483
-        echo '    }' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6484
-        echo '' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6485
-        echo '    location ~ ^(.+?\.php)(/.*)?$ {' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6486
-        echo '        try_files $1 =404;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6487
-        echo '        fastcgi_split_path_info ^(.+\.php)(/.+)$;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6488
-        echo '        fastcgi_pass unix:/var/run/php5-fpm.sock;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6489
-        echo '        fastcgi_index index.php;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6490
-        echo '        include fastcgi_params;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6491
-        echo '        fastcgi_param SCRIPT_FILENAME $document_root$1;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6492
-        echo '        fastcgi_param PATH_INFO $2;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6493
-        echo '        fastcgi_param HTTPS on;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6494
-        echo '    }' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6495
-        echo '' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6496
-        echo '    # Optional: set long EXPIRES header on static assets' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6497
-        echo '    location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6498
-        echo '        expires 30d;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6499
-        echo "        # Optional: Don't log access to assets" >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6500
-        echo '        access_log off;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6501
-        echo '    }' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6502
-        echo '}' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6503
-        echo '' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6504
-    else
6505
-        echo -n '' > /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6506
-    fi
6507
-    echo 'server {' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6508
-    echo "    listen 127.0.0.1:${OWNCLOUD_ONION_PORT} default_server;" >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6509
-    echo "    root $OWNCLOUD_PATH;" >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6510
-    echo "    server_name $OWNCLOUD_DOMAIN_NAME;" >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6511
-    echo '    access_log off;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6512
-    echo "    error_log /var/log/nginx/${OWNCLOUD_DOMAIN_NAME}_error.log $WEBSERVER_LOG_LEVEL;" >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6513
-    echo '' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6514
-    nginx_limits $OWNCLOUD_DOMAIN_NAME '10G'
6515
-    nginx_disable_sniffing $OWNCLOUD_DOMAIN_NAME
6516
-    echo '    add_header Strict-Transport-Security max-age=15768000;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6517
-    echo '    # if you want to be able to access the site via HTTP' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6518
-    echo '    # then replace the above with the following:' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6519
-    echo '    # add_header Strict-Transport-Security "max-age=0;";' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6520
-    echo "    # make sure webfinger and other well known services aren't blocked" >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6521
-    echo '    # by denying dot files and rewrite request to the front controller' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6522
-    echo '    location ^~ /.well-known/ {' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6523
-    echo '        allow all;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6524
-    echo '    }' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6525
-    echo '' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6526
-    echo '    fastcgi_buffers 64 4K;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6527
-    echo '' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6528
-    echo '    rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6529
-    echo '    rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6530
-    echo '    rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6531
-    echo '' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6532
-    echo '    index index.php;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6533
-    echo '    error_page 403 /core/templates/403.php;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6534
-    echo '    error_page 404 /core/templates/404.php;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6535
-    echo '' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6536
-    echo '    location = /robots.txt {' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6537
-    echo '        allow all;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6538
-    echo '        log_not_found off;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6539
-    echo '        access_log off;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6540
-    echo '    }' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6541
-    echo '' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6542
-    echo '    location ~ ^/(data|config|\.ht|db_structure\.xml|README) {' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6543
-    echo '        deny all;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6544
-    echo '    }' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6545
-    echo '' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6546
-    echo '    location / {' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6547
-    echo '        # The following 2 rules are only needed with webfinger' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6548
-    echo '        rewrite ^/.well-known/host-meta /public.php?service=host-meta last;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6549
-    echo '        rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6550
-    echo '        rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6551
-    echo '        rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6552
-    echo '        rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6553
-    echo '        try_files $uri $uri/ index.php;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6554
-    echo '    }' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6555
-    echo '' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6556
-    echo '    location ~ ^(.+?\.php)(/.*)?$ {' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6557
-    echo '        try_files $1 =404;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6558
-    echo '        fastcgi_split_path_info ^(.+\.php)(/.+)$;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6559
-    echo '        fastcgi_pass unix:/var/run/php5-fpm.sock;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6560
-    echo '        fastcgi_index index.php;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6561
-    echo '        include fastcgi_params;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6562
-    echo '        fastcgi_param SCRIPT_FILENAME $document_root$1;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6563
-    echo '        fastcgi_param PATH_INFO $2;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6564
-    echo '        fastcgi_param HTTPS off;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6565
-    echo '    }' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6566
-    echo '' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6567
-    echo '    # Optional: set long EXPIRES header on static assets' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6568
-    echo '    location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6569
-    echo '        expires 30d;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6570
-    echo "        # Optional: Don't log access to assets" >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6571
-    echo '        access_log off;' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6572
-    echo '    }' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6573
-    echo '}' >> /etc/nginx/sites-available/$OWNCLOUD_DOMAIN_NAME
6574
-
6575
-    configure_php
6576
-
6577
-    create_site_certificate $OWNCLOUD_DOMAIN_NAME
6578
-
6579
-    # Ensure that the database gets backed up locally, if remote
6580
-    # backups are not being used
6581
-    backup_databases_script_header
6582
-
6583
-    backup_database_local owncloud
6584
-
6585
-    nginx_ensite $OWNCLOUD_DOMAIN_NAME
6586
-
6587
-    OWNCLOUD_ONION_HOSTNAME=$(add_onion_service owncloud 80 ${OWNCLOUD_ONION_PORT})
6588
-
6589
-    systemctl restart php5-fpm
6590
-    systemctl restart nginx
6591
-
6592
-    if ! grep -q "Owncloud onion domain" /home/$MY_USERNAME/README; then
6593
-        echo "Owncloud onion domain: ${OWNCLOUD_ONION_HOSTNAME}" >> /home/$MY_USERNAME/README
6594
-        echo '' >> /home/$MY_USERNAME/README
6595
-        chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
6596
-        chmod 600 /home/$MY_USERNAME/README
6597
-    fi
6598
-    if ! grep -q "Owncloud onion domain" $COMPLETION_FILE; then
6599
-        echo "Owncloud onion domain:${OWNCLOUD_ONION_HOSTNAME}" >> $COMPLETION_FILE
6600
-    fi
6601
-
6602
-    add_ddns_domain $OWNCLOUD_DOMAIN_NAME
6603
-
6604
-    if ! grep -q "Owncloud domain" $COMPLETION_FILE; then
6605
-        echo "Owncloud domain:$OWNCLOUD_DOMAIN_NAME" >> $COMPLETION_FILE
6606
-    fi
6607
-
6608
-    upgrade_owncloud_finish
6609
-
6610
-    echo "<?php
6611
-\$AUTOCONFIG = array(
6612
-  \"dbtype\"        => \"mysql\",
6613
-  \"dbname\"        => \"owncloud\",
6614
-  \"dbuser\"        => \"root\",
6615
-  \"dbpass\"        => \"$MARIADB_PASSWORD\",
6616
-  \"dbhost\"        => \"localhost\",
6617
-  \"dbtableprefix\" => \"\",
6618
-  \"adminlogin\"    => \"${MY_USERNAME}\",
6619
-  \"adminpass\"     => \"${OWNCLOUD_ADMIN_PASSWORD}\",
6620
-  \"trusted_domains\" =>
6621
-    array (
6622
-        '${OWNCLOUD_DOMAIN_NAME}',
6623
-        '${OWNCLOUD_ONION_HOSTNAME}',
6624
-    ),
6625
-);" > $OWNCLOUD_PATH/config/autoconfig.php
6626
-
6627
-    echo 'install_owncloud_official_deb' >> $COMPLETION_FILE
6628
-
6629
-    if [[ $SYSTEM_TYPE == "$VARIANT_CLOUD" ]]; then
6630
-        backup_to_friends_servers
6631
-        intrusion_detection
6632
-        split_gpg_key_into_fragments
6633
-        # unmount any attached usb drive
6634
-        if [ -d $USB_MOUNT ]; then
6635
-            umount $USB_MOUNT
6636
-            rm -rf $USB_MOUNT
6637
-        fi
6638
-        echo ''
6639
-        echo "$OWNCLOUD_COMPLETION_MSG1"
6640
-        echo "$OWNCLOUD_COMPLETION_MSG2"
6641
-        exit 0
6642
-    fi
6643
-}
6644
-
6645 6154
 function upgrade_golang {
6646 6155
     if [[ $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_MAILBOX" || $SYSTEM_TYPE == "$VARIANT_CLOUD" || $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
6647 6156
         return
@@ -10910,7 +10419,6 @@ install_web_server
10910 10419
 install_web_server_access_control
10911 10420
 configure_firewall_for_web_server
10912 10421
 install_syncthing
10913
-#install_owncloud_official_deb
10914 10422
 upgrade_golang
10915 10423
 install_gogs
10916 10424
 install_xmpp