Initial updates server repository commit.

Reinitialize repository history and exclude generated OTA artifact outputs.

Made-with: Cursor
This commit is contained in:
2026-03-09 21:33:34 +08:00
commit a0ef7f430d
14 changed files with 1466 additions and 0 deletions

22
internal/app/config.go Normal file
View File

@@ -0,0 +1,22 @@
package app
import "os"
func LoadConfig() Config {
return Config{
Port: envOrDefault("PORT", "3001"),
Hostname: envOrDefault("HOSTNAME", "http://localhost:3001"),
UpdatesRoot: envOrDefault("UPDATES_ROOT", "updates"),
PrivateKey: os.Getenv("PRIVATE_KEY_PATH"),
AdminToken: os.Getenv("ADMIN_TOKEN"),
}
}
func envOrDefault(key string, fallback string) string {
v := os.Getenv(key)
if v == "" {
return fallback
}
return v
}