Skip to content

Commit d25d313

Browse files
ImTotemclaude
andcommitted
refactor(config): split SPICEDB_ENDPOINT into SPICEDB_HOST + SPICEDB_PORT
Eliminates duplication between endpoint string and port mapping in compose. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ddea860 commit d25d313

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ MONGO_VOLUME_PATH=/home/ubuntu/bcsd-data/mongo
4040

4141
# === Infrastructure ===
4242
# SpiceDB (권한 관리)
43-
SPICEDB_ENDPOINT=spicedb:50051
43+
SPICEDB_HOST=spicedb
4444
SPICEDB_PORT=50051
4545
SPICEDB_TOKEN=bcsd-dev-token
4646
DOMAIN=api.bcsdlab.com

docs/deploy-guide.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ bash infra/scripts/deploy.sh
126126
| `MONGO_PASSWORD` | MongoDB 비밀번호 | 랜덤 문자열 |
127127
| `MONGO_PORT` | MongoDB 호스트 포트 | `27017` |
128128
| `MONGO_VOLUME_PATH` | MongoDB 데이터 경로 | `/home/ubuntu/bcsd-data/mongo` |
129-
| `SPICEDB_ENDPOINT` | SpiceDB gRPC 주소 | `spicedb:50051` |
129+
| `SPICEDB_HOST` | SpiceDB 호스트 | `spicedb` |
130+
| `SPICEDB_PORT` | SpiceDB gRPC 포트 | `50051` |
130131
| `SPICEDB_TOKEN` | SpiceDB 인증 토큰 | 랜덤 문자열 |
131132
| `DOMAIN` | API 도메인 | `api.bcsdlab.com` |
132133
| `N8N_DOMAIN` | n8n 도메인 (선택) | `n8n.bcsdlab.com` |

src/bcsd_api/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ class Settings(BaseSettings):
1313
cors_origins: str = "http://localhost:3000"
1414
cookie_name: str = "access_token"
1515
cookie_secure: bool = True
16-
spicedb_endpoint: str = "spicedb:50051"
16+
spicedb_host: str = "spicedb"
17+
spicedb_port: int = 50051
1718
spicedb_token: str = ""
1819
slack_bot_token: str = ""
1920
slack_error_channel: str = ""

src/bcsd_api/dependencies.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ def _create_authz(endpoint: str, token: str) -> AuthzClient:
4141

4242

4343
def get_authz(settings: Settings = Depends(get_settings)) -> AuthzClient:
44-
return _create_authz(settings.spicedb_endpoint, settings.spicedb_token)
44+
endpoint = f"{settings.spicedb_host}:{settings.spicedb_port}"
45+
return _create_authz(endpoint, settings.spicedb_token)
4546

4647

4748
def get_member_repo(sheets: SheetsClient = Depends(get_sheets)) -> MemberRepository:

0 commit comments

Comments
 (0)