From: Ismaƫl Bouya Date: Wed, 27 Feb 2019 18:18:55 +0000 (+0100) Subject: Fix a few strings and configurations, and add a fl_restoreDump script X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=bf4da46633ce3682339ea01bf18c98562fa04c5d;p=perso%2FImmae%2FConfig%2FAnsible.git Fix a few strings and configurations, and add a fl_restoreDump script --- diff --git a/roles/contexts/fretlink/files/scripts/fl_restoreDump b/roles/contexts/fretlink/files/scripts/fl_restoreDump new file mode 100644 index 0000000..c76406b --- /dev/null +++ b/roles/contexts/fretlink/files/scripts/fl_restoreDump @@ -0,0 +1,19 @@ +#!/bin/bash + +if [ -z "$1" ]; then + echo "$(basename $0) zip-file-to-restore.zip" + exit 1 +fi + +file=$(pwd)/$1 + +cd $HOME/workdir/app + +unzip "$file" + +source ../environment +mongorestore --drop --uri $FRETLINK_MONGO_URI $(pwd)/.dump/ + +if [ -e "../fixtures" ]; then + source ../fixtures +fi diff --git a/roles/contexts/fretlink/files/scripts/fl_tmux_dev b/roles/contexts/fretlink/files/scripts/fl_tmux_dev index ca89e27..174c4a7 100644 --- a/roles/contexts/fretlink/files/scripts/fl_tmux_dev +++ b/roles/contexts/fretlink/files/scripts/fl_tmux_dev @@ -1,5 +1,9 @@ #!/bin/bash +tmux_conf() { + tmux -f $XDG_CONFIG_HOME/tmux/tmux.conf "$@" +} + type="${1:-bash}" if [ -n "$TMUX" ]; then m=switch-client @@ -17,14 +21,14 @@ if tmux has-session -t "$type" 2>/dev/null; then tmux $m -t "$type" else if [ "$type" = "remote" ]; then - tmux new-session -d -c $start_dir -s "$type" mosh immae.eu \; \ + tmux_conf new-session -d -c $start_dir -s "$type" mosh immae.eu \; \ $m -t "$type" elif [ -n "$start_dir" ]; then - tmux new-session -d -c $start_dir -s "$type" \; \ + tmux_conf new-session -d -c $start_dir -s "$type" \; \ $m -t "$type" \; \ new-window -c $start_dir elif [ -d "$HOME/workdir/$type" ]; then - tmux new-session -d -c "$HOME/workdir/$type" -s "$type" \; \ + tmux_conf new-session -d -c "$HOME/workdir/$type" -s "$type" \; \ $m -t "$type" \; \ send-keys "../start" C-m \; \ rename-window "running" \; \ diff --git a/roles/contexts/fretlink/tasks/main.yml b/roles/contexts/fretlink/tasks/main.yml index 0908eca..5b75f9b 100644 --- a/roles/contexts/fretlink/tasks/main.yml +++ b/roles/contexts/fretlink/tasks/main.yml @@ -100,6 +100,7 @@ - fl_tmux_dev - fl_vpn - fl_getDump + - fl_restoreDump - name: completion scripts copy: src: "scripts/_{{ item }}" diff --git a/roles/contexts/fretlink/templates/environment.j2 b/roles/contexts/fretlink/templates/environment.j2 index 36e4bfd..91a6f6a 100644 --- a/roles/contexts/fretlink/templates/environment.j2 +++ b/roles/contexts/fretlink/templates/environment.j2 @@ -58,7 +58,7 @@ FL_APP_URL="$FL_APPS_SCHEME://$FL_APPS_HOST:$FL_APP_PORT" FL_CARRIER_DIRECTORY_PORT=8082 FL_CARRIER_DIRECTORY_SECRET="{{ lookup('passwordstore', 'Travail/Fretlink/Macaroons/CarrierDirectory subkey=Secret') }}" FL_CARRIER_DIRECTORY_PRIVATE_KEY="{{ lookup('passwordstore', 'Travail/Fretlink/Macaroons/CarrierDirectory subkey=PrivateKey') }}" -FL_CARRIER_DIRECTORY_URL="$FL_APPS_SCHEME://$FL_APPS_HOST:$FL_CARRIER_DIRECTORY_PORT/api/" +FL_CARRIER_DIRECTORY_URL="$FL_APPS_SCHEME://$FL_APPS_HOST:$FL_CARRIER_DIRECTORY_PORT/api" FL_NOTIFIER_PORT=8081 FL_NOTIFIER_SECRET="{{ lookup('passwordstore', 'Travail/Fretlink/Macaroons/Notifier subkey=Secret') }}" @@ -149,14 +149,16 @@ if [ "$APP" = "app" ]; then export FRETLINK_AMAZON_PUBLIC_KEY="password" export FRETLINK_AMAZON_PRIVATE_KEY="password" export FRETLINK_GMAPS_API_KEY="password" + export FRETLINK_PASSWORD_REQUEST_SECRET="password" # secret export FRETLINK_MACAROON_SECRET=$FL_APP_SECRET # carrier directory - export CARRIER_DIRECTORY_URI="$FL_CARRIER_DIRECTORY_URL" + export CARRIER_DIRECTORY_URI="$FL_CARRIER_DIRECTORY_URL/" export FRETLINK_CARDIR_URL="$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)" # notifier export FRETLINK_NOTIFIER_API=$FL_NOTIFIER_URL @@ -183,6 +185,7 @@ if [ "$APP" = "app" ]; then # geodata export FRETLINK_GEODATA_API="{{ lookup('passwordstore', 'Travail/Fretlink/Macaroons/GeodataDev subkey=Url') }}" export FRETLINK_GEODATA_ACCESS_KEY="{{ lookup('passwordstore', 'Travail/Fretlink/Macaroons/GeodataDev') }}" + export GEODATA_URI="$FRETLINK_GEODATA_API" fi if [ "$APP" = "admin-root" ]; then @@ -199,6 +202,7 @@ 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)" fi if [ "$APP" = "notifier" ]; then diff --git a/roles/git/files/config_files/git/templates_fretlink/hooks/pre-push b/roles/git/files/config_files/git/templates_fretlink/hooks/pre-push index 1197641..e223b1c 100755 --- a/roles/git/files/config_files/git/templates_fretlink/hooks/pre-push +++ b/roles/git/files/config_files/git/templates_fretlink/hooks/pre-push @@ -1,11 +1,11 @@ #!/usr/bin/env bash echo "[+] Running the linter" -make lint +make -q lint output=$? -if [ "$output" = 1 ]; then - exit 1 -else +if [ "$output" = "2" ]; then exit 0 +else + make lint fi diff --git a/roles/lxde/files/config_files/libfm/libfm.conf b/roles/lxde/files/config_files/libfm/libfm.conf index 0d79919..1cf07b8 100644 --- a/roles/lxde/files/config_files/libfm/libfm.conf +++ b/roles/lxde/files/config_files/libfm/libfm.conf @@ -1,4 +1,4 @@ -# Configuration file for the libfm version 1.3.0.2. +# Configuration file for the libfm version 1.3.1. # Autogenerated file, don't edit, your changes will be overwritten. [config] diff --git a/roles/lxde/files/config_files/pcmanfm/LXDE/pcmanfm.conf b/roles/lxde/files/config_files/pcmanfm/LXDE/pcmanfm.conf index 75e164d..ad0422b 100644 --- a/roles/lxde/files/config_files/pcmanfm/LXDE/pcmanfm.conf +++ b/roles/lxde/files/config_files/pcmanfm/LXDE/pcmanfm.conf @@ -7,6 +7,7 @@ mount_removable=1 autorun=1 [autorun] +x-content/win32-software=pcmanfm x-content/bootable-media=pcmanfm [ui] diff --git a/roles/tools/files/ssh/known_hosts b/roles/tools/files/ssh/known_hosts index 92545ea..e219361 100644 --- a/roles/tools/files/ssh/known_hosts +++ b/roles/tools/files/ssh/known_hosts @@ -1,2 +1,3 @@ -immae.eu,git.immae.eu ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBM/7mizTNieTOU4i263zZeKBf/3U9O1rP7YEvR8qZWSFZXmEAlXsH3C+v2c1AS2udQpbgioKuqoRj2ZQImyScnU= +immae.eu ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBM/7mizTNieTOU4i263zZeKBf/3U9O1rP7YEvR8qZWSFZXmEAlXsH3C+v2c1AS2udQpbgioKuqoRj2ZQImyScnU= github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== +eldiron.immae.eu,git.immae.eu ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIFbhFTl2A2RJn5L51yxJM4XfCS2ZaiSX/jo9jFSdghF diff --git a/roles/tools/templates/youtube-viewer.conf.j2 b/roles/tools/templates/youtube-viewer.conf.j2 index 3107584..b12a0a1 100644 --- a/roles/tools/templates/youtube-viewer.conf.j2 +++ b/roles/tools/templates/youtube-viewer.conf.j2 @@ -1,6 +1,6 @@ #!/usr/bin/perl -# Youtube Viewer 3.3.4 - configuration file +# Youtube Viewer 3.5.1 - configuration file our $CONFIG = { auto_captions => 0, @@ -10,10 +10,13 @@ our $CONFIG = { clobber => 0, colors => 1, combine_multiple_videos => 0, + comments_order => "time", confirm => 0, convert_cmd => "ffmpeg -i *IN* *OUT*", convert_to => undef, copy_caption => 0, + custom_layout => 0, + custom_layout_format => "*NO*. *TITLE* (*AUTHOR*) (*RATING*) [*TIME*]\\n", dash_mp4_audio => 1, dash_support => 1, debug => 0, @@ -23,6 +26,7 @@ our $CONFIG = { downloads_dir => ".", env_proxy => 1, fat32safe => 0, + ffmpeg_cmd => "/usr/bin/ffmpeg", fullscreen => 0, get_captions => 1, get_term_width => 1, @@ -36,8 +40,12 @@ our $CONFIG = { interactive => 1, keep_original_video => 0, maxResults => 20, + merge_into_mkv => 1, + merge_into_mkv_args => "-loglevel warning -c:s srt -c:v copy -c:a copy -disposition:s forced", + merge_with_captions => 1, order => undef, page => 1, + prefer_mp4 => 0, publishedAfter => undef, publishedBefore => undef, regionCode => undef, @@ -85,5 +93,6 @@ our $CONFIG = { videoDuration => undef, videoLicense => undef, videoSyndicated => undef, + wget_cmd => "wget", youtube_video_url => "https://www.youtube.com/watch?v=%s", }