Fail closed when Hermes local config is unreadable
This commit is contained in:
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env sh
|
||||
set -eu
|
||||
|
||||
config=/opt/data/config.yaml
|
||||
if [ ! -r "$config" ]; then
|
||||
echo "HERMES_START_REFUSED: managed config is not readable" >&2
|
||||
exit 78
|
||||
fi
|
||||
grep -Eq '^[[:space:]]+provider:[[:space:]]+["'\'']?custom["'\'']?[[:space:]]*$' "$config" || {
|
||||
echo "HERMES_START_REFUSED: provider is not custom" >&2
|
||||
exit 78
|
||||
}
|
||||
grep -Eq '^[[:space:]]+base_url:[[:space:]]+["'\'']?http://router:8081/v1["'\'']?[[:space:]]*$' "$config" || {
|
||||
echo "HERMES_START_REFUSED: local router URL is missing" >&2
|
||||
exit 78
|
||||
}
|
||||
|
||||
exec hermes gateway run
|
||||
|
||||
Reference in New Issue
Block a user