Commit graph

964 commits

Author SHA1 Message Date
abc6ebe798
Restore FluxCD auto-deployment via GitOps
Replace direct kubectl deployment with GitOps pattern:
- Build and push to git.mcintire.me registry using built-in token
- Commit updated image tag in k8s/deployment.yaml after each build
- FluxCD picks up the manifest change and handles the k8s rollout
- Remove Tailscale, kubectl, and ghcr.io dependencies
2026-02-18 16:15:43 -06:00
CI
33587fb866 chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1771448056-e22d385 [skip ci] 2026-02-18 20:55:46 +00:00
e22d385f6a
Disable APRS-IS connection when running mix tasks 2026-02-18 14:52:24 -06:00
ea54d0208b
format 2026-02-18 14:49:58 -06:00
9b1fa3ce50
Add mix parse_file task, fix datetime deprecation, update gitignore, fix cleanup worker test
- Fix PacketCleanupWorkerTest to use relative timestamps based on
  configured retention period rather than hardcoded 365-day assumption
  (was failing when PACKET_RETENTION_DAYS env var is set to a small value)
- Fix capture_aprs.py to use timezone-aware datetime.now(timezone.utc)
  instead of deprecated datetime.utcnow()
- Add bad_packets.txt to .gitignore
- Add mix task aprs.parse_file
2026-02-18 14:49:14 -06:00
CI
790f13cef6 chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1771445759-447a76b [skip ci] 2026-02-18 20:19:40 +00:00
447a76b3cc
update 2026-02-18 14:14:49 -06:00
FluxCD
e46e8ab3ea chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1771443290-d2910b5 [skip ci] 2026-02-18 19:36:13 +00:00
d2910b5475
Increase marker spidering spread to prevent icon overlap
Widen nearbyDistance, spiderfyDistanceMultiplier, and foot separation
to accommodate 120x32px marker labels that were overlapping when
spidered at close zoom levels.
2026-02-18 13:34:30 -06:00
33799f3f33
Only show movement trails for stations that are actually moving
- Add minimum movement threshold (100m) to skip stationary stations
- Add max hop distance (10km) to break trails at igate-hopping artifacts
- Require 3+ points per segment to filter noise from 2-point jumps
2026-02-18 13:34:30 -06:00
FluxCD
b875b7ab9e chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1771442126-3e47a83 [skip ci] 2026-02-18 19:20:10 +00:00
3e47a83f9d
Fix sidebar panel layout and dark mode support
- Remove duplicate slideover panel that was hidden behind the controls panel
- Fix toggle button positioning (was rendered above viewport at top:-9px)
- Remove conflicting high-specificity CSS that prevented mobile display:none
- Remove width:100vw on map so it properly resizes when panel opens
- Use theme-aware colors for panel background and navigation links
- Wrap navigation links in proper ul.menu for valid HTML and DaisyUI styling
2026-02-18 13:15:03 -06:00
3148b241da
Add Tidewave dev dependency for browser-based debugging 2026-02-18 13:15:03 -06:00
FluxCD
aebc410a8c chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1771440207-6a0c8de [skip ci] 2026-02-18 18:45:06 +00:00
6a0c8deb5e
Fix ETS table init, send failure handling, and deployment cleanup
- Initialize :aprsme ETS table in application.ex with message_number
  counter; was missing, causing crash in Is.send_message/1
- Trigger reconnect on gen_tcp.send failure instead of leaking the
  dead socket with active timers
- Remove cluster-only env vars from deployment (POD_IP, POD_NAME,
  POD_NAMESPACE, RELEASE_DISTRIBUTION, RELEASE_NODE) since
  CLUSTER_ENABLED=false
- Remove redundant APRS_PASSCODE secret ref now that APRS_PASSWORD
  is set as plaintext
