Compare commits

..

2 Commits

2 changed files with 10 additions and 1 deletions

2
dps.rb
View File

@ -56,6 +56,8 @@ class Container
set :authelia, "2#{COLOR_GRAY}FA#{COLOR_RESET}" set :authelia, "2#{COLOR_GRAY}FA#{COLOR_RESET}"
elsif @data[:Labels][:"authelia_policy"]=="bypass" elsif @data[:Labels][:"authelia_policy"]=="bypass"
set :authelia, "#{COLOR_GREEN}BYP#{COLOR_RESET}" set :authelia, "#{COLOR_GREEN}BYP#{COLOR_RESET}"
elsif @data[:Labels][:"authelia_policy"]=="none"
set :authelia, "#{COLOR_GREEN}NONE#{COLOR_RESET}"
else else
set :authelia, "#{COLOR_RED}?#{COLOR_RESET}" set :authelia, "#{COLOR_RED}?#{COLOR_RESET}"
end end

7
dup.rb
View File

@ -152,6 +152,7 @@ def action_help
puts " --regenerate Generates YAML content from a running container." puts " --regenerate Generates YAML content from a running container."
puts " --all Use all containers defined in yml files." puts " --all Use all containers defined in yml files."
puts "-v, --verbose More verbose output." puts "-v, --verbose More verbose output."
puts "-q, --quiet Don't open log after starting a new container."
exit 1 exit 1
end end
@ -436,10 +437,12 @@ class Container
if ! @data["detach"] if ! @data["detach"]
self.attach self.attach
else else
unless $quiet
self.log self.log
end end
end end
end end
end
def regenerate def regenerate
c_data = `docker inspect #{@name}` c_data = `docker inspect #{@name}`
@ -476,6 +479,7 @@ needs_container = true
completion_str = "" completion_str = ""
silent_basedir = false silent_basedir = false
$net_host = false $net_host = false
$quiet = false
if ENV['DUP_DIR'] if ENV['DUP_DIR']
$base_dir = ENV['DUP_DIR'] $base_dir = ENV['DUP_DIR']
@ -497,6 +501,7 @@ opts = GetoptLong.new(
[ '--regenerate', GetoptLong::NO_ARGUMENT ], [ '--regenerate', GetoptLong::NO_ARGUMENT ],
[ '--verbose', '-v', GetoptLong::NO_ARGUMENT ], [ '--verbose', '-v', GetoptLong::NO_ARGUMENT ],
[ '--all', GetoptLong::NO_ARGUMENT ], [ '--all', GetoptLong::NO_ARGUMENT ],
[ '--quiet', '-q', GetoptLong::NO_ARGUMENT ]
) )
opts.each do |opt, arg| opts.each do |opt, arg|
@ -532,6 +537,8 @@ opts.each do |opt, arg|
$verbose = true $verbose = true
when '--all' when '--all'
container = Dir[$base_dir + "/*.yml"].sort.map{|f| Container.new(File.basename(f, ".yml"))} container = Dir[$base_dir + "/*.yml"].sort.map{|f| Container.new(File.basename(f, ".yml"))}
when '--quiet'
$quiet = true
end end
end end