From 4dba5919dedda214300b94d68975717f2c411d94 Mon Sep 17 00:00:00 2001 From: "Pavel Turinsky (VM)" Date: Wed, 19 Aug 2020 07:05:56 +0200 Subject: [PATCH] SMAZAT: Upravy pro upgrade --- Makefile | 7 ------- mamweb/settings_prod.py | 9 +++++---- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 33e1f229..6ad72f63 100644 --- a/Makefile +++ b/Makefile @@ -63,8 +63,6 @@ schema_all.pdf: # Deploy to current *mamweb-test* directory deploy_test: - @if [ ${USER} != "mam-web" ]; then echo "Only possible by user mam-web"; exit 1; fi - @if [ `readlink -f .` != "/aux/akce/mam/www/mamweb-test" ]; then echo "Only possible in directory mamweb-test"; exit 1; fi @echo "Installing version from origin/test ..." git pull origin test git clean -f @@ -79,8 +77,6 @@ deploy_test: # Deploy to current *mamweb-prod* directory deploy_prod: - @if [ ${USER} != "mam-web" ]; then echo "Only possible by user mam-web"; exit 1; fi - @if [ `readlink -f .` != "/aux/akce/mam/www/mamweb-prod" ]; then echo "Only possible in directory mamweb-prod"; exit 1; fi @echo "Backing up production DB ..." ( cd -P .. && ./backup_prod_db.sh ) @echo "Installing version from origin/master ..." @@ -98,13 +94,10 @@ deploy_prod: # Sync test media directory with production sync_test_media: - @if [ ${USER} != "mam-web" ]; then echo "Only possible by user mam-web"; exit 1; fi - @if [ `readlink -f .` != "/aux/akce/mam/www/mamweb-test" ]; then echo "Only possible in /akce/mam/www/mamweb-test"; exit 1; fi rsync -av --delete /akce/mam/www/mamweb-prod/media/ ./media # Sync test database with production database sync_test_db: - @if [ ${USER} != "mam-web" ]; then echo "Only possible by user mam-web"; exit 1; fi pg_dump mam_test > dump-test-`date +"%Y%m%d_%H%M"`.sql pg_dump -Fc mam_prod > dump-prod.sql pg_restore -c -d mam_test dump-prod.sql diff --git a/mamweb/settings_prod.py b/mamweb/settings_prod.py index 918fd4b2..e883b5f2 100644 --- a/mamweb/settings_prod.py +++ b/mamweb/settings_prod.py @@ -28,7 +28,8 @@ DEBUG = False TEMPLATE_DEBUG = False ALLOWED_HOSTS = ['mam.mff.cuni.cz', 'www.mam.mff.cuni.cz', 'atrey.karlin.mff.cuni.cz', - 'mamweb.bezva.org','gimli.ms.mff.cuni.cz'] + 'mamweb.bezva.org','gimli.ms.mff.cuni.cz', + 'localhost'] # Database # https://docs.djangoproject.com/en/1.7/ref/settings/#databases @@ -37,7 +38,7 @@ DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'mam_prod', - 'USER': 'mam-web', + 'USER': 'user', 'TEST': { 'NAME': 'mam-prod-testdb', }, @@ -46,8 +47,8 @@ DATABASES = { import os -SERVER_EMAIL = 'mamweb-prod-errors@mam.mff.cuni.cz' -ADMINS = [('M&M ERRORs', 'mam-errors@mam.mff.cuni.cz')] +SERVER_EMAIL = 'mamweb-prod-errors@pokemon.ledoian.cz' +ADMINS = [('M&M ERRORs', 'mam-errors@pokemon.ledoian.cz')] # SECURITY: only send sensitive cookies via HTTPS