Skip to content

Commit bcef6a7

Browse files
committed
fix: allow placeholder GitHub key in dev mode and update Litestar CLI
- Allow placeholder GitHub private key 'ThisIsNotAProductionToken' in dev mode - Fix run-dev-server Makefile target to use LITESTAR_APP env var instead of deprecated --app flag - Resolves API server startup validation error in development - All services now start successfully (API, bot, frontend) - Add byte-docs-preview/ to .gitignore Fixes stability issues from Phase 3.5
1 parent 42ed8cf commit bcef6a7

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ next-env.d.ts
3030

3131
# project
3232
!/docs/web/api/lib/
33+
byte-docs-preview/

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ run-dev-bot: ## Run the bot in dev mode
355355
@cd services/bot && $(UV) run python -m byte_bot
356356

357357
run-dev-server: up-container ## Run the app in dev mode
358-
@cd services/api && $(UV) run litestar run --app byte_api.app:create_app --reload --debug
358+
@cd services/api && LITESTAR_APP=byte_api.app:create_app $(UV) run litestar run --reload --debug
359359

360360
run-dev-frontend: ## Run the app frontend in dev mode
361361
@cd services/api && $(UV) run tailwindcss -i src/byte_api/domain/web/resources/input.css -o src/byte_api/domain/web/resources/style.css --watch

services/api/src/byte_api/lib/settings.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,10 +398,14 @@ def validate_and_load_private_key(cls, value: str) -> str:
398398
Returns:
399399
The validated and loaded GitHub App private key.
400400
"""
401+
# Allow placeholder values in dev mode
402+
environment = os.getenv("ENVIRONMENT", "dev")
403+
if environment == "dev" and (not value or value == "ThisIsNotAProductionToken"):
404+
return value
405+
401406
try:
402407
decoded_key = base64.b64decode(value).decode("utf-8")
403408
except binascii.Error as e:
404-
environment = os.getenv("ENVIRONMENT", "dev")
405409
if environment != "dev":
406410
msg = "The GitHub private key must be a valid base64 encoded string"
407411
raise ValueError(msg) from e

0 commit comments

Comments
 (0)