Browse Source

Don't remove tor log

It causes tor to fail
Bob Mottram 7 years ago
parent
commit
7c32e02d47
3 changed files with 11 additions and 11 deletions
  1. 3
    3
      src/freedombone-app-gnusocial
  2. 3
    3
      src/freedombone-app-postactiv
  3. 5
    5
      src/freedombone-logging

+ 3
- 3
src/freedombone-app-gnusocial View File

@@ -580,6 +580,8 @@ function install_gnusocial_main {
580 580
     function_check add_ddns_domain
581 581
     add_ddns_domain $GNUSOCIAL_DOMAIN_NAME
582 582
 
583
+    GNUSOCIAL_ONION_HOSTNAME=$(add_onion_service gnusocial 80 ${GNUSOCIAL_ONION_PORT})
584
+
583 585
     gnusocial_nginx_site=/etc/nginx/sites-available/$GNUSOCIAL_DOMAIN_NAME
584 586
     if [[ $ONION_ONLY == "no" ]]; then
585 587
         function_check nginx_http_redirect
@@ -641,7 +643,7 @@ function install_gnusocial_main {
641 643
     fi
642 644
     echo 'server {' >> $gnusocial_nginx_site
643 645
     echo "    listen 127.0.0.1:$GNUSOCIAL_ONION_PORT default_server;" >> $gnusocial_nginx_site
644
-    echo "    server_name $GNUSOCIAL_DOMAIN_NAME;" >> $gnusocial_nginx_site
646
+    echo "    server_name $GNUSOCIAL_ONION_HOSTNAME;" >> $gnusocial_nginx_site
645 647
     echo '' >> $gnusocial_nginx_site
646 648
     function_check nginx_compress
647 649
     nginx_compress $GNUSOCIAL_DOMAIN_NAME
@@ -710,8 +712,6 @@ function install_gnusocial_main {
710 712
         gnusocial_ssl='never'
711 713
     fi
712 714
 
713
-    GNUSOCIAL_ONION_HOSTNAME=$(add_onion_service gnusocial 80 ${GNUSOCIAL_ONION_PORT})
714
-
715 715
     GNUSOCIAL_SERVER=${GNUSOCIAL_DOMAIN_NAME}
716 716
     if [[ $ONION_ONLY != 'no' ]]; then
717 717
         GNUSOCIAL_SERVER=${GNUSOCIAL_ONION_HOSTNAME}

+ 3
- 3
src/freedombone-app-postactiv View File

@@ -591,6 +591,8 @@ function install_postactiv_main {
591 591
     function_check add_ddns_domain
592 592
     add_ddns_domain $POSTACTIV_DOMAIN_NAME
593 593
 
594
+    POSTACTIV_ONION_HOSTNAME=$(add_onion_service postactiv 80 ${POSTACTIV_ONION_PORT})
595
+
594 596
     postactiv_nginx_site=/etc/nginx/sites-available/$POSTACTIV_DOMAIN_NAME
595 597
     if [[ $ONION_ONLY == "no" ]]; then
596 598
         function_check nginx_http_redirect
@@ -652,7 +654,7 @@ function install_postactiv_main {
652 654
     fi
653 655
     echo 'server {' >> $postactiv_nginx_site
654 656
     echo "    listen 127.0.0.1:$POSTACTIV_ONION_PORT default_server;" >> $postactiv_nginx_site
655
-    echo "    server_name $POSTACTIV_DOMAIN_NAME;" >> $postactiv_nginx_site
657
+    echo "    server_name $POSTACTIV_ONION_HOSTNAME;" >> $postactiv_nginx_site
656 658
     echo '' >> $postactiv_nginx_site
657 659
     function_check nginx_disable_sniffing
658 660
     nginx_disable_sniffing $POSTACTIV_DOMAIN_NAME
@@ -721,8 +723,6 @@ function install_postactiv_main {
721 723
         postactiv_ssl='never'
722 724
     fi
723 725
 
724
-    POSTACTIV_ONION_HOSTNAME=$(add_onion_service postactiv 80 ${POSTACTIV_ONION_PORT})
725
-
726 726
     POSTACTIV_SERVER=${POSTACTIV_DOMAIN_NAME}
727 727
     if [[ $ONION_ONLY != 'no' ]]; then
728 728
         POSTACTIV_SERVER=${POSTACTIV_ONION_HOSTNAME}

+ 5
- 5
src/freedombone-logging View File

@@ -94,9 +94,13 @@ if [[ "$1" == "on" || "$1" == "On" || "$1" == "ON" ]]; then
94 94
         sed -i 's|logtarget.*|logtarget = /var/log/fail2ban.log|g' /etc/fail2ban/fail2ban.conf
95 95
     fi
96 96
     if [ -d /etc/tor ]; then
97
+        if [ ! -d /var/log/tor ]; then
98
+            mkdir /var/log/tor
99
+            chown -R debian-tor:adm /var/log/tor
100
+        fi
97 101
         if [ ! -f /var/log/tor/notices.log ]; then
98 102
             touch /var/log/tor/notices.log
99
-            chown debian-tor:debian-tor /var/log/tor/notices.log
103
+            chown debian-tor:adm /var/log/tor/notices.log
100 104
         fi
101 105
         sed -i 's|#Log notice file.*|Log notice file /var/log/tor/notices.log|g' /etc/tor/torrc
102 106
         sed -i 's|Log notice file.*|Log notice file /var/log/tor/notices.log|g' /etc/tor/torrc
@@ -169,10 +173,6 @@ else
169 173
     if [ -d /etc/tor ]; then
170 174
         sed -i 's|#Log notice file.*|Log notice file /dev/null|g' /etc/tor/torrc
171 175
         sed -i 's|Log notice file.*|Log notice file /dev/null|g' /etc/tor/torrc
172
-        if [ -d /var/log/tor ]; then
173
-            $REMOVE_FILES_COMMAND /var/log/tor/*
174
-            rm -rf /var/log/tor
175
-        fi
176 176
     fi
177 177
     if [ -f /etc/mumble-server.ini ]; then
178 178
         sed -i 's|logfile=.*|logfile=/dev/null|g' /etc/mumble-server.ini