Connect to Dagu Console with the trial in one step

Merged
YO
5d ago
+653-286

A fresh install had several ways to reach Dagu Console that didn't line up:

  • a trial link opened signup with no server attached;
  • a header button connected without choosing what to report;
  • a 15-minute request ran out while the owner signed up.

What changes:

  • One way to connect: the free monitoring card on Plan & features is the only entry point. It takes the report level and an optional "Also try paid features free for 14 days" checkbox, which asks the approval page (trial=1) to start the trial in the same approval. Feature prompts link to it with the trial ticked. A server on free monitoring starts the trial from its Console page.
  • Faster pickup: the page checks in when you come back to it from Console, whether to the tab or the window. The reporter checks in when Console's report response says the license changed (license_refresh). While the first report hasn't shown, monitoring refreshes every 3 seconds instead of every 30.
  • Longer wait: a connect request waits an hour for approval.
  • CLI: dagu license activate takes --report (or asks), names the level on the approval page, and saves it once approved.
  • Containers: without a terminal, the server logs the free monitoring offer.

Console side: dagucloud/cloud#41. It is backward compatible, and Dagu ignores license_refresh and trial=1 from older Console builds.

Verified end to end against a local Console:

  • fresh install → setup → Getting Started → connect with trial → sign up → approve → "Connected" on both sides, first report shown within seconds;
  • a failing DAG opens an alert in Console 4 seconds after the run;
  • connecting on free monitoring, then starting the trial in Console, shows the trial in Dagu on the next report with no action from the user;
  • cancelling in Dagu turns the open approval page into "stopped waiting".

Summary by cubic

Connecting to Dagu Console now has one entry point: the free monitoring card on Plan & features takes the report level and starts the 14-day trial in the same approval. The Console side is backward compatible, and older builds ignore the new fields.

Connecting

  • The header connect button, the standalone trial link, and the post-connect email prompt are gone; feature prompts link to the card with the trial pre-selected.
  • dagu license activate takes --report (or asks), names the level on the approval page, and saves it once approved.
  • Without a terminal, the server logs the free monitoring offer instead of printing a banner.

Faster pickup

  • Connect requests wait an hour for approval instead of 15 minutes.
  • The reporter checks in as soon as Console says the license changed, at most every 5 minutes.
  • The page reads monitoring every 3 seconds until the first report shows, and refreshes when you return from Console, in the tab or the window.

Summary by CodeRabbit

  • New Features

    • License activation now lets you choose a reporting level, with a default option when none is configured.
    • Eligible free-monitoring connections can include an optional 14-day trial of paid features.
    • Eligible Community license holders can access a free-monitoring link.
  • Improvements

    • Returning from Dagu Console refreshes license information, and newly connected monitoring reports are checked more promptly.
    • Trial and license-management links now reflect the current license type.