Skip to content

D-STAR trigger conditions, Alerts page, dev Docker image - #7

Open
jbburns wants to merge 8 commits into
hamalert:mainfrom
jbburns:claude/dstar-alerting-functionality-xadhmf
Open

D-STAR trigger conditions, Alerts page, dev Docker image#7
jbburns wants to merge 8 commits into
hamalert:mainfrom
jbburns:claude/dstar-alerting-functionality-xadhmf

Conversation

@jbburns

@jbburns jbburns commented Sep 10, 2026

Copy link
Copy Markdown

Web app side of https://github.com/orgs/hamalert/discussions/17 (D-STAR presence alerts), companion to the hamalert/hamalert-server PR that adds the dstar source. Also adds an "Alerts" page and a dev Docker image; happy to split either into its own PR if preferred.

What's new

D-STAR trigger conditions

  • New "D-STAR" condition group in the trigger editor: D-STAR event (Active / Linked dropdown), D-STAR repeater/node and D-STAR reflector (free text or list). Input is uppercased and normalized, so ref030c, REF030 C and REF030-C all become REF030-C; the module letter is optional (REF030 matches every module).
  • Adding a node/reflector condition, or selecting the D-STAR source, auto-adds D-STAR event = Active, so link commands only alert when explicitly asked for.
  • dstar added to the source and mode lists, to the "too unspecific trigger" check, and to ajax/trigger_update.php's array-condition list.

Spots without a frequency

  • api/spots2.php no longer forces a missing frequency to 0 (the app would have shown 0.000).
  • myspot.php (QRZ badge) shows node/reflector instead of " MHz" for D-STAR spots and tolerates a missing spotter/unknown source.
  • Simulate page and ajax/simulateSpot.php accept D-STAR spots (event, node, reflector; frequency optional).

Docs: destination parameter reference (dvEvent, dvNode, dvReflector, dvSuffix, dvDuration; frequency/band/mode marked as absent for D-STAR), a new "How do D-STAR alerts work?" help section (help#dstar), about and news entries. config_clean.inc.php gains 'dstar' => 'D-STAR' in sources.

Alerts page (/alerts): lists the logged-in user's last 100 alerts of the last 24 hours across all actions, with D-STAR details; auto-refreshes every 15 s via ajax/alerts with Pause/Resume and Refresh-now buttons (pauses while the tab is hidden, stops on session expiry). Useful for testing and as a simple alert history.

Local development: Dockerfile.dev + docker/dev/ (php:8.3-apache, mongodb 1.x extension, composer, the root-level extensionless-URL rewrite), tools/router.php for PHP's built-in server, tools/seedLocalUser.php, and a "Running locally" README section. The image is what npm run local-dev in hamalert-server builds; it also runs standalone with just a MongoDB container. Composer packages live in a named volume so the checkout stays clean.

Testing

  • php -l on all touched files; JS syntax-checked.
  • Headless-browser run against the local stack: add a D-STAR reflector condition typed as ref030c → event auto-added as Active → saved as dvReflector: "REF030-C", dvEvent: "active"; simulate page sends a D-STAR spot that reaches the matcher and telnet; Alerts page shows it and auto-refreshes.

Demo

GIF walkthrough (trigger editor → help → destinations → simulate → Alerts page) and per-page screenshots are attached below.

🤖 Generated with Claude Code

jbburns and others added 7 commits September 10, 2026 04:47
Trigger editor: new "D-STAR" condition group with event (active/linked
dropdown), repeater/node and reflector (free text or list, normalized
to "W4HFH-C" / "REF030-C", module letter optional). Adding a D-STAR
condition or selecting the D-STAR source defaults the event condition
to "active" so link commands only alert when asked for. D-STAR is added
to the source and mode lists and to the too-unspecific trigger check.

Spots: the app feed no longer forces a missing frequency to 0, the QRZ
badge shows node/reflector instead of "MHz" for D-STAR spots, and the
simulator can send D-STAR spots without a frequency.

Docs: destination parameter reference, help section, about and news.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014rJsJxn47T1Bff6xi6g7ab
Replicates the .htaccess extensionless-URL rewrite so the web app can be
run with "php -S 127.0.0.1:8081 tools/router.php" against a local
MongoDB. Not used in production.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014rJsJxn47T1Bff6xi6g7ab
php:8.3-apache with the mongodb 1.x extension, gd, composer, mod_rewrite
and the root-level extensionless-URL rewrite that production serves from
outside the repo. The source is bind-mounted; the entrypoint runs
composer install and generates config.inc.php from the clean template
on first start. Built and run by "npm run local-dev" in hamalert-server.
Also ignores composer-generated vendor contents.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014rJsJxn47T1Bff6xi6g7ab
Podman builds fail on short names without a configured search registry;
docker.io/library/... works on both Docker and Podman.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Shows the last 100 spots that matched the logged-in user's triggers in
the last 24 hours, across all actions, with D-STAR event/node/reflector
details. Useful for testing and as a simple alert history.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The alert table is now rendered by a shared include and served as a
fragment by ajax/alerts, which the page fetches every 15 seconds. A
Pause/Resume button (state kept in localStorage) and a Refresh-now
button are provided; refreshing stops while the tab is hidden and when
the session has expired.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
README gains a "Running locally" section (Docker/Podman: MongoDB
container, dev image, seed user), tools/seedLocalUser.php creates a
test user from inside the container since e-mail registration does not
work locally, and the dev image README is aligned with the vendor
volume.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@jbburns

jbburns commented Sep 10, 2026

Copy link
Copy Markdown
Author
web-01-triggers web-02-editor-dstar-conditions web-03-trigger-saved web-04-help-dstar web-05-destinations-params web-06-simulate web-07-simulate-sent web-08-alerts web-09-alerts-paused

@jbburns

jbburns commented Sep 10, 2026

Copy link
Copy Markdown
Author
web-dstar-demo

Production serves the /api/* rewrite from webserver config outside the
repo; the dev Docker image relies on .htaccess, so the app's feed
(/api/spots2 etc.) 404ed there. Same rule as ajax/.htaccess.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant