From 343bc960ebff5ddda109ee8697c5a87b1e712d7a Mon Sep 17 00:00:00 2001 From: Tim Sutton Date: Wed, 15 Nov 2017 13:42:21 +0100 Subject: [PATCH] Added btsync backup to makefile --- .gitignore | 2 ++ Makefile | 1 + btsync.env.template | 4 ++++ docker-compose.yml | 10 ++++++++++ inasafe.org.nginx.conf | 9 +++++++-- recover-after-space-full.sh | 3 +++ 6 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 btsync.env.template create mode 100755 recover-after-space-full.sh diff --git a/.gitignore b/.gitignore index 7911039..3e75bb3 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,5 @@ sftp_backup/target/db/* !sftp_backup/target/db/.gitkeep backups/* !backups/*.sh +sftp_backup/.sync/ +btsync.env diff --git a/Makefile b/Makefile index 33d4e89..dc70d02 100644 --- a/Makefile +++ b/Makefile @@ -28,6 +28,7 @@ web: @echo "Running " @echo "------------------------------------------------------------------" @DB_PASS=$(PASSWORD) MYSQL_PASS=$(PASSWORD) docker-compose -p $(PROJECT_ID) up -d wordpress + @docker-compose -p $(PROJECT_ID) up -d btsync dps diff --git a/btsync.env.template b/btsync.env.template new file mode 100644 index 0000000..522f9dc --- /dev/null +++ b/btsync.env.template @@ -0,0 +1,4 @@ +# This is InaSAFE WebSite data BitSync key +SECRET= +# Change it to easily identify your instance of btsync +DEVICE=InaSAFE-Website diff --git a/docker-compose.yml b/docker-compose.yml index 6ef1e3b..ade1295 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -83,3 +83,13 @@ db: # This will not work on OSX/Win - comment out for those oses # See https://github.com/tutumcloud/tutum-docker-mariadb/issues/5 - db:/var/lib/mysql + +btsync: + image: kartoza/btsync + hostname: inasafe.org-btsync + volumes: + - ./sftp_backup:/web + env_file: + - ./btsync.env + + diff --git a/inasafe.org.nginx.conf b/inasafe.org.nginx.conf index a6ed44a..ace19e5 100644 --- a/inasafe.org.nginx.conf +++ b/inasafe.org.nginx.conf @@ -1,7 +1,12 @@ upstream inasafe.org { server 127.0.0.1:8101; } - +# Redirect to inasafe.org if we come in from any other url +# see http://stackoverflow.com/a/19238614/3849375 +server { + server_name blog.inasafe.org staging.inasafe.org www.inasafe.org; + return 301 $scheme://inasafe.org$request_uri; +} server { # OTF gzip compression @@ -15,7 +20,7 @@ server { # the port your site will be served on listen 80; # the domain name it will serve for - server_name inasafe.org blog.inasafe.org staging.inasafe.org www.inasafe.org; + server_name inasafe.org; charset utf-8; diff --git a/recover-after-space-full.sh b/recover-after-space-full.sh new file mode 100755 index 0000000..4d7cfbf --- /dev/null +++ b/recover-after-space-full.sh @@ -0,0 +1,3 @@ +#!/bin/bash +docker rm inasafeorg_wordpress_1 +make web