From: Ismaƫl Bouya Date: Wed, 28 Nov 2018 09:13:27 +0000 (+0100) Subject: ssh and tmux configuration fixes X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=d4357f69e1ccbb1c277f8978ea6f4a368b3ee3c2;p=perso%2FImmae%2FConfig%2FAnsible.git ssh and tmux configuration fixes --- diff --git a/roles/contexts/fretlink/templates/environment.j2 b/roles/contexts/fretlink/templates/environment.j2 index bb9328a..e5e2c64 100644 --- a/roles/contexts/fretlink/templates/environment.j2 +++ b/roles/contexts/fretlink/templates/environment.j2 @@ -8,6 +8,14 @@ if ! $(echo "$PATH" | grep -q "$DIR/toolbox/scripts"); then PATH="$DIR/toolbox/scripts:$PATH" fi +p() { + if [ -z "$2" ]; then + pass show Travail/Fretlink/$1 + else + pass show Travail/Fretlink/$1 | grep "^$2:" | sed -e "s/^$2: //" + fi | head -n1 +} + build_macaroon() { if [ "$1" = "--old" ]; then shift @@ -178,6 +186,7 @@ if [ "$APP" = "notifier" ]; then export TEMPLATES_ASSETS_BASE_URL="http://dummy/" export TRANSPOREON_USER="{{ lookup('passwordstore', 'Travail/Fretlink/Transporeon/ApiTest subkey=Login') }}" export TRANSPOREON_PASSWORD="{{ lookup('passwordstore', 'Travail/Fretlink/Transporeon/ApiTest') }}" + export TRANSPOREON_HOST="api.test.transporeon.com" export TRANSPOREON_CALLBACK_USER="{{ lookup('passwordstore', 'Travail/Fretlink/Transporeon/NotifierCallbackTest subkey=Login') }}" export TRANSPOREON_CALLBACK_PASSWORD="{{ lookup('passwordstore', 'Travail/Fretlink/Transporeon/NotifierCallbackTest') }}" diff --git a/roles/tools/files/ssh/rc b/roles/tools/files/ssh/rc index 35b7d34..32d1bd4 100644 --- a/roles/tools/files/ssh/rc +++ b/roles/tools/files/ssh/rc @@ -1,8 +1,9 @@ #!/bin/bash -if [ -n "$DISPLAY" ]; then - export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" - read protocol cookie - xauth remove $DISPLAY - xauth add $DISPLAY "$protocol" "$cookie" +if read proto cookie && [ -n "$DISPLAY" ]; then + if [ `echo $DISPLAY | cut -c1-10` = "localhost:" ]; then + echo add unix:`echo $DISPLAY | cut -c11-` $proto $cookie + else + echo add $DISPLAY "$protocol" "$cookie" + fi | xauth -q - fi diff --git a/roles/tools/templates/tmux.conf.j2 b/roles/tools/templates/tmux.conf.j2 index 07e88b9..57ddc2e 100644 --- a/roles/tools/templates/tmux.conf.j2 +++ b/roles/tools/templates/tmux.conf.j2 @@ -75,3 +75,4 @@ set-window-option -g window-status-bell-style fg=yellow,bold,underscore set -g default-terminal screen-256color set -g mouse on +set -g detach-on-destroy off