feat: source Garmin credentials from the profile instead of env vars
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user