Skip to content

feat(app-curve): add CurveCapture stop/restart script#87

Open
mnelsondtc wants to merge 5 commits into
mainfrom
feature/curve-capture-restart
Open

feat(app-curve): add CurveCapture stop/restart script#87
mnelsondtc wants to merge 5 commits into
mainfrom
feature/curve-capture-restart

Conversation

@mnelsondtc

Copy link
Copy Markdown
Contributor

What

Adds app-curve/curve-capture-restart.ps1 — a user-context script that stops CurveCapture.exe if running, waits for it to fully exit, then relaunches it from %APPDATA%\CurveDental\CurveCapture\bin\CurveCapture.exe.

CurveCapture is Curve Dental's imaging-capture bridge app. Restarting it is a common fix when capture hangs or loses its connection.

Why user-context (not SYSTEM)

Deploy in NinjaRMM with Run As: Logged-on User. Two reasons:

  1. %APPDATA% is per-user — under SYSTEM it resolves to the SYSTEM profile and the CurveCapture path won't exist.
  2. CurveCapture is an interactive GUI app — launched from SYSTEM it starts in invisible session 0. User context puts the relaunched window back in front of the user.

Standards compliance

  • Three-section template: RMM variable declaration / input handling / logic in Start-Transcript/Stop-Transcript.
  • User-context logging to %LOCALAPPDATA%\dtc-logs\.
  • No Ninja-Property-* calls (correct for user context).
  • Path existence check with a clear error if run in the wrong context or app not installed.
  • 15s bounded wait for clean exit before relaunch.

Testing

  • Interactive mode — prompts for Description, resolves path, stop/wait/restart cycle.
  • RMM mode (Run As: Logged-on User) — pending validation on a live endpoint with CurveCapture installed.

Notes

PR targets development per the DTC branching model. (The repo CLAUDE.md still says PRs target main and that there's no development branch — that's stale; flagging separately.)

Gumbees and others added 5 commits May 11, 2026 13:14
…67)

* improvement(docs): sync CLAUDE.md with DTC canonical change-taxonomy

Replace the deprecated enhancement/ + problem/ two-prefix model with the
canonical four-prefix taxonomy (bug/, refactor/, improvement/, feature/)
and two-tier GitHub labels (type:* + category:*). Mirrors
https://kb.dtctoday.com/books/developer-operations-devops/page/change-taxonomy.

- Rewrite Git Workflow section to reflect main-as-release (this repo has
  no development branch; the prior section described a model that did
  not match the actual repo).
- Add Halo Type / Category / GitHub labels / Branch prefix / Default
  semver mapping table.
- Note BREAKING: PR title override as future-state (no semver yet).
- Add dependabot categorization rule and 'name the branch after the
  change' guidance.
- Mark legacy enhancement/ and problem/ prefixes accepted on existing
  branches; new work uses the four-prefix model.
- Add db-* to the Category Organization list (db-mysql/ exists on disk).

* docs(taxonomy): add Enhancement/Refactor row + clarify Refactor spans both types
* Add NinjaRMM GUID to Halo PSA GUID Sync Script

Syncs DTC Org GUID from NinjaRMM custom fields to DTC Client GUID field in Halo PSA for all matching clients by name.

* Update ninja-halo-guid-sync.ps1

Fix Halo custom field name to CFDtcClientGuid

* Fix NinjaClientSecret placeholder comment typo

* Remove hardcoded credentials — replace with placeholders

Secrets were exposed in script body. Rotated all credentials. Real values stored in NinjaRMM script body (never leaves Ninja) and 1Password. GitHub copy uses placeholders only.

* Update script — use Script Variable injection for secrets

Refactored to inject client secrets via NinjaRMM Script Variables at runtime. Client IDs hardcoded (not secrets). Secrets never stored in repo. Validated working in production.

* Fix: Bring script into compliance with DTC PowerShell engineering standard