2026-02-18 12:43:09 -06:00
FluxCD
224700361c chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1771440003-a39059e [skip ci] 2026-02-18 18:41:05 +00:00
a39059e14a
Add .envrc to gitignore 2026-02-18 12:39:41 -06:00
FluxCD
f0112f618e chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1771439107-a5d4f6c [skip ci] 2026-02-18 18:27:03 +00:00
a5d4f6c16c
Fix cancel_timer crash on nil timer ref during shutdown 2026-02-18 12:24:45 -06:00
FluxCD
528c64bfbc chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1771438938-f89eec8 [skip ci] 2026-02-18 18:23:03 +00:00
f89eec8877
Disable clustering with single replica 2026-02-18 12:21:58 -06:00
FluxCD
98d980ad6e chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1771438634-87dc076 [skip ci] 2026-02-18 18:19:02 +00:00
87dc076220
Set APRS_HOST and APRS_PASSWORD env vars
Connect to 204.110.191.232 instead of the default dallas.aprs2.net.
runtime.exs now reads APRS_HOST (over APRS_SERVER) and APRS_PASSWORD
(over APRS_PASSCODE) so both naming conventions work.
2026-02-18 12:16:54 -06:00
FluxCD
15dd528e05 chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1771438486-46e01cd [skip ci] 2026-02-18 18:15:02 +00:00
46e01cdea1
Scale down to 1 replica until clustering is needed 2026-02-18 12:14:25 -06:00
FluxCD
75d1784a3b chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1771438217-bd26556 [skip ci] 2026-02-18 18:12:01 +00:00
bd265564a2
Handle insufficient privileges in pg_stat_statements migration
Wrap CREATE EXTENSION in a PL/pgSQL DO block that catches
insufficient_privilege so the migration completes successfully
even when the DB user is not a superuser.
2026-02-18 12:09:56 -06:00
FluxCD
95c009db0d chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1771437137-d886f5d [skip ci] 2026-02-18 17:53:42 +00:00
d886f5d987
Fix migration init container env vars and ConnectionMonitor crash
- Add missing env vars to migration init container (PHX_HOST, PORT,
  APRS_PORT, APRS_CALLSIGN, APRS_PASSCODE) so runtime.exs config
  provider doesn't fail due to Kubernetes service discovery injecting
  APRS_PORT as a full URL
- Guard ConnectionMonitor.accepting_connections?/0 with Process.whereis
  to avoid crashing when the GenServer isn't started (e.g. cluster
  enabled but no libcluster topologies configured)
2026-02-18 11:51:56 -06:00
FluxCD
e71034dd47 chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1771434255-a72d50c [skip ci] 2026-02-18 17:08:35 +00:00
a72d50ca52
Update dependency version constraints and lock file
Loosen version pins for gettext, phoenix, swoosh, and gridsquare to allow
patch/minor updates, and update lock file to pick up latest releases.
2026-02-18 11:03:56 -06:00
FluxCD
f1b3a00882 chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1771433746-a0f72cf [skip ci] 2026-02-18 16:56:34 +00:00
FluxCD
06d09b590e chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1771368069-24c01d0 [skip ci] 2026-02-18 16:56:17 +00:00
a0f72cfd43
Run database migrations as init container on each deploy
Adds an init container that runs `bin/migrate` before app pods start,
ensuring migrations are applied on every deployment. Uses the existing
advisory lock in MigrationLock so only one pod runs migrations during
a rolling update.
2026-02-18 10:55:25 -06:00
FluxCD
f1ce1b1e03 chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1771368069-24c01d0 [skip ci] 2026-02-17 22:52:19 +00:00
24c01d00b0
Trigger CI build 2026-02-17 16:40:51 -06:00
e3b9e61d3c
Remove Docker Hub login - only need Forgejo registry 2026-02-17 16:39:12 -06:00
8a093ee590
Match towerops CI pattern for Forgejo registry builds 2026-02-17 16:35:56 -06:00
091a9ee2f6
Fix Forgejo Actions workflow - use github.* compat context 2026-02-17 16:17:54 -06:00
19661abec0
Use Forgejo-native context variables instead of GitHub 2026-02-17 16:13:24 -06:00
db34470e90
Use built-in Forgejo token for registry auth 2026-02-17 16:12:57 -06:00
a637b3b87c
Add k8s deployment manifests and FluxCD GitOps config
Kubernetes manifests for deploying to home cluster in the aprs
namespace with Forgejo Actions CI pipeline for building and
pushing container images to git.mcintire.me registry.
2026-02-17 16:11:27 -06:00
4366fa36da
Refactor conditionals to use multi-clause pattern matching
Replace case/cond/if blocks with multi-clause function dispatch
and pattern matching in function heads across 9 modules:
- WeatherUnits: case to multi-clause unit_system/1, unit_labels via do_unit_labels/1
- PacketUtils: if to pattern match on %{"id" => id}, multi-clause threshold/callsign
- SetLocale: case to multi-clause extract_locale/1
- IPGeolocation: if/cond to pattern match on conn, binary prefix matching for private_ip?
- DeviceIdentification: cond to extracted pattern_matches?/2
- MobileChannel: cond to multi-clause do_callsign_match/2
- PacketProcessor: cond to dispatch_visibility/6 on {in_bounds, has_marker} tuple
- PacketManager: destructure packet_state in heads, multi-clause maybe_cleanup/3
- AprsSymbol: case/if to multi-clause get_table_id/1, normalize_symbol_code/1
2026-02-10 17:15:49 -06:00
6b624e1365
more tests 2026-02-09 17:21:16 -06:00
094a50d183
Add tests for 14 modules with 0% coverage
Adds test files for:
- AprsIsConnection (83% coverage)
- Cluster.PacketDistributor (100%)
- Cluster.PacketReceiver (100%)
- Cluster.Topology (100%)
- ConnectionMonitor (78%)
- DbOptimizer (90%)
- DynamicSupervisor (100%)
- ErrorHandler (89%)
- MigrationLock (90%)
- MockHelpers (100%)
- PacketConsumerPool (90%)
- PacketCounter (100%)
- PacketPipelineSetup (75%)
- PacketPipelineSupervisor (100%)

