Add authelia base
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
4
lib/runtime/log/default.nix
Normal file
4
lib/runtime/log/default.nix
Normal file
@@ -0,0 +1,4 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
docker = import ./docker { inherit pkgs; };
|
||||
}
|
4
lib/runtime/log/docker/default.nix
Normal file
4
lib/runtime/log/docker/default.nix
Normal file
@@ -0,0 +1,4 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
postgres = import ./postgres { inherit pkgs; };
|
||||
}
|
6
lib/runtime/log/docker/postgres/default.nix
Normal file
6
lib/runtime/log/docker/postgres/default.nix
Normal file
@@ -0,0 +1,6 @@
|
||||
{ pkgs, ... }:
|
||||
pkgs.writeTextFile {
|
||||
name = "log-wrapper-docker-postgres";
|
||||
text = builtins.readFile ./wrapper.sh;
|
||||
executable = true;
|
||||
}
|
17
lib/runtime/log/docker/postgres/wrapper.sh
Normal file
17
lib/runtime/log/docker/postgres/wrapper.sh
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
|
||||
LOG_PIPE="$(mktemp -u)"
|
||||
mkfifo "$LOG_PIPE"
|
||||
|
||||
while IFS= read -r line; do
|
||||
if echo "$line" | grep -qE "ERROR|FATAL|PANIC"; then
|
||||
echo "$line" >&2
|
||||
else
|
||||
echo "$line" >&1
|
||||
fi
|
||||
done < "$LOG_PIPE" &
|
||||
|
||||
exec /usr/local/bin/docker-entrypoint.sh "$@" >"$LOG_PIPE" 2>&1
|
Reference in New Issue
Block a user