Addresses CodeRabbit review concerns on PR #49:
- Add RMM variable declaration block per script-template-powershell.ps1
- Add Start-Transcript/Stop-Transcript with C:\ProgramData\DTC\Logs\ output
- Add $ScriptLogName and $Description audit trail variables
- Replace Write-Host with Write-Information per output stream standard
- Add $ErrorActionPreference = 'Stop' and $ProgressPreference = 'SilentlyContinue'
- Add explicit exit codes (0/1/2 per DTC convention)
- Wrap all work in try/catch/finally per page 3299
* feat(rmm-ninja): add Lockhart remediation script

Automated remediation for NinjaOne Backup Lockhart service failures. Responds to the '(SEC) Last Successful Backup' condition on policy 58 (servers). Diagnose -> Repair -> Confirm flow with business-hours gating for disruptive operations. HV0 hypervisor host exclusion. DeviceOffline short-circuit. Forensic capture on remediation failure.

Pilot tested on internal DTC server 2026-04-23. Full cycle validated: idle classification, service restart, PID rotation, state file written, counter incremented correctly.

Includes Pester test coverage for structural validation, HV0 hypervisor host exclusion, and NotApplicable short-circuit path. Tests file force-added: .gitignore line 25 (*test*) excludes Pester source files - flagging as separate concern for repo cleanup.

* fix(rmm-ninja): RMM env-var binding + template compliance per review

- ForceDisruptiveRepairs/ClearStateAndExit now resolve from env vars (NinjaOne preset variable path) with CLI switch fallback for interactive runs; all numeric tunables gain env-var overrides (review comment 1)

- Three-section template structure per CLAUDE.md: RMM variable block, input handling with env:RMM detection and env:Description audit capture, Start/Stop-Transcript to RMMScriptPath/WINDIR logs with 10MB rotation. Documented deviation: no Read-Host (condition-triggered automation must never block on input)

- Collapsed dead Running-case conditional to single restart with explanatory comment (review comment 2)

- Counter semantics: docs and MaxAttemptsReached log now say 'interventions within window' matching the intentional increment-on-success behavior (review comment 3)

- .NOTES Path corrected to rmm-ninja/ (review comment 4)

- HV0 exclusion moved to entry point before transcript so hypervisors take zero file writes; Pester test added for env:ClearStateAndExit checkbox binding
…rt remediation (#83)

backup.ninjarmm.com is no longer used by the NinjaOne backup service, so it
fails DNS resolution and TCP connect on every run. This (1) fired unnecessary
disruptive network repairs (DNS cache flush, Dnscache restart, ARP clear) and
(2) poisoned the post-repair verdict via DNS_Still_Failing / Cloud_Still_Unreachable,
marking the remediation FAILED even when Lockhart was successfully repaired.

Remaining endpoints (app.ninjarmm.com, s3.amazonaws.com, s3.us-east-1.amazonaws.com)
still cover the agent control channel and backup storage targets.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
User-context script that stops CurveCapture.exe if running, waits for it
to fully exit, then relaunches from %APPDATA%\CurveDental\CurveCapture\bin.

Follows the three-section template (RMM vars / input handling / logic in
Start-Transcript). Designed for NinjaRMM "Run As: Logged-on User" so
%APPDATA% resolves correctly and the GUI relaunches in the user session.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mnelsondtc mnelsondtc added type:enhancement New work that adds or improves capability (Halo: Enhancement) category:feature Net-new capability the customer/operator didn't have labels Jun 18, 2026
@mnelsondtc mnelsondtc requested a review from Gumbees as a code owner June 18, 2026 18:26

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Code review skipped — your organization's overage spend limit has been reached.

Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit at claude.ai/admin-settings/claude-code.

Once credits are available, push a new commit or reopen this pull request to trigger a review.

@Gumbees Gumbees changed the base branch from development to main June 25, 2026 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:feature Net-new capability the customer/operator didn't have type:enhancement New work that adds or improves capability (Halo: Enhancement)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants