Skip to content

docs: add TZ environment variable to README#155

Merged
Yeraze merged 1 commit into
mainfrom
docs/add-tz-env-var
Oct 10, 2025
Merged

docs: add TZ environment variable to README#155
Yeraze merged 1 commit into
mainfrom
docs/add-tz-env-var

Conversation

@Yeraze

@Yeraze Yeraze commented Oct 10, 2025

Copy link
Copy Markdown
Owner

Summary

  • Add documentation for the TZ environment variable in the README's Environment Variables table

Details

The TZ environment variable is used by the checkAutoAcknowledge() function in src/server/meshtasticManager.ts:3143 to format message timestamps in auto-acknowledge responses. Without this documentation, users may not be aware they can customize the timezone for these automated messages.

This change adds:

  • Documentation in the Environment Variables table
  • Default value: America/New_York (matching the code default)
  • Link to TZ database timezone list for easy reference

Test plan

  • Documentation accurately reflects code behavior
  • Link to TZ database is valid
  • Format matches existing environment variable documentation

Fixes #154

🤖 Generated with Claude Code

Add documentation for the TZ environment variable which is used by the
auto-acknowledge feature to format message timestamps. Without this
documentation, users may not know they can customize the timezone for
auto-acknowledge responses.

Fixes #154

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@claude

claude Bot commented Oct 10, 2025

Copy link
Copy Markdown
Contributor

Claude finished @Yeraze's task —— View job


PR Review: TZ Environment Variable Documentation

I've completed my review of this documentation addition. Here's my comprehensive feedback:

Todo List:

  • Read the modified README.md file
  • Examine the meshtasticManager.ts code to verify TZ usage
  • Check documentation accuracy and consistency
  • Provide comprehensive review feedback

Code Quality and Best Practices ✅

  • Documentation Format: The entry follows the existing table format perfectly
  • Consistency: Matches the structure and style of other environment variable entries
  • Placement: Correctly positioned alphabetically in the environment variables table

Accuracy and Completeness ✅

  • Default Value: Correctly documents America/New_York as the default (matches src/server/meshtasticManager.ts:3143)
  • Usage Description: Accurately describes the variable's purpose for auto-acknowledge message timestamps
  • Reference Link: Provides helpful link to TZ database timezone list
  • Code Verification: The implementation in checkAutoAcknowledge() function correctly uses process.env.TZ || 'America/New_York'

Documentation Quality ✅

  • Clear Description: Concisely explains what the variable controls
  • User-Friendly: Includes reference link for easy timezone lookup
  • Context: Clearly states it affects "auto-acknowledge message timestamps"

No Issues Found

  • Security: No security concerns - this is documentation only
  • Performance: No performance impact - documentation change only
  • Bugs: No potential bugs identified
  • Test Coverage: Not applicable for documentation changes

Minor Suggestions

  1. Consider adding example: While not required, an example like TZ=Europe/London could be helpful for users
  2. Code reference: The description accurately reflects the code usage in the auto-acknowledge feature

Summary

This is a high-quality documentation addition that:

  • ✅ Accurately reflects the code implementation
  • ✅ Follows existing documentation patterns
  • ✅ Provides helpful user guidance
  • ✅ Includes useful external reference link
  • ✅ Fixes the missing documentation identified in issue [DOCS] Missing TZ environment variable in README #154

Recommendation: Approve - This PR successfully documents an existing environment variable that was previously undocumented, improving user experience for those wanting to customize timezone display in auto-acknowledge messages.

@Yeraze Yeraze merged commit 5b031f7 into main Oct 10, 2025
9 checks passed
@Yeraze Yeraze deleted the docs/add-tz-env-var branch October 10, 2025 19:33
Yeraze added a commit that referenced this pull request Oct 12, 2025
Co-authored-by: Claude <noreply@anthropic.com>
Yeraze added a commit that referenced this pull request Oct 29, 2025
Co-authored-by: Claude <noreply@anthropic.com>
Yeraze added a commit that referenced this pull request Jun 18, 2026
…#152/153/155/156) (#3544)

* fix(security): use RE2 for user-supplied regexes to eliminate ReDoS (#3543)

Resolves the two high-severity CodeQL js/regex-injection alerts (#153, #155) by
compiling all user/admin-supplied regular expressions with RE2, a linear-time
engine immune to catastrophic backtracking. The previous heuristic guards
(length caps + nested-quantifier checks) reduced but could not eliminate the
risk, and CodeQL (correctly) kept flagging the user→RegExp dataflow.

- New src/utils/safeRegex.ts: compileUserRegex(pattern, flags) wraps RE2 and
  returns a RegExp-compatible matcher (test/exec/match/replace). RE2 rejects
  backreferences and lookaround — the intended trade-off — so callers keep their
  existing try/catch to treat unsupported patterns as "invalid regex".
- Convert every user-supplied regex site, validation AND execution:
  - server.ts: remote(-localstats) name-filter validation (2 sites).
  - services/database.ts: the name-filter execution sites that actually match
    node names (traceroute + localstats union filters) — the real ReDoS surface
    CodeQL didn't reach through the settings store.
  - routes/scriptRoutes.ts + meshtasticManager.ts: auto-responder trigger and
    auto-acknowledge pattern matching.
- Dockerfile: add build-base + python3 to the builder stage so re2 (native) can
  compile from source where no prebuilt exists (Alpine/musl arm). Builder stage
  only — not in the runtime image.

Tests: new safeRegex suite asserts linear-time behaviour on the classic (a+)+$
ReDoS pattern and rejection of backreference/lookaround. Full suite green.

The two non-regex alerts are handled separately: #152 (frontend routing, not a
security gate) dismissed as false-positive; #156 (authenticated admin script
import, path-sanitized) dismissed as by-design.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* address review: convert remaining regex sites to RE2; harden tests/docs (#3544)

Claude review feedback on the RE2 security PR:

1. autoAckRegex.ts:69 — convert the MeshCore auto-ack pattern compile to
   compileUserRegex (the charset allowlist/length/shape guards stay as a fast
   pre-rejection). Residual ReDoS surface CodeQL may not flag through the
   barrier, now closed for consistency.
2. settingsRoutes.ts:215 — convert the regex-validation compile to
   compileUserRegex so stored patterns are guaranteed RE2-compatible.
3. safeRegex.ts — document that the result is not `instanceof RegExp` and that
   length bounding stays the caller's responsibility; add a test asserting
   `.source`/`.flags` behave.
4. safeRegex.test.ts — raise the ReDoS timing threshold to 1000ms and use a
   larger input, so the assertion can't flake on loaded CI runners.
5. Dockerfile — clarify the builder comment (build-base is the new compiler;
   python3 is node-gyp's other requirement).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <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.

[DOCS] Missing TZ environment variable in README

1 participant