From 95d45661b3c1ea4e0e9a4f3cdfcce9cdc1abf16b Mon Sep 17 00:00:00 2001 From: Oliver Marks Date: Sat, 27 Jan 2018 21:55:26 +0000 Subject: [PATCH] Updated containerr versions --- README.org | 18 ++++++++++++++++-- compose/postgres/Dockerfile | 2 +- config/settings/common.py | 4 ++-- config/settings/local.py | 2 +- mhackspace/static/sass/components/_header.scss | 1 + requirements/base.txt | 4 ++-- 6 files changed, 23 insertions(+), 8 deletions(-) diff --git a/README.org b/README.org index a1dc19e..7b72b4e 100644 --- a/README.org +++ b/README.org @@ -111,12 +111,26 @@ Setup / create new certs letsencrypt certonly --renew --webroot -w /var/www/.well-known -d stage.maidstone-hackspace.org.uk letsencrypt certonly --webroot -w /var/www/.well-known -d stage.maidstone-hackspace.org.uk #+END_SRC +*** Postgres tips +Connect to the database inside container to run sql commands. +#+BEGIN_SRC bash +docker-compose -fstage.yml run --rm postgres psql -U postgres +#+END_SRC *** Backups +Create a backup file with today's date #+BEGIN_SRC bash -docker exec -t {CONTAINER_NAME} pg_dumpall -c -U postgres > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql +docker exec -t {CONTAINER_NAME} pg_dump -Fp -c -U postgresuser > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql #+END_SRC + +Import previously made backup #+BEGIN_SRC bash -docker exec -t {CONTAINER_ID} pg_dumpall -c -U postgres > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql cat dump_27-01-2018_14_26_09.sql | docker exec -i {CONTAINER_ID} psql -U postgres #+END_SRC + + +docker exec -i {CONTINERID} pg_restore -U postgresuser < ./dump_27-01-2018_18_16_45.sql +docker exec miq_latest bash -lc 'pg_dump --format custom vmdb_production' > /tmp/pg_dump.pgdata + + +docker exec {CONTAINERID} bash -lc 'pg_dump --format custom -U postgresuser' > pg_dump.pgdata diff --git a/compose/postgres/Dockerfile b/compose/postgres/Dockerfile index 950790d..d296e0a 100644 --- a/compose/postgres/Dockerfile +++ b/compose/postgres/Dockerfile @@ -1,4 +1,4 @@ -FROM postgres:10 +FROM postgres:9.6 # add backup scripts ADD backup.sh /usr/local/bin/backup diff --git a/config/settings/common.py b/config/settings/common.py index 093e7ad..075361c 100644 --- a/config/settings/common.py +++ b/config/settings/common.py @@ -368,8 +368,8 @@ SOCIALACCOUNT_QUERY_EMAIL = True AUTH_USER_MODEL = 'users.User' LOGIN_REDIRECT_URL = 'users:redirect' WIKI_ACCOUNT_HANDLING = False -WIKI_EDITOR = 'wiki.editors.martor.Martor' -WIKI_EDITOR_INCLUDE_JAVASCRIPT = False +# WIKI_EDITOR = 'wiki.editors.martor.Martor' +# WIKI_EDITOR_INCLUDE_JAVASCRIPT = False EDITOR_INCLUDE_JAVASCRIPT = False diff --git a/config/settings/local.py b/config/settings/local.py index 63dfecf..e97a0e9 100644 --- a/config/settings/local.py +++ b/config/settings/local.py @@ -17,7 +17,7 @@ from .common import * # noqa # DEBUG # ------------------------------------------------------------------------------ DEBUG = env.bool('DJANGO_DEBUG', default=True) -DEBUG = False + TEMPLATES[0]['OPTIONS']['debug'] = DEBUG # SECRET CONFIGURATION diff --git a/mhackspace/static/sass/components/_header.scss b/mhackspace/static/sass/components/_header.scss index a9b62de..3ce49d2 100755 --- a/mhackspace/static/sass/components/_header.scss +++ b/mhackspace/static/sass/components/_header.scss @@ -14,6 +14,7 @@ html { body { max-width: 100%; margin-bottom: 60px; + font-size: 14px; } .collapse.show.span-table { diff --git a/requirements/base.txt b/requirements/base.txt index efd5d0f..b971204 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -66,8 +66,8 @@ braintree==3.37.2 django-autofixture==0.12.1 git+https://github.com/olymk2/scaffold.git -git+git://github.com/olymk2/django-wiki.git -#git+git://github.com/django-wiki/django-wiki.git +#git+git://github.com/olymk2/django-wiki.git +git+git://github.com/django-wiki/django-wiki.git djangorestframework==3.6.3 djangorestframework-jwt