feat: add deploy webhook endpoint (POST /api/v1/_deploy)

This commit is contained in:
user
2026-04-28 16:13:39 +09:00
parent dced20a9af
commit 510d95abd2
5 changed files with 56 additions and 0 deletions

View File

@@ -23,6 +23,7 @@ type Config struct {
LLMEndpoint string
GoogleClientID string
JWTSecret string
DeploySecret string
}
func LoadFromEnv() Config {
@@ -38,6 +39,7 @@ func LoadFromEnv() Config {
LLMEndpoint: envOrDefault("TUTOR_LLM_ENDPOINT", ""),
GoogleClientID: envOrDefault("GOOGLE_CLIENT_ID", ""),
JWTSecret: envOrDefault("JWT_SECRET", ""),
DeploySecret: envOrDefault("TUTOR_DEPLOY_SECRET", ""),
}
}
@@ -45,6 +47,10 @@ func (c Config) HasLLM() bool {
return c.LLMEndpoint != ""
}
func (c Config) HasDeploy() bool {
return c.DeploySecret != ""
}
func envOrDefault(key string, fallback string) string {
value := os.Getenv(key)
if value == "" {