From f5cc836bd11034e9071d21af49d8a1a3ee1dc9cb Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Mon, 23 Apr 2018 04:17:56 +0100 Subject: [PATCH] bin/nb-update --- bin/nb-update | 5 +++++ etc/nginx/inc/https-only.conf | 6 ++++-- lib/php/db.php | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/bin/nb-update b/bin/nb-update index 51034c3e..b015bca3 100755 --- a/bin/nb-update +++ b/bin/nb-update @@ -118,6 +118,11 @@ for repo in $(nb_repos); do else cmd_root="true" + # NB 23.04.18: TODEL + [ "$(git config --get remote.origin.url)" = "git@git.nbdom.net:root.git" ] && git remote set-url origin git.nbdom.net:/home/git/root.git + [ "$(git config --get remote.origin.url)" = "git@git.nbdom.net:nbdom.git" ] && git remote set-url origin git.nbdom.net:/home/git/nbdom.git + [ "$(git config --get remote.origin.url)" = "git@git.nbdom.net:pi.git" ] && git remote set-url origin git.nbdom.net:/home/git/pi.git + [ -x bin/$name-install ] && cmd_root="$cmd_root && echo ' >$name-install' && bin/$name-install|sed 's/^/ /'" if [ "$cmd_root" != "true" ]; then eval "$cmd_root" diff --git a/etc/nginx/inc/https-only.conf b/etc/nginx/inc/https-only.conf index 280ca455..519d40d7 100644 --- a/etc/nginx/inc/https-only.conf +++ b/etc/nginx/inc/https-only.conf @@ -1,9 +1,11 @@ set $_https_only 0; if ( $scheme = http ) { set $_https_only 1; } -# Live is behind a load balancer which do only http queries -if ($http_x_forwarded_proto = "https") { set $_https_only 0; } if ( $https_only = "") { set $https_only ""; } if ( $https_only != "") { set $_https_only $https_only; } +if ( $scheme = https ) { set $_https_only 0; } +# Live is behind a load balancer which do only http queries +if ($http_x_forwarded_proto = "https") { set $_https_only 0; } + if ( $_https_only = 1 ) { return 301 https://$host$request_uri; } diff --git a/lib/php/db.php b/lib/php/db.php index fcd911ad..48ae1df2 100644 --- a/lib/php/db.php +++ b/lib/php/db.php @@ -265,7 +265,7 @@ class Db extends nb { #if (isset($this->pdo_error)) $this->conn->setAttribute($this->pdo_error[0], $this->pdo_error[1]); } catch (PDOException $e) { - $msg = 'Connection failed:'; + $msg = 'Database connection failed:'; foreach(['name','host','file'] as $p) { if (!empty($this->$p)) $msg .= " $p=".$this->$p; -- 2.47.3