feat: cc-hook v1.0 - Claude Code 钩子服务
- Go HTTP 服务,监听 :8082 - 支持 Notification 和 Stop 事件 - 转发至 Gotify 推送通知 - Docker 多阶段构建 - 环境变量配置 - 详细中文 README 文档
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package main
|
||||
|
||||
import "os"
|
||||
|
||||
type Config struct {
|
||||
GotifyURL string
|
||||
GotifyToken string
|
||||
Port string
|
||||
}
|
||||
|
||||
func LoadConfig() Config {
|
||||
return Config{
|
||||
GotifyURL: getEnv("GOTIFY_URL", "http://47.121.181.112:40266"),
|
||||
GotifyToken: getEnv("GOTIFY_TOKEN", "AiousrPBE4Cn04C"),
|
||||
Port: getEnv("PORT", ":8082"),
|
||||
}
|
||||
}
|
||||
|
||||
func getEnv(key, fallback string) string {
|
||||
if v := os.Getenv(key); v != "" {
|
||||
return v
|
||||
}
|
||||
return fallback
|
||||
}
|
||||
Reference in New Issue
Block a user