Commit graph

18 commits

Author SHA1 Message Date
HB9HIL
5cf260a2da
resolve config path after ci_env was set to be more precise 2026-07-29 12:12:23 +02:00
HB9HIL
de89473db4
cron auth token in installer 2026-07-29 12:09:38 +02:00
Ronald de Heer
030004790e Switch to Personal Access Token (PAT) auth
Replaces the callsign+password → JWT flow with a single long-lived
Personal Access Token (pat_*), matching the GitHub/Stripe pattern.

User flow now:
  • Sign up on qrzcall.eu (Data or Extra subscription required)
  • Account → API Tokens → "Generate new token", label it
    (e.g. "Wavelog at home"), copy the pat_… string
  • Paste into Wavelog's "QRZCALL.EU API Token" config field

Why this is better than the previous credentials flow:
  • The user's QRZCALL.EU password never leaves the SPA
  • Each Wavelog install gets its own revocable token
  • A leaked Wavelog config exposes a single revocable token,
    not the password the user might reuse elsewhere
  • The library is simpler: no session cache, no retry-on-expiry,
    no /portable-aware re-auth dance — just Bearer on every call

Code changes:
  • application/libraries/Qrzcall.php  - drops session() and
    set_session(), keeps search() and sourcename(). ~30 LOC shorter.
  • application/libraries/Callbook.php - QRZCALL_SESSION_DURATION
    constant and qrzcall_session_cachekey property removed.
    _qrzcall() collapses from ~40 to ~20 LOC.
  • application/config/config.sample.php - qrzcall_username and
    qrzcall_password replaced with a single qrzcall_token.
  • install/config/config.php - same in the wizard's template.
  • install/index.php - the wizard now shows a single "API Token"
    field when QRZCALL.EU is selected (toggled via JS, no extra
    HTML page state machine). callbook_combination() validates
    the pat_ prefix when present.
  • install/includes/core/core_class.php - refactored to support
    both username/password-style providers (qrz/hamqth/qrzcq/qrzru)
    and token-style providers (qrzcall) cleanly. Drops the
    "all callbooks use the same shape" assumption.

End-to-end re-tested:
  ✓ Live PAT lookup PA4R via the new library                HTTP 200
  ✓ Unknown callsign XX9XX9XX                                error: "Callsign not found"
  ✓ Tampered token                                           error: "Invalid or revoked QRZCALL.EU API token"
  ✓ Subscription gate (Free user with revoked sub)          surfaces upstream 401
  ✓ php -l clean on all 6 files
  ✓ All 5 patches dry-run apply cleanly against fresh master

Existing JWT flow on api.qrzcall.eu/v1/auth/login.php remains
available — this PR moves Wavelog to the recommended pattern but
doesn't break anyone who already wired up JWT.
2026-05-14 10:59:42 +02:00
Ronald de Heer
50bd9e6f1b Add QRZCALL.EU as a callbook provider
QRZCALL.EU is a QRZ-compatible amateur-radio callsign database
(https://qrzcall.eu/). This adds it as a new 'qrzcall' callbook source
alongside the existing qrz, qrzcq, hamqth, and qrzru providers.

* `application/libraries/Qrzcall.php` — new library, mirrors Qrz.php
* `application/libraries/Callbook.php` — adds case 'qrzcall', `_qrzcall()`
  private method, session-duration constant and session-cache key
* `application/config/config.sample.php` — adds `qrzcall_username` /
  `qrzcall_password` defaults
* `install/index.php` — adds QRZCALL.EU to the install-wizard callbook
  dropdown and extends the tooltip
* `install/config/config.php` — adds `%qrzcall_username%` /
  `%qrzcall_password%` placeholders so the wizard writes the credentials
  into the generated config
* `install/includes/core/core_class.php` — adds 'qrzcall' to the
  $callbooks whitelist

Auth: callsign + password → JWT (cached 7h). The bearer pattern is
hidden behind the existing "session key" abstraction so the Callbook
orchestrator's retry-on-expiry and /portable fallback paths work
unchanged.

Access tier: requires a Data or Extra subscription on QRZCALL.EU.

XML schema: identical field names to QRZ.com → no downstream changes
to the QSO entry form.
2026-05-12 17:29:56 +02:00
HB9HIL
9661efa86e
security fixes
This commit squashes multiple security fixes related to the installer. It includes input validation for database names, proper escaping of URLs, and improved error handling in AJAX requests. These changes enhance the security of the installation process and prevent potential vulnerabilities.
2026-05-08 13:32:23 +02:00
HB9HIL
853c69de98 include qrz.ru in the installer 2025-04-13 11:48:06 +02:00
Fabian Berg
5972be9bf5 fix[installer] make sure the correct config dir is created if not existent 2025-04-09 09:09:55 +02:00
HB9HIL
eb18294ec2 allow passwordless db setup 2024-12-13 10:05:28 +01:00
HB9HIL
e904a0d8df feat[installer]: improve logging messages for config file operations 2024-12-03 10:22:22 +01:00
HB9HIL
6e7f852c26 feat[installer]: enhance database configuration process with detailed logging 2024-12-03 10:15:14 +01:00
HB9HIL
79c9559f4f fix[installer]: remove potential security issue with chmod 2024-12-03 10:05:53 +01:00
HB9HIL
14a52539c9 feat[installer]: added error logging to data validation 2024-12-03 10:04:48 +01:00
HB9HIL
40028805ab add qrzcq to the installer 2024-11-27 22:31:02 +01:00
HB9HIL
4568c6be1d strtoupper locator and callsign 2024-07-27 15:09:39 +02:00
HB9HIL
ec87c01504 drop doubled locator input 2024-07-24 13:14:34 +02:00
HB9HIL
3f40c62be3 log messages 2024-07-22 15:09:07 +02:00
HB9HIL
ea20a4f995 error handling 2024-07-21 19:06:44 +02:00
HB9HIL
3cc925d9ea next install refactoring 2024-07-21 17:48:02 +02:00
Renamed from install/includes/core_class.php (Browse further)