From e2bd3751986c15c24f355abc7b8ad68446941ee9 Mon Sep 17 00:00:00 2001 From: Fabian Schlenz Date: Thu, 27 Oct 2022 15:03:52 +0200 Subject: [PATCH] Show authelia status. --- dps.rb | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/dps.rb b/dps.rb index 569b1b3..3be5699 100755 --- a/dps.rb +++ b/dps.rb @@ -9,7 +9,7 @@ COLOR_GRAY = "" COLOR_RESET = "" class Container - FIELDS = [:state, :dup, :ouroboros, :name, :vhosts, :nginx_allow, :status, :image, :ports] + FIELDS = [:state, :dup, :ouroboros, :name, :vhosts, :authelia, :status, :image, :ports] @@lengths = Hash.new(0) def initialize(data) @@ -47,7 +47,19 @@ class Container end end.uniq.join(" ") - set :nginx_allow, @data[:Labels][:"nginx_allow"] + #set :nginx_allow, @data[:Labels][:"nginx_allow"] + if vh=="" + set :authelia, "" + elsif @data[:Labels][:"authelia_policy"]=="one_factor" + set :authelia, "1#{COLOR_GRAY}FA#{COLOR_RESET}" + elsif @data[:Labels][:"authelia_policy"]=="two_factor" + set :authelia, "2#{COLOR_GRAY}FA#{COLOR_RESET}" + elsif @data[:Labels][:"authelia_policy"]=="bypass" + set :authelia, "#{COLOR_GREEN}BYP#{COLOR_RESET}" + else + set :authelia, "#{COLOR_RED}?#{COLOR_RESET}" + end + st = @data[:Status] if st.end_with?("(healthy)") st = COLOR_GREEN + st.gsub("(healthy)", "(v)") + COLOR_RESET