fix(uploads): Club Log is configured — it never needed an API key

The guard I added for services with no credentials demanded one, and
nobody has ever set it: OpsLog carries its own Club Log APPLICATION key
(clublogAppAPIKey), so the account is an email, a password and the
logbook callsign. An operator whose live upload had been working for
months was told the service was not configured the moment he sent QSOs by
hand after an import.

Written in app.go, the rules drifted from the uploaders on the first try.
They now live in internal/extsvc beside the Upload* functions that
enforce them, each case mirroring that function's own guard — which also
caught Cloudlog, where the station profile is required and the check did
not ask for it. The message names the fields actually missing rather than
listing everything the service takes.
This commit is contained in:
2026-09-06 18:06:06 +02:00
parent e8f9e68759
commit 2808bead97
4 changed files with 136 additions and 40 deletions
+9 -33
View File
@@ -11834,40 +11834,16 @@ func (a *App) UploadQSOsManual(service string, ids []int64) error {
return nil
}
// uploadConfigured reports whether a service has what it needs to be uploaded
// to at all — the credentials it cannot work without, not a guarantee they are
// correct. The service says whether they are; this says whether to ask.
// uploadConfigured reports whether a service can be uploaded to at all.
//
// The rules live in internal/extsvc, beside the uploaders that enforce them.
// Written here instead they drifted at once: Club Log was refused for a missing
// API key that nobody has ever set — OpsLog carries its own application key —
// and an operator whose live upload had worked for months was told his service
// was not configured.
func uploadConfigured(svc extsvc.Service, cfg extsvc.ExternalServices) error {
has := func(v string) bool { return strings.TrimSpace(v) != "" }
switch svc {
case extsvc.ServiceCloudlog:
if !has(cfg.Cloudlog.URL) || !has(cfg.Cloudlog.APIKey) {
return fmt.Errorf("Cloudlog / Wavelog is not configured — set its URL and API key in Settings → External services")
}
case extsvc.ServiceQRZ:
if !has(cfg.QRZ.APIKey) {
return fmt.Errorf("QRZ.com is not configured — set the logbook API key in Settings → External services")
}
case extsvc.ServiceClublog:
if !has(cfg.Clublog.Email) || !has(cfg.Clublog.Password) || !has(cfg.Clublog.APIKey) {
return fmt.Errorf("Club Log is not configured — set the account email, password and API key in Settings → External services")
}
case extsvc.ServiceHRDLog:
if !has(cfg.HRDLog.Callsign) || !has(cfg.HRDLog.Code) {
return fmt.Errorf("HRDLog.net is not configured — set the callsign and upload code in Settings → External services")
}
case extsvc.ServiceEQSL:
if !has(cfg.EQSL.Username) || !has(cfg.EQSL.Password) {
return fmt.Errorf("eQSL.cc is not configured — set the username and password in Settings → External services")
}
case extsvc.ServiceHamQTH:
if !has(cfg.HamQTH.Username) || !has(cfg.HamQTH.Password) {
return fmt.Errorf("HamQTH is not configured — set the username and password in Settings → External services")
}
case extsvc.ServiceLoTW:
if !has(cfg.LoTW.StationLocation) {
return fmt.Errorf("LoTW is not configured — set the TQSL station location in Settings → External services")
}
if err := extsvc.Configured(svc, cfg); err != nil {
return fmt.Errorf("%w (Settings → External services)", err)
}
return nil
}