From 1b617ab45fa0380322f88ddce26b58928272dd6a Mon Sep 17 00:00:00 2001 From: Alexander Burdeiny Date: Wed, 31 Aug 2016 16:31:31 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BA=D0=BE=D0=BD=D1=84=D0=B8=D0=B3=20=D0=B4=D0=BB=D1=8F=20?= =?UTF-8?q?=D1=82=D0=B5=D1=85=D0=BD=D0=B8=D1=87=D0=B5=D1=81=D0=BA=D0=B8?= =?UTF-8?q?=D1=85=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fabfile.py | 9 +++ support/dev/hit.expomap.ru | 3 - support/dev/proj.com | 4 +- support/dev/tech_work_hit.expomap.ru | 81 +++++++++++++++++++++++++ support/dev_work.html | 25 ++++++++ support/prod/proj.com | 6 +- templates/client/base_catalog.html | 2 +- templates/client/includes/feedback.html | 4 +- 8 files changed, 123 insertions(+), 11 deletions(-) create mode 100644 support/dev/tech_work_hit.expomap.ru create mode 100644 support/dev_work.html diff --git a/fabfile.py b/fabfile.py index 09e4a5b5..f30e0d09 100644 --- a/fabfile.py +++ b/fabfile.py @@ -17,6 +17,7 @@ env.passwords = { REMOTE_HOME_DIR = '/home/www/expomap/' LOCAL_HOME_DIR = '/home/alexander/projects/expomap/' +nginx_conf_tech = '/etc/nginx/sites-available/tech_work_hit.expomap.ru' nginx_conf = '/etc/nginx/sites-available/hit.expomap.ru' apache2_conf = '/etc/apache2/sites-available/proj.com' settings_conf = join(REMOTE_HOME_DIR, 'proj/settings.py') @@ -137,6 +138,14 @@ def migrate(app_name): run('python manage.py migrate {app_name}'.format(app_name=app_name)) +def devmode(state): + localdir = join(LOCAL_HOME_DIR, 'support/', env.role) + # nginx + conf = nginx_conf_tech if state else nginx_conf + put(join(localdir, basename(conf)), nginx_conf) + run('/etc/init.d/nginx reload') + + @stage(5) def t1451(): with cd(REMOTE_HOME_DIR): diff --git a/support/dev/hit.expomap.ru b/support/dev/hit.expomap.ru index 5c782da5..9d40cfb9 100644 --- a/support/dev/hit.expomap.ru +++ b/support/dev/hit.expomap.ru @@ -20,9 +20,6 @@ server { add_header Strict-Transport-Security "max-age=31536000;"; add_header Content-Security-Policy-Report-Only "default-src https:; script-src https: 'unsafe-eval' 'unsafe-inline'; style-src https: 'unsafe-inline'; img-src https: data:; font-src https: data:"; - - - client_header_timeout 360s; location / { auth_basic "Unauthorized"; diff --git a/support/dev/proj.com b/support/dev/proj.com index cebee129..8a7a9bac 100644 --- a/support/dev/proj.com +++ b/support/dev/proj.com @@ -1,5 +1,5 @@ - WSGIDaemonProcess www-data display-name=%{GROUP} processes=2 threads=2 + WSGIDaemonProcess www-data display-name=%{GROUP} processes=8 threads=2 WSGIProcessGroup www-data WSGIScriptAlias / "/home/www/proj/project.wsgi" ServerName 176.121.11.165 @@ -9,7 +9,7 @@ Allow from all IndexOptions FancyIndexing - + Alias /media "/home/www/proj/media/" Alias /static "/home/www/proj/static/" diff --git a/support/dev/tech_work_hit.expomap.ru b/support/dev/tech_work_hit.expomap.ru new file mode 100644 index 00000000..715269f8 --- /dev/null +++ b/support/dev/tech_work_hit.expomap.ru @@ -0,0 +1,81 @@ +server { +# server_name 176.121.11.165 expomap.ru www.expomap.ru dev.expomap.ru; + listen 80; + return 301 https://$host$request_uri; +} + +server { + listen 443; + server_name 176.121.11.165 www.expomap.ru expomap.ru dev.expomap.ru; + #ssl_stapling on; + ssl on; + ssl_certificate /etc/nginx/ssl/expomap.ru.crt; + ssl_certificate_key /etc/nginx/ssl/expomap.ru.key; + ssl_dhparam /etc/nginx/ssl/dhparam.pem; + ssl_session_timeout 24h; + ssl_session_cache shared:SSL:25m; + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_ciphers kEECDH+AES128:kEECDH:kEDH:-3DES:kRSA+AES128:kEDH+3DES:DES-CBC3-SHA:!RC4:!aNULL:!eNULL:!MD5:!EXPORT:!LOW:!SEED:!CAMELLIA:!IDEA:!PSK:!SRP:!SSLv2; + ssl_prefer_server_ciphers on; + add_header Strict-Transport-Security "max-age=31536000;"; + add_header Content-Security-Policy-Report-Only "default-src https:; script-src https: 'unsafe-eval' 'unsafe-inline'; style-src https: 'unsafe-inline'; img-src https: data:; font-src https: data:"; + + client_header_timeout 360s; + + error_page 503 /dev_work.html; + + location / { + return 503; + auth_basic "Unauthorized"; + auth_basic_user_file /home/www/proj/.htpasswd; + proxy_pass http://127.0.0.1:8080/; + proxy_redirect off; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $remote_addr; + + include /etc/nginx/geoip_proxy.conf; + + client_max_body_size 100m; + client_body_buffer_size 128k; + + proxy_connect_timeout 90; + proxy_send_timeout 90; + proxy_read_timeout 90; + proxy_buffer_size 16k; + proxy_buffers 256 8k; + proxy_busy_buffers_size 2000k; + proxy_temp_file_write_size 2048k; + } + + + location /965E1EE7949FD639CA0124C8D8C57774.txt { + root /home/www/proj/; + } + + location /4885b11a73674eb6d54593c1d7efd758821e5ee79b8132feecaba10560f0123a.html { + root /home/www/proj/support; + } + + + location /static { + root /home/www/proj; + } + location /media { + root /home/www/proj; + } + + location /templates { + root /home/www/proj/static; + } + location /subdmn { + root /home/old_files; + } + + location = /dev_work.html { + root home/www/proj/support/; + internal; + } + +} + diff --git a/support/dev_work.html b/support/dev_work.html new file mode 100644 index 00000000..c4c2df4b --- /dev/null +++ b/support/dev_work.html @@ -0,0 +1,25 @@ + + + Извините, идут технические работы + + + + + +
+
Извините, идут технические работы.
+ + diff --git a/support/prod/proj.com b/support/prod/proj.com index 3bf960e0..66235e9d 100644 --- a/support/prod/proj.com +++ b/support/prod/proj.com @@ -1,15 +1,15 @@ - WSGIDaemonProcess www-data display-name=%{GROUP} processes=8 threads=1 + WSGIDaemonProcess www-data display-name=%{GROUP} processes=16 threads=1 WSGIProcessGroup www-data WSGIScriptAlias / "/home/www/proj/project.wsgi" - ServerName hit.expomap.ru + ServerName hit.expomap.ru Order allow,deny Options Indexes FollowSymLinks Allow from all IndexOptions FancyIndexing - + Alias /media "/home/www/proj/media/" Alias /static "/home/www/proj/static/" diff --git a/templates/client/base_catalog.html b/templates/client/base_catalog.html index 04cb6d57..d50808a9 100644 --- a/templates/client/base_catalog.html +++ b/templates/client/base_catalog.html @@ -12,9 +12,9 @@
{% include 'client/includes/menu.html' %}
- {% comment %} {% include 'client/includes/feedback.html' %}
+ {% comment %} {% endcomment %} {# {% include 'client/includes/online_consult.html' %} #} diff --git a/templates/client/includes/feedback.html b/templates/client/includes/feedback.html index f37917a0..e1e25cb1 100644 --- a/templates/client/includes/feedback.html +++ b/templates/client/includes/feedback.html @@ -2,6 +2,6 @@ \ No newline at end of file +