Skip to content

feat: test server connection before saving agent settings - #16

Open
Mischa323 wants to merge 6 commits into
mainfrom
claude/agent-connection-check
Open

feat: test server connection before saving agent settings#16
Mischa323 wants to merge 6 commits into
mainfrom
claude/agent-connection-check

Conversation

@Mischa323

Copy link
Copy Markdown
Owner

Summary

When the user clicks Save settings in the agent tray dialog, it now tests the server URL first before persisting anything.

  • Button shows "Testing connection…" and disables while the check runs (non-blocking — uses a background thread so the UI stays responsive)
  • On failure: inline error message with a specific reason:
    • "Connection timed out — is the server running and reachable?"
    • "Connection refused — check the server URL and port."
    • "TLS error — enable 'Accept self-signed certificate' if using the default setup."
    • Generic fallback with the raw error
  • On success: settings are saved and the agent restarts as before
  • Also auto-prefixes https:// if the user forgets the scheme

Test plan

  • Enter an unreachable URL → "Connection timed out" error, settings not saved
  • Enter a reachable URL with wrong port → "Connection refused" error
  • Enter correct URL without https:// → auto-prefixed, connection succeeds
  • Self-signed cert with checkbox unchecked → TLS error shown
  • Self-signed cert with checkbox checked → connects successfully, settings saved

🤖 Generated with Claude Code
https://claude.ai/code/session_01SZSSJXmQSKF2KgTqSWSp2H


Generated by Claude Code

claude added 6 commits June 19, 2026 08:31
…ing design confirmation)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SZSSJXmQSKF2KgTqSWSp2H
…ow permissions

- SSO callback now blocks any M365 user without a provisioned local account;
  shows a styled 'Access denied' page with a back-to-login link
- New access_groups / access_group_members / access_group_orgs / access_group_perms
  tables with full CRUD API (/api/access-groups/*)
- Deny overrides allow across all groups a user belongs to; conflict shown in UI
- Permission toggle cycles inherit → Deny → Allow (deny first per UX requirement)
- orgs_for_user and user_effective_role now include group-based org access
- auth.check_permission / auth.require_permission helpers for route-level checks
- Settings → Users & roles shows Access groups card with member + org management
- Permission buttons per org: greyed = inherit, red = deny, green = allow
- Bump to v1.4.0

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SZSSJXmQSKF2KgTqSWSp2H
POST /api/mail/test sends a one-off test email using the active delivery
config (SMTP or Graph). The Settings UI adds a 'Test delivery' card with
a recipient field and 'Send test email' button that shows success/failure
via the toast.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SZSSJXmQSKF2KgTqSWSp2H
The bulk update endpoint now compares each agent's reported agent_version
against SERVER_VERSION and only sends the update message to agents that
are behind. Agents already on the current version are skipped rather than
being told to reinstall themselves (which broke them).

The toast now reports: 'Update sent to N agent(s) (M already up to date)'
or 'All N online agent(s) are already up to date' when nothing to do.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SZSSJXmQSKF2KgTqSWSp2H
…estyle

Single instance:
- _single_instance() now falls back to OpenMutexW when CreateMutexW returns
  ERROR_ACCESS_DENIED (non-admin user can't create Global\ mutex held by SYSTEM),
  correctly detecting a running agent across sessions

Installed software:
- _software_windows() now enumerates HKU\<user-SID>\... for every loaded user
  hive, not just HKCU (which is the empty system account when agent runs as SYSTEM)
- Adds -AsArray flag so ConvertTo-Json always returns an array even for one item
- Increases timeout to 90s for slow machines

API key hidden when running as admin:
- settings_dialog() now reads the API key and server URL from rmm_config.json
  (written by the agent on first connect to %ProgramData%\LeuffenRMM) as fallback
  when the env vars aren't available in the elevated session

UI restyle:
- Settings dialog rebuilt with dark theme matching the web app (BG #0d1117,
  Segoe UI font, brand blue accent #3b82f6, subtle borders)
- Live connection status badge in the dialog header
- Show/Hide toggle on the enrollment key field
- Custom dark _msgbox replaces the default Windows white popup
- Open dashboard also falls back to rmm_config.json for the server URL

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SZSSJXmQSKF2KgTqSWSp2H
When the user clicks 'Save settings', the dialog now tests the URL by
calling GET /api/health before persisting anything. While the check runs
the button shows 'Testing connection…' and is disabled. On failure a
clear error is shown inline (timeout / refused / TLS / generic). Only on
success does it apply the settings and restart the agent.

Also auto-prefixes https:// if the user omits the scheme.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SZSSJXmQSKF2KgTqSWSp2H
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.

2 participants