mirror of
https://github.com/invariantlabs-ai/invariant-gateway.git
synced 2026-07-08 03:47:48 +02:00
Update the up() function to exit if the policies file path is not valid.
This commit is contained in:
@@ -10,7 +10,6 @@ class ProxyConfig:
|
||||
"""Common configurations for the Proxy Server."""
|
||||
|
||||
def __init__(self):
|
||||
print("hello in init of ProxyConfig")
|
||||
self.policies = self._load_policies()
|
||||
|
||||
def _load_policies(self) -> str:
|
||||
@@ -18,7 +17,6 @@ class ProxyConfig:
|
||||
Loads and validates policies from the file specified in POLICIES_FILE_PATH.
|
||||
Returns the policy file content as a string if valid; otherwise, raises an error.
|
||||
"""
|
||||
print("hello in load_policies")
|
||||
policies_file = os.getenv("POLICIES_FILE_PATH", "")
|
||||
|
||||
if not policies_file:
|
||||
|
||||
@@ -20,8 +20,11 @@ up() {
|
||||
shift
|
||||
done
|
||||
|
||||
if [[ -n "$POLICIES_FILE_PATH" ]]; then
|
||||
if [[ -n "$POLICIES_FILE_PATH" && -f "$POLICIES_FILE_PATH" ]]; then
|
||||
POLICIES_FILE_PATH=$(realpath "$POLICIES_FILE_PATH")
|
||||
else
|
||||
echo "Error: Specified policies file does not exist: $POLICIES_FILE_PATH"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Start Docker Compose with the correct environment variable
|
||||
|
||||
Reference in New Issue
Block a user