Commit Graph
29 Commits
Author SHA1 Message Date
agessaman 8d1c5ea9c0 build(web_viewer): vendor the last CDN libraries and keep them updated with Dependabot
Bootstrap 5.1.3, Font Awesome 6.0.0, Socket.IO 4.7.2 and Chart.js 4.4.0 are now served from static/vendor/ at the versions the CDNs served, so every page works on a LAN with no internet. Only map tiles still need it. The Content-Security-Policy drops jsDelivr and cdnjs.

Every vendored package, the map stack and login fonts included, is pinned in scripts/web-vendor/package.json and its lockfile. sync.mjs copies the listed files into static/, strips the source-map comment, empties each directory it owns first, and regenerates the version table in static/vendor/README.md; it reproduces the previously vendored files byte for byte. Font Awesome ships only its woff2 fonts, which every supported browser takes before the .ttf.

Dependabot watches that directory: security fixes as advisories land, grouped minor and patch releases monthly, majors one per PR. Dependabot can't regenerate the vendored files, so vendor-refresh.yml adds them to its PRs as a second commit and dispatches the tests, since a GITHUB_TOKEN push doesn't trigger them. It runs on pull_request_target, so it uses the base branch's sync.mjs, spells out its commands instead of running the PR's npm scripts, and installs with install scripts disabled. A new CI job re-runs the sync and fails if anything under static/ changes.

Tests now check that no template loads a script, stylesheet or font from another host, that every vendored file a template names exists, and that the CSP allows no CDN host. In Chrome, 12 pages load with no external request, failed load or console error.
2026-10-24 12:02:40 -07:00
agessaman 49b369025b fix(web_viewer): rebuild the browser packet decoder from meshcore-decoder 0.4.0
My fork of meshcore-decoder is now at 0.4.0, which brings it in line with current MeshCore firmware: encrypted PATH payloads, GRP_DATA and MULTIPART, region transport codes, the new request and text types, and the firmware's packet hash. 0.4.0 isn't published to npm, so build.sh now fetches the fork at a pinned commit (60733c0) and installs its runtime dependencies from the lockfile, still with install scripts disabled. Two builds produce byte-identical bundles.

The browser entry exports the same additions as the fork's lite entry (AnonRequestType, TextType and their name functions, PathPayloadDecoder) plus the region transport-code helpers.

The byte breakdown's hash fallback now uses the decoder's packetHash, which is the firmware hash the server sends. The old fallback hashed the hex text and never matched.

All 72,828 packets in the bot's database decode to the same payload type and path as the bot's own decoder, and packetHash matches the stored packet_hash on every one. Advert names and Public decryption are unchanged from 0.3.0. In the browser, Real-time loads without console errors, and 2-byte-hop packets, including a decrypted Public message, show the right header, path and payload in the byte breakdown.
2026-10-17 22:31:03 -07:00
agessaman c5ea5b8aa1 fix(web_viewer): rebuild the browser packet decoder from meshcore-decoder 0.3.0
The web viewer's static/js/meshcore-browser.mjs was an esbuild bundle of @michaelhart/meshcore-decoder at 0.2.7 or older, added without a record of its version or how it was built. Those versions read the path-length byte as a plain byte count, so every packet with 2- or 3-byte hops was misparsed from the path onward: wrong header and type, a path split into single bytes, garbage payload fields, garbled advert names and group text that never decrypted.

The bundle is rebuilt from 0.3.0, which takes the hop count from bits 0-5 and the hash size from bits 6-7. Twelve real packets from the bot's database (adverts, group text, direct messages and returned paths at 1, 2 and 3 bytes per hop) decode to the same hop count, path and payload as the bot's own decoder; multibyte adverts get their real names and a 2-byte-hop Public message decrypts, on the tape and in the byte breakdown.

scripts/meshcore-decoder-browser/ holds the browser entry the old bundle was built from (recovered from the bundle: it re-exports the library and routes Ed25519's SHA-512 through crypto-js so signatures verify on a plain-HTTP page) and build.sh, which fetches the published package, installs its runtime dependencies with install scripts disabled and bundles it with a pinned esbuild in a temporary directory. It reproduces the committed bundle byte for byte. The unused meshcore-browser.min.mjs is removed, and the multibyte workarounds from the byte breakdown polish (skipping the browser decode and saying so) are taken out again.
2026-10-17 20:13:15 -07:00
agessaman 98893a4e4f chore(release): prepare v1.1.0 2026-09-14 20:47:09 -07:00
agessaman 99e976eca0 feat: Improve ARMv7 installation process with piwheels support
- Updated `install-service.sh` to source `scripts/armv7_pip_args.sh`, ensuring consistent handling of pip arguments for 32-bit ARM hosts.
- Enhanced `constraints-armv7.txt` to clarify the need for specific package versions to avoid installation issues (issue #269).
- Modified `README.md` to document the application of piwheels index and constraints during installation on 32-bit ARM systems.
- Added tests to verify the correct integration of the ARMv7 pip arguments helper and its behavior across different architectures.
2026-09-05 08:46:05 -07:00
agessaman 2fea97b21d fix(venv): rewrite shebangs for console scripts after virtualenv relocation
This update ensures that console scripts in the virtual environment do not retain outdated shebangs pointing to temporary build paths. The `--update-venv` command now rewrites shebangs in place, allowing broken installs to recover without a full rebuild. Additionally, all pip invocations now use `python -m pip` to prevent issues with stale shebangs. This change addresses issue #229 and improves the overall reliability of the service installation process.
2026-08-07 21:38:12 -07:00
agessaman 43961be949 fix(service): move StartLimit* to [Unit] so the restart limit applies
StartLimitInterval and StartLimitBurst were set under [Service], where
systemd 230 and later ignore them — they moved to [Unit] in 2016. The
unit silently fell back to the system defaults of 5 starts in 10 s, and
because RestartSec=10 spaces attempts further apart than that window,
the limiter could never trip: a bot that could not reach its radio
restarted every 10 seconds indefinitely instead of stopping in failed
state.

Moved to [Unit] as StartLimitIntervalSec=60 / StartLimitBurst=3, the
values the file already declared. Applied to both the shipped unit and
the one generated for the .deb, which had drifted the same way.
2026-08-07 13:44:42 -07:00
agessaman b8b1647b27 feat(retention): enhance data retention and resource limits for Raspberry Pi
- Implemented chunked deletion for data retention, allowing for smoother cleanup processes without monopolizing SQLite's writer lock.
- Configured retention settings to delete in batches with pauses, improving performance on SD-card installations.
- Updated Linux service installers to allocate 1GB of memory and 200% CPU, providing better resource management for Raspberry Pi workloads.
- Added detailed configuration examples for Raspberry Pi in documentation to guide users on optimal settings.
2026-07-30 08:06:21 -07:00
agessaman d6275d79d8 chore(release): prepare 1.0.0
Promote the pending 0.9.4 release to 1.0.0 and polish the release
metadata before tagging.

- Bump the version in pyproject.toml and the packaging docs assertion.
- Reframe the CHANGELOG entry as the first stable release, and add the
  user-visible changes that shipped without entries: flexible command
  prefixes, per-channel flood scope, packet-capture payload decoding,
  startup config validation, MOWAS region scoping, hops/RSSI
  placeholders, help-command channel overrides, webhook readiness, and
  NWS coverage detection.
- Backfill CHANGELOG entries for 0.9.1, 0.9.2, and 0.9.3, which were
  tagged but never documented, and add compare links for each.
- Credit external contributors for 0.9.1 and 1.0.0.
- Document the opt-in sender-language detection in the upgrade guide,
  alongside the existing optional-extras sections.
- build-deb.sh: fail loudly when the version cannot be read from
  pyproject.toml instead of falling back to a hardcoded 0.9.1, which
  would stamp a release build with an apparent downgrade.
2026-07-28 13:38:46 -07:00
agessaman 7c64a6e365 fix(installer): preserve alternative command symlinks 2026-07-28 12:08:01 -07:00
agessaman 65ed0d941f ci: verify base wheel geocoding fallback 2026-07-28 12:02:14 -07:00
agessaman f67858b238 fix(installer): preserve custom alternative commands 2026-07-28 11:57:39 -07:00
agessaman 9ae9ebb327 Harden P0 security and release boundaries 2026-07-16 10:21:50 -07:00
agessaman c5bcfb3f26 feat(config): enhance connection configuration and documentation
- Updated `config.ini.example`, `config.ini.minimal-example`, and `config.ini.quickstart` to clarify connection type precedence and required keys for serial, BLE, and TCP connections.
- Added detailed comments and examples for each connection type, ensuring users understand how to configure their connection settings effectively.
- Introduced a new `[Service_Overrides]` section in `config.ini.example` for alternative service plugin implementations, improving extensibility.
- Enhanced documentation in `configuration.md` to reflect these changes and provide clearer guidance on connection options and templates.
2026-07-09 23:25:11 -07:00
agessaman b55a8b994c chore(version): bump version to 0.9.1
Updated the project version in pyproject.toml to 0.9.1 and adjusted the version retrieval logic in build-deb.sh to reflect this change. This ensures consistency across the project versioning.
2026-05-16 12:21:50 -07:00
agessaman 61ee86168b chore(workflows): exclude dist directory from shellcheck
Updated the GitHub Actions workflow to exclude the dist directory from shellcheck checks, ensuring cleaner linting results.

fix(command_manager): reorder datetime import

Moved the datetime import to the correct position in command_manager.py for better code organization.

fix(reload_config): improve config value retrieval

Refactored the _read_config_value function in reload_config.sh to ensure default values are returned correctly when the key is not found in the config file.

fix(tests): adjust imports in test_scheduler_logic

Updated import statements in test_scheduler_logic.py for consistency and clarity.
2026-05-16 12:11:51 -07:00
Stacy Olivas 773b80f6ae feat: bot admin HTTP server + reload_config.sh CLI
- core.py: add _BotAdminServer daemon thread (Flask, 127.0.0.1 only,
  bearer token auth); POST /api/admin/reload calls reload_config() and
  returns JSON {success, message}; GET /api/admin/health; started from
  start() when [Admin] enabled = true and token is set
- scripts/reload_config.sh: curl wrapper for the reload API; reads
  port/token from config.ini [Admin] section; exits 1 on rejection
- tests/test_core.py: TestBotAdminServer — 7 tests covering server
  creation, missing token guard, reload success/failure/auth, health
2026-04-14 10:07:04 -07:00
Stacy Olivas 7679eb7e2c fix: ruff and mypy compliance across utility scripts and tests
Fix ruff violations (import sort, unused imports, whitespace) in
backup_database.py, generate_website.py, meshcore_bot.py,
migrate_webviewer_db.py, packet_capture_service.py, version_info.py,
scripts/config_tui.py, scripts/update_todos.py, and validate_config.py.

Fix mypy stale type-ignore and remove unused imports in test files.
Add is_radio_zombie/is_radio_offline mock attributes to command_manager
test fixtures to prevent truthy Mock early returns.
2026-04-14 10:02:36 -07:00
Stacy Olivas ce7adc55f8 ci: add log injection regression check to CI pipeline
Add scripts/check_log_injection.py to scan for unsanitized variables in
log calls and fail CI if new violations are introduced. Baseline is
committed at zero violations after fixing all 26 pre-existing ones.

Update TESTING.md with instructions for running the check locally.
2026-04-14 10:02:36 -07:00
agessaman f4efcc792d fix(ci): restore frontend lockfile, satisfy ShellCheck, add schedule dep 2026-04-03 11:26:45 -07:00
agessaman 0e1372e3d4 Enhance package data validation and error handling in scripts
- Added a trap command in `check-package-data.sh` to ensure cleanup of temporary files on exit.
- Improved error handling in `context_checkpoint.sh` for flushing pending bugs to `BUGS.md`, providing warnings if write operations fail.
- Implemented file locking in `post_tool_counter.sh` to ensure atomic increment of the tool counter, preventing race conditions.

These changes improve the reliability and robustness of package data checks and related scripts.
2026-04-02 10:57:58 -07:00
agessaman 9b924a9db4 Add check-package-data.sh to verify dist config 2026-03-19 06:21:03 -07:00
agessaman 116bd74882 Update project configuration and dependencies
- Expanded package data in `pyproject.toml` to include additional static files for the web viewer.
- Removed testing dependencies from `requirements.txt`, noting that they are now included in pyproject extras.
- Updated the base HTML template to reference the manifest from the Flask static folder.
- Modified the build script to exclude `.cursor` files and updated documentation URLs to the correct repository.
- Changed the installation command in the build script to use `requirements.txt` instead of the previous method.
2026-03-19 06:18:29 -07:00
Stacy Olivas e9f4240704 docs: record CI fix commits in BUGS.md and TODO.md
Log ruff/mypy/ShellCheck fixes (e0eae09) and Python 3.9 matrix
removal (92c5910) in BUGS.md fixed section; update TODO.md
last-updated line to reflect current CI status.
2026-03-17 21:01:07 -07:00
Stacy Olivas 6d9d01ee4f docs: update README, config example, and tracking files for v0.9.0
- README: reflect all new features, installation steps, Python 3.9
  minimum requirement, and updated configuration reference
- config.ini.example: add [Aliases], [Webhook], [Rate_Limits],
  [Logging] json_logging, [Path_Command] geographic_scoring_enabled,
  [Web_Viewer] web_viewer_password, and all new scheduler/backup options
- BUGS.md, TESTING.md, TODO.md: updated to reflect current state
- scripts/update_todos.py: updated scan output
2026-03-17 17:45:10 -07:00
Stacy Olivas a2cb8d6777 infra: ncurses config TUI via scripts/config_tui.py
Add scripts/config_tui.py: browse, edit, save, validate, and migrate
config.ini interactively. Key bindings: r rename key, a add key+value,
d/Delete remove key with confirmation. Dynamic sections such as
[Scheduled_Messages] suppress the unknown-key ? marker. Access via
make config or CONFIG=path make config.
2026-03-17 17:43:04 -07:00
Stacy Olivas 5380bc5d5d infra: .deb packaging via scripts/build-deb.sh
Add scripts/build-deb.sh using fakeroot and dpkg-deb to produce a
Debian package. Includes DEBIAN/control, postinst (venv setup, systemd
enable), prerm (systemd stop), and postrm (cleanup). Add make deb
target. Update install-service.sh and uninstall-service.sh for current
paths and Python version.
2026-03-17 17:42:54 -07:00
Stacy Olivas bdd71b2762 infra: initial test suite and project tracking files
Test modules:
- test_enums: enum values and flag combinations
- test_models: MeshMessage dataclass field and type validation
- test_transmission_tracker: full TransmissionTracker coverage
- test_message_handler: path parsing, RF correlation, message routing
- test_repeater_manager: role detection, ACL, device type classification
- test_core: config loading, radio settings, reload paths

Tracking files:
- BUGS.md: known bugs and fix history log
- TESTING.md: test strategy, coverage targets, and how-to guide
- TODO.md: feature and task backlog with completion status
- scripts/update_todos.py: scans source for # TODO/FIXME/HACK markers
  and regenerates the Inline TODOs section in TODO.md
2026-03-17 17:41:46 -07:00
agessaman 4e5addd5df Add support for local plugins and services
- Updated `.gitignore` to include local configuration and plugin directories, allowing users to add custom commands and services without modifying core code.
- Enhanced `config.ini.example` with instructions for using local plugins and added sections for local service configurations.
- Refactored `PluginLoader` and `ServicePluginLoader` to support loading local commands and services from specified directories, improving extensibility.
- Updated `mkdocs.yml` to include documentation for local plugins and the check-in API.
- Added tests to verify the discovery and loading of local plugins, ensuring functionality and preventing name collisions with built-in plugins.
2026-03-04 18:33:45 -08:00