Commit graph

4 commits

Author SHA1 Message Date
A
48262d96e5
refactor: Extract sub-functions from longest create_server functions (#369)
Split the two longest functions in the codebase into focused sub-functions:

Contabo create_server (108 -> 52 lines):
- _contabo_get_ssh_secret_ids: fetch SSH secret IDs from API
- _contabo_build_instance_body: construct API request JSON
- _contabo_wait_for_instance: poll until instance is running

Genesis Cloud create_server (91 -> 42 lines):
- _genesis_get_ssh_key_ids: fetch SSH key IDs from API
- _genesis_build_instance_body: construct API request JSON
- _genesis_wait_for_instance: poll until instance is active

No behavioral changes - pure restructuring for readability.

Agent: complexity-hunter

Co-authored-by: A <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
2026-02-10 23:46:24 -08:00
A
75e3703c55
fix: Validate env var inputs in Hostinger and Contabo create_server (#361)
Hostinger: HOSTINGER_OS_TEMPLATE was interpolated into Python code
without validation, allowing Python code injection via env var.
Added validate_resource_name check.

Contabo: CONTABO_PRODUCT_ID, CONTABO_REGION, CONTABO_IMAGE_ID were
interpolated into Python strings without validation. CONTABO_PERIOD
was interpolated as bare Python (not even quoted), allowing arbitrary
code execution. Added validate_resource_name, validate_region_name,
and integer validation checks.

Agent: security-auditor

Co-authored-by: A <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-10 23:18:35 -08:00
A
4c00f3781e
refactor: Reduce complexity in cherry and contabo cloud libraries (#359)
Cherry Servers (cherry/lib/common.sh):
- Replace 59-line ensure_ssh_key with ensure_ssh_key_with_provider (1 line)
- Replace 22-line verify_server_connectivity with generic_ssh_wait (1 line)
- Replace 18-line ensure_cherry_token with ensure_api_token_with_provider (5 lines)
- Replace raw curl calls with cherry_api wrapper using generic_cloud_api
- Use $SSH_OPTS instead of hardcoded SSH options in run_server/upload_file/interactive_session
- Change exit 1 to return 1 for testability and consistency
- Remove unused _cherry_find_key_by_fingerprint helper

Contabo (contabo/lib/common.sh):
- Replace 47-line contabo_api (separate GET/POST/DELETE branches) with
  generic_cloud_api (5-line wrapper, gains automatic retry with backoff)
- Extract 54-line ensure_contabo_credentials into helpers:
  _load_contabo_config, _prompt_contabo_cred, _save_contabo_config
- Fix config save to use json_escape instead of raw variable interpolation
- Add check_python_available and environment variable fast-path

Net: -73 lines, 2 files changed

Agent: complexity-hunter

Co-authored-by: A <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-10 22:49:41 -08:00
A
ed4d37d0fa
feat: Add Contabo cloud provider with claude, aider, openclaw (#353)
Contabo is a budget European VPS provider with affordable CPU instances
starting at $4.95/month. Ideal for AI agents using remote API inference.

Key features:
- Budget-friendly pricing ($4.95-$59/mo)
- Full REST API with OAuth2 authentication
- Cloud-init/user_data support for provisioning
- Full root access via SSH
- European data centers (GDPR-friendly)
- Unlimited traffic included

Implementation:
- contabo/lib/common.sh: OAuth2 token flow, instance provisioning, SSH access
- contabo/claude.sh: Claude Code deployment (implemented)
- contabo/aider.sh: Aider deployment (implemented)
- contabo/openclaw.sh: OpenClaw deployment (implemented)
- manifest.json: Added Contabo cloud + 15 matrix entries (3 implemented)
- contabo/README.md: Complete usage guide with API setup

Authentication uses OAuth2 password grant requiring 4 credentials from
https://my.contabo.com/api/details: Client ID, Client Secret, API User,
API Password.

Agent: cloud-scout-1

Co-authored-by: B <6723574+louisgv@users.noreply.github.com>
2026-02-10 20:40:42 -08:00