Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ dependencies = [
"fastapi==0.118.0",
"httpx>=0.27.0",
"pydantic==2.12.5",
"pydantic-settings==2.13.1",
"regopy>=1.2.0",
"uvicorn==0.37.0",
]
Expand Down
11 changes: 11 additions & 0 deletions src/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from pydantic_settings import BaseSettings, SettingsConfigDict


class Settings(BaseSettings):
host: str = "127.0.0.1"
port: int = 8338

model_config = SettingsConfigDict(env_prefix="POLICY_SERVER_")


settings = Settings()
5 changes: 3 additions & 2 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import uvicorn

from src.config import settings
from src.server.server import app, get_registry
from src.server.models import ToolUseEvent, PostFileEditEvent

Expand All @@ -31,9 +32,9 @@ def main():
setup_all_policies()

print("Server ready with policy enforcement active!")
print("Starting server on http://localhost:8338")
print(f"Starting server on http://{settings.host}:{settings.port}")

uvicorn.run(app, host="0.0.0.0", port=8338, log_level="info")
uvicorn.run(app, host=settings.host, port=settings.port, log_level="info")


if __name__ == "__main__":
Expand Down
Loading