Compare commits

..

No commits in common. "a0bb698c02f594e93895ab5d2482dfa2124fd595" and "03b8b4baca706cce39c431f90f53480fbd581ddb" have entirely different histories.

3 changed files with 5 additions and 29 deletions

View File

@ -12,7 +12,7 @@ ln -sf "$SOURCE/dbash" "$TARGET/dbash"
ln -sf "$SOURCE/dhelp" "$TARGET/dhelp" ln -sf "$SOURCE/dhelp" "$TARGET/dhelp"
ln -sf "$SOURCE/dlogs" "$TARGET/dlogs" ln -sf "$SOURCE/dlogs" "$TARGET/dlogs"
ln -sf "$SOURCE/dlogsl" "$TARGET/dlogsl" ln -sf "$SOURCE/dlogsl" "$TARGET/dlogsl"
ln -sf "$SOURCE/drl" "$TARGET/drl" ln -sf "$SOURCE/dlr" "$TARGET/dlr"
ln -sf "$SOURCE/dps.rb" "$TARGET/dps" ln -sf "$SOURCE/dps.rb" "$TARGET/dps"
ln -sf "$SOURCE/dsh" "$TARGET/dsh" ln -sf "$SOURCE/dsh" "$TARGET/dsh"
ln -sf "$SOURCE/dstats" "$TARGET/dstats" ln -sf "$SOURCE/dstats" "$TARGET/dstats"

18
dps.rb
View File

@ -9,7 +9,7 @@ COLOR_GRAY = ""
COLOR_RESET = "" COLOR_RESET = ""
class Container class Container
FIELDS = [:state, :dup, :ouroboros, :name, :vhosts, :authelia, :status, :image, :ports] FIELDS = [:state, :dup, :ouroboros, :name, :vhosts, :nginx_allow, :status, :image, :ports]
@@lengths = Hash.new(0) @@lengths = Hash.new(0)
def initialize(data) def initialize(data)
@ -21,7 +21,7 @@ class Container
set :ouroboros, @data[:Labels][:"com.centurylinklabs.watchtower.enable"]=="true" ? "" : "" set :ouroboros, @data[:Labels][:"com.centurylinklabs.watchtower.enable"]=="true" ? "" : ""
set :name, @data[:Names].first[1..-1] set :name, @data[:Names].first[1..-1]
vh = @data[:Labels][:"nginx_virtual_host"]&.split(",")&.map{|h| h.split("@").first.strip} vh = @data[:Labels][:"nginx_virtual_host"]&.split(",")&.collect(&:strip)
if vh.nil? || vh.count==0 if vh.nil? || vh.count==0
vh = "" vh = ""
elsif vh.count==1 elsif vh.count==1
@ -47,19 +47,7 @@ class Container
end end
end.uniq.join(" ") 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] st = @data[:Status]
if st.end_with?("(healthy)") if st.end_with?("(healthy)")
st = COLOR_GREEN + st.gsub("(healthy)", "(v)") + COLOR_RESET st = COLOR_GREEN + st.gsub("(healthy)", "(v)") + COLOR_RESET

14
dup.rb
View File

@ -70,26 +70,14 @@ def get_sample(name="container")
- "/etc/localtime:/etc/localtime:ro" - "/etc/localtime:/etc/localtime:ro"
labels: labels:
# Syntax:
# <hostname>: Uses the given hostname and the default cert (*.schle.nz)
# <hostname>@: Uses the given hostname and the cert with the same name
# <hostname>@<cert>: Uses the given hostname and cert
nginx_virtual_host: container.home.schle.nz nginx_virtual_host: container.home.schle.nz
nginx_port: 80 nginx_port: 80
nginx_additional_ports: "443, 5050" nginx_additional_ports: "443, 5050"
nginx_allow: fabian # "user" or "@group" or "user, user, @group" or "all"
nginx_no_robots: true nginx_no_robots: true
nginx_public_paths: "/public, /api" nginx_public_paths: "/public, /api"
nginx_type: # "http" (default), "https", "fastcgi", "skip" (doesn't create any entries) nginx_type: # "http" (default), "https", "fastcgi", "skip" (doesn't create any entries)
nginx_client_max_body_size: "25M" nginx_client_max_body_size: "25M"
# Syntax:
# user:<username>
# group:<groupname>
authelia_allow: "user:fabian"
# Policies:
# one_factor
# two_factor
# bypass
authelia_policy: one_factor
networks: networks:
- "nginx" - "nginx"