Pass username/port to initial push monitor deployment
All checks were successful
Build and Push Container / build (push) Successful in 30s
All checks were successful
Build and Push Container / build (push) Successful in 30s
- Update create_from_suggestion to accept username and port - Pass scan's username/port when creating suggested monitors - Fixes first deploy using wrong username 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -404,7 +404,10 @@ def create_suggested_monitors():
|
|||||||
if 0 <= idx < len(suggestions.monitors):
|
if 0 <= idx < len(suggestions.monitors):
|
||||||
suggestion = suggestions.monitors[idx]
|
suggestion = suggestions.monitors[idx]
|
||||||
monitor_result = monitor_service.create_from_suggestion(
|
monitor_result = monitor_service.create_from_suggestion(
|
||||||
suggestion, result.hostname
|
suggestion,
|
||||||
|
result.hostname,
|
||||||
|
username=result.username,
|
||||||
|
port=result.port,
|
||||||
)
|
)
|
||||||
created.append(monitor_result)
|
created.append(monitor_result)
|
||||||
|
|
||||||
|
|||||||
@@ -153,7 +153,13 @@ class MonitorService:
|
|||||||
self.created_monitors.extend(created)
|
self.created_monitors.extend(created)
|
||||||
return created
|
return created
|
||||||
|
|
||||||
def create_from_suggestion(self, suggestion: MonitorSuggestion, hostname: str) -> dict:
|
def create_from_suggestion(
|
||||||
|
self,
|
||||||
|
suggestion: MonitorSuggestion,
|
||||||
|
hostname: str,
|
||||||
|
username: str = "root",
|
||||||
|
port: int = 22,
|
||||||
|
) -> dict:
|
||||||
"""
|
"""
|
||||||
Create a monitor from a Claude suggestion.
|
Create a monitor from a Claude suggestion.
|
||||||
In production mode, this executes automatically.
|
In production mode, this executes automatically.
|
||||||
@@ -208,6 +214,8 @@ class MonitorService:
|
|||||||
push_token=push_token,
|
push_token=push_token,
|
||||||
monitor_id=monitor_id,
|
monitor_id=monitor_id,
|
||||||
interval_minutes=max(1, suggestion.interval // 60),
|
interval_minutes=max(1, suggestion.interval // 60),
|
||||||
|
username=username,
|
||||||
|
port=port,
|
||||||
)
|
)
|
||||||
response["deployment"] = deploy_result
|
response["deployment"] = deploy_result
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user