Bläddra i källkod

Don't remove tor log

It causes tor to fail
Bob Mottram 7 år sedan
förälder
incheckning
7c32e02d47
3 ändrade filer med 11 tillägg och 11 borttagningar
  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 Visa fil

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

+ 3
- 3
src/freedombone-app-postactiv Visa fil

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

+ 5
- 5
src/freedombone-logging Visa fil

94
         sed -i 's|logtarget.*|logtarget = /var/log/fail2ban.log|g' /etc/fail2ban/fail2ban.conf
94
         sed -i 's|logtarget.*|logtarget = /var/log/fail2ban.log|g' /etc/fail2ban/fail2ban.conf
95
     fi
95
     fi
96
     if [ -d /etc/tor ]; then
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
         if [ ! -f /var/log/tor/notices.log ]; then
101
         if [ ! -f /var/log/tor/notices.log ]; then
98
             touch /var/log/tor/notices.log
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
         fi
104
         fi
101
         sed -i 's|#Log notice file.*|Log notice file /var/log/tor/notices.log|g' /etc/tor/torrc
105
         sed -i 's|#Log notice file.*|Log notice file /var/log/tor/notices.log|g' /etc/tor/torrc
102
         sed -i 's|Log notice file.*|Log notice file /var/log/tor/notices.log|g' /etc/tor/torrc
106
         sed -i 's|Log notice file.*|Log notice file /var/log/tor/notices.log|g' /etc/tor/torrc
169
     if [ -d /etc/tor ]; then
173
     if [ -d /etc/tor ]; then
170
         sed -i 's|#Log notice file.*|Log notice file /dev/null|g' /etc/tor/torrc
174
         sed -i 's|#Log notice file.*|Log notice file /dev/null|g' /etc/tor/torrc
171
         sed -i 's|Log notice file.*|Log notice file /dev/null|g' /etc/tor/torrc
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
     fi
176
     fi
177
     if [ -f /etc/mumble-server.ini ]; then
177
     if [ -f /etc/mumble-server.ini ]; then
178
         sed -i 's|logfile=.*|logfile=/dev/null|g' /etc/mumble-server.ini
178
         sed -i 's|logfile=.*|logfile=/dev/null|g' /etc/mumble-server.ini