From 80ed46d46999eff6a89f26622d4dd4900e3b2ce6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Isma=C3=ABl=20Bouya?= Date: Wed, 21 Aug 2019 09:49:01 +0200 Subject: [PATCH] New configuration as of 2019-08-21 --- roles/contexts/fretlink/files/workdir/start | 14 ++++- .../fretlink/templates/environment.j2 | 60 ++++++++++++++++++- .../config_files/lxterminal/lxterminal.conf | 34 +++++------ .../files/config_files/openbox/lxde-rc.xml | 6 +- .../config_files/pcmanfm/LXDE/pcmanfm.conf | 4 +- roles/shell/bash/templates/bashrc.j2 | 4 ++ roles/tools/files/vimrc | 7 ++- roles/tools/templates/ssh_config.j2 | 5 ++ 8 files changed, 110 insertions(+), 24 deletions(-) diff --git a/roles/contexts/fretlink/files/workdir/start b/roles/contexts/fretlink/files/workdir/start index 840943a..8f440bf 100755 --- a/roles/contexts/fretlink/files/workdir/start +++ b/roles/contexts/fretlink/files/workdir/start @@ -1,6 +1,7 @@ #!/bin/bash APP="$1" +shift if [ -z "$APP" ]; then if [ $(dirname $(pwd)) = "$HOME/workdir" ]; then @@ -11,9 +12,12 @@ if [ -z "$APP" ]; then fi fi -if [ "$APP" != "psql" ]; then +if [ "$APP" != "psql" -a "$APP" != "pg_restore" ]; then cd $HOME/workdir/$APP source ../environment +elif [ "$APP" = "pg_restore" ]; then + source ../environment + APP=pg_restore else source ../environment APP=psql @@ -41,14 +45,22 @@ function start_psql() { psql -h $POSTGRESQL_ADDON_HOST -p $POSTGRESQL_ADDON_PORT -U $POSTGRESQL_ADDON_USER -d $POSTGRESQL_ADDON_DB } +function start_pg_restore() { + export PGPASSWORD=$POSTGRESQL_ADDON_PASSWORD + pg_restore -h $POSTGRESQL_ADDON_HOST -p $POSTGRESQL_ADDON_PORT -U $POSTGRESQL_ADDON_USER -d $POSTGRESQL_ADDON_DB +} + case "$APP${FLAVOR:+-}$FLAVOR" in "psql") start_psql;; + "pg_restore") start_pg_restore;; "app") start_app;; "admin-root") start_stack server;; + "admin-user") start_stack server;; "carrier-directory") start_stack server;; "freight") start_stack freight-server;; "notifier") start_stack notifier-exe;; "notifier-amqp") start_stack notifier-exe-amqp;; "pricer") start_stack pricer;; + "third-parties") start_stack server;; "toolbox") start_stack toolbox-api;; esac diff --git a/roles/contexts/fretlink/templates/environment.j2 b/roles/contexts/fretlink/templates/environment.j2 index 652fc8d..85d3dc7 100644 --- a/roles/contexts/fretlink/templates/environment.j2 +++ b/roles/contexts/fretlink/templates/environment.j2 @@ -50,6 +50,11 @@ APP=$(basename $(pwd)) FL_APPS_HOST="localhost" FL_APPS_SCHEME="http" +FL_ADMIN_USER_PORT=8078 +FL_ADMIN_USER_SECRET="{{ lookup('passwordstore', 'Travail/Fretlink/Macaroons/AdminUser subkey=Secret') }}" +FL_ADMIN_USER_PRIVATE_KEY="{{ lookup('passwordstore', 'Travail/Fretlink/Macaroons/AdminUser subkey=PrivateKey') }}" +FL_ADMIN_USER_URL="$FL_APPS_SCHEME://$FL_APPS_HOST:$FL_ADMIN_ROOT_PORT/api/" + FL_ADMIN_ROOT_PORT=8079 FL_ADMIN_ROOT_PRIVATE_KEY="{{ lookup('passwordstore', 'Travail/Fretlink/Macaroons/AdminRoot subkey=PrivateKey') }}" FL_ADMIN_ROOT_URL="$FL_APPS_SCHEME://$FL_APPS_HOST:$FL_ADMIN_ROOT_PORT/api/" @@ -69,12 +74,18 @@ FL_NOTIFIER_SECRET="{{ lookup('passwordstore', 'Travail/Fretlink/Macaroons/Notif FL_NOTIFIER_PRIVATE_KEY="{{ lookup('passwordstore', 'Travail/Fretlink/Macaroons/Notifier subkey=PrivateKey') }}" FL_NOTIFIER_URL="$FL_APPS_SCHEME://$FL_APPS_HOST:$FL_NOTIFIER_PORT/api" +FL_THIRD_PARTIES_PORT=8086 +FL_THIRD_PARTIES_SECRET="{{ lookup('passwordstore', 'Travail/Fretlink/Macaroons/ThirdParties subkey=Secret') }}" + FL_PRICER_PORT=8083 FL_PRICER_PRIVATE_KEY="{{ lookup('passwordstore', 'Travail/Fretlink/Macaroons/Pricer subkey=PrivateKey') }}" +FL_PRICER_SECRET="{{ lookup('passwordstore', 'Travail/Fretlink/Macaroons/Pricer subkey=Secret') }}" FL_FREIGHT_PORT=8084 FL_FREIGHT_SECRET="{{ lookup('passwordstore', 'Travail/Fretlink/Macaroons/Freight subkey=Secret') }}" +FL_HOMEPAGE_PORT=8085 + FL_BOOKKEEPING_SECRET="dummy" FL_LANE_EXPLORER_SECRET="dummy" @@ -112,6 +123,7 @@ if [ "$APP" != "app" ]; then export POSTGRESQL_ADDON_USER="$FL_PSQL_USER" export POSTGRESQL_ADDON_PASSWORD="$FL_PSQL_PASSWORD" export POSTGRESQL_ADDON_DB="$name" + export PG_URI="postgresql://$POSTGRESQL_ADDON_USER:$POSTGRESQL_ADDON_PASSWORD@localhost:$POSTGRESQL_ADDON_PORT/$POSTGRESQL_ADDON_DB" else key=Psql/$(capitalize $FL_ENV)/$(capitalize $APP) export POSTGRESQL_ADDON_HOST=$(p $key Host) @@ -119,7 +131,15 @@ if [ "$APP" != "app" ]; then export POSTGRESQL_ADDON_USER=$(p $key User) export POSTGRESQL_ADDON_PASSWORD=$(p $key) export POSTGRESQL_ADDON_DB=$(p $key Database) + export PG_URI="postgresql://$POSTGRESQL_ADDON_USER:$POSTGRESQL_ADDON_PASSWORD@$POSTGRESQL_ADDON_HOST:$POSTGRESQL_ADDON_PORT/$POSTGRESQL_ADDON_DB" fi + + export GRAYLOG_HOST="localhost" + export GRAYLOG_PORT="1111" + export ENVIRONMENT_NAME="local" + export APPLICATION_NAME="$APP" + export SENTRY_DSN="test" + export ACCEPTED_ORIGINS="*" fi if [ "$APP" = "app" ]; then @@ -140,6 +160,7 @@ if [ "$APP" = "app" ]; then # carrier directory export CARRIER_DIRECTORY_URI="$FL_CARRIER_DIRECTORY_URL/" export FRETLINK_CARDIR_URL="$FL_CARRIER_DIRECTORY_URL" + export FRETLINK_CARDIR_URL_FRONTEND="$FL_CARRIER_DIRECTORY_URL" export FRETLINK_CARDIR_ENABLED="true" export FRETLINK_CARDIRV3_ACCESS_KEY="$(build_macaroon $FL_CARRIER_DIRECTORY_SECRET carrier-directory carrier-directory carrier-directory::read)" @@ -160,6 +181,13 @@ if [ "$APP" = "app" ]; then export FRETLINK_NOTIFIER_AMQP_PORT="{{ lookup('passwordstore', 'Travail/Fretlink/Rabbitmq/Local/Notifier subkey=Port') }}" export FRETLINK_NOTIFIER_AMQP_VHOST="{{ lookup('passwordstore', 'Travail/Fretlink/Rabbitmq/Local/Notifier subkey=Vhost') }}" + # pricer + export FRETLINK_PRICER_USE_CARGO_OUTPUT="true" + export FRETLINK_PRICER_SHIPPER_PRICE_V2_KEY=$(build_macaroon $FL_PRICER_SECRET pricer pricer pricing::cargo) + export FRETLINK_PRICER_SHIPPER_PRICE_KEY=$(build_macaroon --old $FL_PRICER_SECRET pricer pricer internal-cargo-pricing) + export FRETLINK_PRICER_CARRIER_SUGGESTION_KEY=$(build_macaroon --old $FL_PRICER_SECRET pricer pricer internal-cargo-pricing) + export FRETLINK_PRICER_MACAROON="{{ lookup('passwordstore', 'Travail/Fretlink/Macaroons/PricerDev') }}" + export FRETLINK_PRICER_URL="{{ lookup('passwordstore', 'Travail/Fretlink/Macaroons/PricerDev subkey=Url') }}" # admin-root export FRETLINK_ADMINROOT_URL=$FL_ADMIN_ROOT_URL @@ -183,6 +211,24 @@ if [ "$APP" = "admin-root" ]; then export LANE_EXPLORER_MACAROON_SECRET=$FL_LANE_EXPLORER_SECRET fi +if [ "$APP" = "admin-user" ]; then + export BASE_URL=$FL_APPS_HOST + export API_ROOT="http://$BASE_URL:$PORT/api" + export UI_ROOT="http://$BASE_URL:$PORT/admin" + export ACCEPTED_ORIGINS="http://$BASE_URL:$PORT/admin" + export TOK="$(build_macaroon $FL_ADMIN_USER_PRIVATE_KEY admin-user admin-user admin-user::provisioning)" + export ADMIN_TOKEN="$(build_macaroon $FL_ADMIN_USER_SECRET admin-user admin-user admin-user::user-management)" + export SERVICE_TOKEN="$(build_macaroon $FL_ADMIN_USER_SECRET admin-user admin-user admin-user::some-service)" +fi + +if [ "$APP" = "homepage" ]; then + export HOMEPAGE_API_KEY="{{ lookup('passwordstore', 'Travail/Fretlink/Macaroons/HomepageDev subkey=ApiKey') }}" + export HOMEPAGE_API_ROOT_REDIRECT="https://next.www.fretlink.com" + export HOMEPAGE_API_BLOG_URL="https://blog.fretlink.com" + export HOMEPAGE_API_CIO_API_KEY="123" + export HOMEPAGE_API_CIO_SITE_ID="321" + fi + if [ "$APP" = "carrier-directory" ]; then export ADMIN_BASE_URL=$FL_APP_URL export ACCESS_KEY="$(build_macaroon $FL_CARRIER_DIRECTORY_SECRET carrier-directory carrier-directory carrier-directory::read)" @@ -194,7 +240,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_HOST="{{ lookup('passwordstore', 'Travail/Fretlink/Transporeon/ApiTest subkey=Host') }}" export TRANSPOREON_CALLBACK_USER="{{ lookup('passwordstore', 'Travail/Fretlink/Transporeon/NotifierCallbackTest subkey=Login') }}" export TRANSPOREON_CALLBACK_PASSWORD="{{ lookup('passwordstore', 'Travail/Fretlink/Transporeon/NotifierCallbackTest') }}" @@ -203,6 +249,7 @@ if [ "$APP" = "notifier" ]; then #export MACAROON="$(build_macaroon $FL_NOTIFIER_SECRET notifier notifier external)" # v1 export MACAROON="$(build_macaroon --old $FL_NOTIFIER_PRIVATE_KEY notifier notifier external)" + export MONITORING_MACAROON="$(build_macaroon --old $FL_NOTIFIER_PRIVATE_KEY notifier notifier monitoring)" # To push transporeon cargos to app export TRANSPOREON_APP_PUSH_URL="http://localhost:8080/api/transporeon/cargo" @@ -217,6 +264,17 @@ if [ "$APP" = "notifier" ]; then export AMQP_TLS="false" fi +if [ "$APP" = "third-parties" ]; then + export PROCTER_GAMBLE_APP_PUSH_MACAROON="$(build_macaroon $FL_APP_SECRET third-parties app app::proctergamble-cargos-write)" + export PROCTER_GAMBLE_APP_PUSH_URL="$FL_APPS_SCHEME://$FL_APPS_HOST:$FL_APP_PORT/api/proctergamble/cargo" + export TRANSPOREON_APP_PUSH_MACAROON="$(build_macaroon $FL_APP_SECRET third-parties app app::transporeon-cargos-write)" + export TRANSPOREON_APP_PUSH_URL="$FL_APPS_SCHEME://$FL_APPS_HOST:$FL_APP_PORT/api/transporeon/cargo" + export PROCTER_GAMBLE_CALLBACK_USER="{{ lookup('passwordstore', 'Travail/Fretlink/ProcterGamble/NotifierCallbackTest subkey=Login') }}" + export PROCTER_GAMBLE_CALLBACK_PASSWORD="{{ lookup('passwordstore', 'Travail/Fretlink/ProcterGamble/NotifierCallbackTest') }}" + export TRANSPOREON_CALLBACK_USER="{{ lookup('passwordstore', 'Travail/Fretlink/Transporeon/NotifierCallbackTest subkey=Login') }}" + export TRANSPOREON_CALLBACK_PASSWORD="{{ lookup('passwordstore', 'Travail/Fretlink/Transporeon/NotifierCallbackTest') }}" +fi + if [ "$APP" = "pricer" ]; then export GOOGLE_AUTH_CLIENT_ID="dummy" fi diff --git a/roles/lxde/files/config_files/lxterminal/lxterminal.conf b/roles/lxde/files/config_files/lxterminal/lxterminal.conf index ef04c89..82d5242 100644 --- a/roles/lxde/files/config_files/lxterminal/lxterminal.conf +++ b/roles/lxde/files/config_files/lxterminal/lxterminal.conf @@ -3,24 +3,24 @@ fontname=Monospace 10 selchars=-A-Za-z0-9,./?%&#:_ scrollback=1000 bgcolor=rgb(0,0,0) -fgcolor=rgb(170,170,170) +fgcolor=rgb(211,215,207) palette_color_0=rgb(0,0,0) -palette_color_1=rgb(170,0,0) -palette_color_2=rgb(0,170,0) -palette_color_3=rgb(170,85,0) -palette_color_4=rgb(0,0,170) -palette_color_5=rgb(170,0,170) -palette_color_6=rgb(0,170,170) -palette_color_7=rgb(170,170,170) -palette_color_8=rgb(85,85,85) -palette_color_9=rgb(255,85,85) -palette_color_10=rgb(85,255,85) -palette_color_11=rgb(255,255,85) -palette_color_12=rgb(85,85,255) -palette_color_13=rgb(255,85,255) -palette_color_14=rgb(85,255,255) -palette_color_15=rgb(255,255,255) -color_preset=VGA +palette_color_1=rgb(205,0,0) +palette_color_2=rgb(78,154,6) +palette_color_3=rgb(196,160,0) +palette_color_4=rgb(52,101,164) +palette_color_5=rgb(117,80,123) +palette_color_6=rgb(6,152,154) +palette_color_7=rgb(211,215,207) +palette_color_8=rgb(85,87,83) +palette_color_9=rgb(239,41,41) +palette_color_10=rgb(138,226,52) +palette_color_11=rgb(252,233,79) +palette_color_12=rgb(114,159,207) +palette_color_13=rgb(173,127,168) +palette_color_14=rgb(52,226,226) +palette_color_15=rgb(238,238,236) +color_preset=Tango disallowbold=false cursorblinks=false cursorunderline=false diff --git a/roles/lxde/files/config_files/openbox/lxde-rc.xml b/roles/lxde/files/config_files/openbox/lxde-rc.xml index 5003f15..db5393e 100644 --- a/roles/lxde/files/config_files/openbox/lxde-rc.xml +++ b/roles/lxde/files/config_files/openbox/lxde-rc.xml @@ -320,12 +320,12 @@ - bash -c "pamixer --allow-boost -u -i 1; v=$HOME/.cache/dunstify_volume; vol=`pamixer --get-volume`; color=`[ $vol -le 100 ] && echo normal || echo critical`; dunstify -r $(($(cat $v))) -p Volume --hints=int:value:$vol -i ' ' -a Openbox-volume -t 1000 -u $color > $v" + bash -c "pamixer --allow-boost -u -i 1; v=$HOME/.cache/dunstify_volume; vol=`pamixer --get-volume`; color=`[ $vol -le 100 ] && echo normal || echo critical`; dunstify -r $(($(head -n1 $v))) -p Volume --hints=int:value:$vol -i ' ' -a Openbox-volume -t 1000 -u $color > $v" - bash -c "pamixer --allow-boost -u -d 1; v=$HOME/.cache/dunstify_volume; vol=`pamixer --get-volume`; color=`[ $vol -le 100 ] && echo normal || echo critical`; dunstify -r $(($(cat $v))) -p Volume --hints=int:value:$vol -i ' ' -a Openbox-volume -t 1000 -u $color > $v" + bash -c "pamixer --allow-boost -u -d 1; v=$HOME/.cache/dunstify_volume; vol=`pamixer --get-volume`; color=`[ $vol -le 100 ] && echo normal || echo critical`; dunstify -r $(($(head -n1 $v))) -p Volume --hints=int:value:$vol -i ' ' -a Openbox-volume -t 1000 -u $color > $v" @@ -693,4 +693,4 @@ - \ No newline at end of file + diff --git a/roles/lxde/files/config_files/pcmanfm/LXDE/pcmanfm.conf b/roles/lxde/files/config_files/pcmanfm/LXDE/pcmanfm.conf index ad0422b..cd38b55 100644 --- a/roles/lxde/files/config_files/pcmanfm/LXDE/pcmanfm.conf +++ b/roles/lxde/files/config_files/pcmanfm/LXDE/pcmanfm.conf @@ -7,8 +7,10 @@ mount_removable=1 autorun=1 [autorun] -x-content/win32-software=pcmanfm +x-content/ebook-reader=pcmanfm x-content/bootable-media=pcmanfm +x-content/win32-software=pcmanfm +x-content/audio-player=pcmanfm [ui] always_show_tabs=0 diff --git a/roles/shell/bash/templates/bashrc.j2 b/roles/shell/bash/templates/bashrc.j2 index 2c5a999..1bf94e7 100644 --- a/roles/shell/bash/templates/bashrc.j2 +++ b/roles/shell/bash/templates/bashrc.j2 @@ -121,6 +121,10 @@ __prompt_command () { PS1+="$green\u@\h$blue \w \$$d " } +source /usr/share/fzf/key-bindings.bash +source /usr/share/fzf/completion.bash +export FZF_COMPLETION_TRIGGER='#' + {% if "nodejs" in features.get(profile, []) %} source /usr/share/nvm/init-nvm.sh {% endif %} diff --git a/roles/tools/files/vimrc b/roles/tools/files/vimrc index 3c61621..3ce13d1 100644 --- a/roles/tools/files/vimrc +++ b/roles/tools/files/vimrc @@ -30,6 +30,8 @@ Plug 'vim-scripts/slapd.vim' Plug 'vimwiki/vimwiki', { 'branch': 'dev' } Plug 'vim-vdebug/vdebug' Plug 'tpope/vim-fugitive' +Plug 'tpope/vim-rhubarb' +Plug 'shumphrey/fugitive-gitlab.vim' Plug 'tomlion/vim-solidity' Plug 'chrisbra/SudoEdit.vim' Plug 'Chiel92/vim-autoformat' @@ -37,6 +39,9 @@ Plug 'pearofducks/ansible-vim' Plug 'juliosueiras/vim-terraform-completion' Plug 'sjl/gundo.vim' Plug 'LnL7/vim-nix' +Plug 'purescript-contrib/purescript-vim' +Plug 'vmchale/dhall-vim' +Plug 'junegunn/fzf' call plug#end() @@ -297,6 +302,7 @@ map :tab split:exec("tag ".expand("")) map :vsp :exec("tag ".expand("")) let g:ctrlp_extensions = ['tag', 'buffertag', 'dir', 'undo', 'line'] +let g:ctrlp_max_files = 0 set modeline set grepprg=grep\ -rn\ $*\ /dev/null @@ -308,4 +314,3 @@ endif set list set listchars=tab:>-,trail:- - diff --git a/roles/tools/templates/ssh_config.j2 b/roles/tools/templates/ssh_config.j2 index 63cfe81..f5a6210 100644 --- a/roles/tools/templates/ssh_config.j2 +++ b/roles/tools/templates/ssh_config.j2 @@ -11,3 +11,8 @@ User gitolite Host immae.eu HostName immae.eu User immae + +Host 443.immae.eu +HostName 178.33.252.96 +User immae +Port 443 -- 2.41.0