feat: source Garmin credentials from the profile instead of env vars

This commit is contained in:
2026-07-17 19:18:06 +02:00
parent c11dd152ba
commit 9cfa3e138e
2 changed files with 13 additions and 16 deletions

View File

@@ -30,11 +30,16 @@ func main() {
}
defer db.Close()
profile, err := db.GetProfile(context.Background())
if err != nil {
log.Fatalf("load profile: %v", err)
}
garminClient := garmin.NewClient(garmin.Config{
PythonPath: cfg.GarminPythonPath,
ServerPath: cfg.GarminServerPath,
GarminEmail: cfg.GarminEmail,
GarminPassword: cfg.GarminPassword,
GarminEmail: profile.GarminEmail,
GarminPassword: profile.GarminPassword,
TokenStorePath: cfg.GarminTokenStore,
})
defer garminClient.Close()
@@ -42,7 +47,6 @@ func main() {
syncSvc := appsync.NewService(garminClient, db, appsync.Config{
BackfillHorizonDays: cfg.BackfillHorizonDays,
MinConfidence: cfg.MinConfidence,
MaxHR: cfg.MaxHR,
}, nil)
server := api.NewServer(db, garminClient, syncSvc)