managarten/services/mana-notify/internal/config/config.go
Till JS d3d11e661d feat(apps): create Hono compute servers for Traces, Planta, NutriPhi
Add lightweight Hono + Bun servers for server-only compute endpoints.
CRUD is handled by mana-sync, these handle AI + file upload only.

Traces: AI guide generation, location sync (Port 3026)
Planta: Photo upload (S3), AI plant analysis (Port 3022)
NutriPhi: AI meal analysis (photo+text), recommendations (Port 3023)

Each uses @manacore/shared-hono for auth/health/errors. ~100-200 LOC.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 16:16:57 +01:00

73 lines
1.8 KiB
Go

package config
import (
"github.com/manacore/shared-go/envutil"
)
type Config struct {
Port int
// Database
DatabaseURL string
// Redis
RedisHost string
RedisPort int
RedisPassword string
// Auth
ServiceKey string
ManaCoreAuthURL string
// SMTP (Brevo)
SMTPHost string
SMTPPort int
SMTPUser string
SMTPPassword string
SMTPFrom string
// Expo Push
ExpoAccessToken string
// Matrix
MatrixHomeserverURL string
MatrixAccessToken string
// Rate Limits
RateLimitEmailPerMinute int
RateLimitPushPerMinute int
// CORS
CORSOrigins []string
}
func Load() *Config {
return &Config{
Port: envutil.GetInt("PORT", 3040),
DatabaseURL: envutil.Get("DATABASE_URL", "postgresql://manacore:manacore@localhost:5432/mana_notify"),
RedisHost: envutil.Get("REDIS_HOST", "localhost"),
RedisPort: envutil.GetInt("REDIS_PORT", 6379),
RedisPassword: envutil.Get("REDIS_PASSWORD", ""),
ServiceKey: envutil.Get("SERVICE_KEY", "dev-service-key"),
ManaCoreAuthURL: envutil.Get("MANA_CORE_AUTH_URL", "http://localhost:3001"),
SMTPHost: envutil.Get("SMTP_HOST", "smtp-relay.brevo.com"),
SMTPPort: envutil.GetInt("SMTP_PORT", 587),
SMTPUser: envutil.Get("SMTP_USER", ""),
SMTPPassword: envutil.Get("SMTP_PASSWORD", ""),
SMTPFrom: envutil.Get("SMTP_FROM", "ManaCore <noreply@mana.how>"),
ExpoAccessToken: envutil.Get("EXPO_ACCESS_TOKEN", ""),
MatrixHomeserverURL: envutil.Get("MATRIX_HOMESERVER_URL", ""),
MatrixAccessToken: envutil.Get("MATRIX_ACCESS_TOKEN", ""),
RateLimitEmailPerMinute: envutil.GetInt("RATE_LIMIT_EMAIL_PER_MINUTE", 10),
RateLimitPushPerMinute: envutil.GetInt("RATE_LIMIT_PUSH_PER_MINUTE", 100),
CORSOrigins: envutil.GetSlice("CORS_ORIGINS", []string{"http://localhost:3000", "http://localhost:5173"}),
}
}