Uses stub repo modules to test MigrationLock lock contention
paths without real multi-session PostgreSQL advisory lock
contention.
2026-02-09 17:19:50 -06:00
9d9cd881c1
fix some tests 2026-02-09 15:32:09 -06:00
0eccbd2ac7
Fix all remaining cyclomatic complexity issues
Resolves the final 5 Credo cyclomatic complexity issues by:

1. packet.ex: Create get_field_value/2 helper function
   - Replaces all `data[:field] || data["field"]` patterns
   - Reduces complexity in put_equipment_fields (11 -> 9)
   - Reduces complexity in put_phg_fields (12 -> 9)
   - Reduces complexity in put_standard_parser_fields (11 -> 9)

2. query_builder.ex: Use SQL fragment for weather_only query
   - Replaces multiple Elixir `or` operators with single SQL fragment
   - Reduces complexity from 10 to within limits

3. packet_utils.ex: Use SQL fragment for weather check query
   - Replaces multiple Elixir `or` operators with single SQL fragment
   - Reduces complexity from 11 to within limits

All 71 Credo issues now resolved:
- 14/14 warnings ✓
- 14/14 design suggestions ✓
- 40/40 refactoring issues ✓
- 3/3 code readability issues ✓

100% Credo compliance achieved!
2026-02-09 13:20:54 -06:00
072b145e73
Reduce cyclomatic complexity in streaming_packets_pubsub
Extract bounds validation helpers to reduce complexity:

- streaming_packets_pubsub.ex: Extract validation helpers
  Creates all_bounds_numeric?/4, valid_latitude_range?/1,
  valid_longitude_range?/1
  Moves complex boolean conditions into readable helper functions
  Reduces complexity from 13 to within limits

Fixes 1 Credo cyclomatic complexity issue (5 remaining).
2026-02-09 13:16:35 -06:00
6653678860
Reduce cyclomatic complexity in high-complexity functions
Extract helper functions to reduce complexity in functions with
complexity 10-15:

- packet.ex: Extract add_symbol_data/2
  Moves symbol data extraction into separate function
  Reduces complexity from 10 to 9

- mobile_channel.ex: Extract bounds validation helpers
  Creates all_numeric?/4, valid_latitudes?/2, valid_longitudes?/2
  Moves complex boolean conditions into readable helper functions
  Reduces complexity from 15 to within limits

- historical_loader.ex: Extract packet_has_valid_coordinates?/1
  Moves coordinate validation logic with multiple conditions
  Reduces complexity from 15 to within limits

Fixes 3 more Credo cyclomatic complexity issues.
2026-02-09 13:15:17 -06:00
9784cee344
Reduce cyclomatic complexity in multiple files
Extract helper functions to reduce cyclomatic complexity:

- telemetry/database_metrics.ex: Extract emit_packets_table_telemetry/7
  Moves multiple || 0 operators into separate function
  Reduces complexity from 10 to within limits

- packet_utils.ex: Extract build_weather_check_query/1
  Moves Ecto query building with multiple or conditions
  Reduces complexity from 11 to within limits

- packet.ex: Extract merge_extracted_data/3
  Moves telemetry and parser data merging logic
  Reduces complexity from 11 to within limits

Fixes 3 Credo cyclomatic complexity issues (7 remaining).
2026-02-09 13:13:15 -06:00