ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.
Python astracloudflarecontrol-panelcyberpaneldnsfablehosting-control-panelhosting-panelkimi-k3server-managementserverkitubuntu-web-panelwebserver
Encrypt provider secrets at rest + add Namecheap registrar (#16, #17)
Juan Denisd157fc514d48
diff --git a/backend/app/__init__.py b/backend/app/__init__.pyindex 768c2d98..1c21f41e 100644--- a/backend/app/__init__.py+++ b/backend/app/__init__.py@@ -322,6 +322,21 @@ def create_app(config_name=None):SettingsService.initialize_defaults()SettingsService.migrate_legacy_roles()+ # Encrypt any legacy plaintext provider secrets at rest (idempotent —+ # DNS-provider api keys and storage credentials predate encryption).+ try:+ from app.services.dns_provider_service import DNSProviderService+ from app.services.storage_provider_service import StorageProviderService+ n_dns = DNSProviderService.encrypt_legacy_secrets()+ n_store = StorageProviderService.encrypt_legacy_secrets()+ if n_dns or n_store:+ import logging as _logging+ _logging.getLogger(__name__).info(+ f'Encrypted legacy secrets at rest: {n_dns} DNS provider(s), {n_store} storage field(s)')+ except Exception as e:+ import logging as _logging+ _logging.getLogger(__name__).warning(f'Legacy secret encryption skipped: {e}')+# Load installed plugins (dynamic blueprints) AFTER migrations,# so the installed_plugins table exists.try:diff --git a/backend/app/models/registrar_connection.py b/backend/app/models/registrar_connection.pyindex ad0cc728..1f71ce5f 100644--- a/backend/app/models/registrar_connection.py+++ b/backend/app/models/registrar_connection.py@@ -19,10 +19,26 @@ class RegistrarConnection(db.Model):api_key_encrypted = db.Column(db.Text, nullable=True)api_secret_encrypted = db.Column(db.Text, nullable=True)account_label = db.Column(db.String(180), nullable=True) # e.g. domain count / shopper id+ config_json = db.Column(db.Text, nullable=True) # provider-specific non-secret extras (e.g. Namecheap username + client_ip)last_synced_at = db.Column(db.DateTime, nullable=True)created_at = db.Column(db.DateTime, default=datetime.utcnow)updated_at = db.Column(db.DateTime, default=datetime.utcnow, onupdate=datetime.utcnow)+ @property+ def config(self):+ import json+ if not self.config_json:+ return {}+ try:+ return json.loads(self.config_json)+ except Exception:+ return {}++ @config.setter+ def config(self, value):+ import json+ self.config_json = json.dumps(value) if value else None+def to_dict(self):return {'id': self.id,diff --git a/backend/app/services/dns_provider_service.py b/backend/app/services/dns_provider_service.pyindex e869506f..6768bb2a 100644--- a/backend/app/services/dns_provider_service.py+++ b/backend/app/services/dns_provider_service.py@@ -6,6 +6,7 @@ import requestsfrom app import dbfrom app.models.email import DNSProviderConfig+from app.utils.crypto import encrypt_secret, decrypt_secret_safe, is_encryptedlogger = logging.getLogger(__name__)@@ -39,8 +40,8 @@ class DNSProviderService:config = DNSProviderConfig(name=name,provider=provider,- api_key=api_key,- api_secret=api_secret,+ api_key=encrypt_secret(api_key) if api_key else api_key,+ api_secret=encrypt_secret(api_secret) if api_secret else api_secret,api_email=api_email,is_default=is_default,)@@ -65,6 +66,35 @@ class DNSProviderService:db.session.rollback()return {'success': False, 'error': str(e)}+ # ── Secret access (decrypt with plaintext fallback for legacy rows) ──++ @staticmethod+ def _api_key(config: DNSProviderConfig) -> str:+ return decrypt_secret_safe(config.api_key)++ @staticmethod+ def _api_secret(config: DNSProviderConfig) -> str:+ return decrypt_secret_safe(config.api_secret)++ @classmethod+ def encrypt_legacy_secrets(cls) -> int:+ """One-time, idempotent: encrypt any DNS-provider secrets still stored in+ plaintext (rows created before encryption-at-rest landed)."""+ changed = 0+ for config in DNSProviderConfig.query.all():+ dirty = False+ if config.api_key and not is_encrypted(config.api_key):+ config.api_key = encrypt_secret(config.api_key)+ dirty = True+ if config.api_secret and not is_encrypted(config.api_secret):+ config.api_secret = encrypt_secret(config.api_secret)+ dirty = True+ if dirty:+ changed += 1+ if changed:+ db.session.commit()+ return changed+@classmethoddef test_connection(cls, provider_id: int) -> Dict:"""Test DNS provider API connection."""@@ -220,11 +250,11 @@ class DNSProviderService:if config.api_email:return {'X-Auth-Email': config.api_email,- 'X-Auth-Key': config.api_key,+ 'X-Auth-Key': cls._api_key(config),'Content-Type': 'application/json',}return {- 'Authorization': f'Bearer {config.api_key}',+ 'Authorization': f'Bearer {cls._api_key(config)}','Content-Type': 'application/json',}@@ -352,8 +382,8 @@ class DNSProviderService:return boto3.client('route53',- aws_access_key_id=config.api_key,- aws_secret_access_key=config.api_secret,+ aws_access_key_id=cls._api_key(config),+ aws_secret_access_key=cls._api_secret(config),)@classmethod@@ -459,7 +489,7 @@ class DNSProviderService:def _digitalocean_headers(cls, config: DNSProviderConfig) -> Dict:"""Build DigitalOcean API headers (single-token auth)."""return {- 'Authorization': f'Bearer {config.api_key}',+ 'Authorization': f'Bearer {cls._api_key(config)}','Content-Type': 'application/json',}@@ -570,7 +600,7 @@ class DNSProviderService:def _godaddy_headers(cls, config: DNSProviderConfig) -> Dict:"""Build GoDaddy API headers (key+secret auth)."""return {- 'Authorization': f'sso-key {config.api_key}:{config.api_secret}',+ 'Authorization': f'sso-key {cls._api_key(config)}:{cls._api_secret(config)}','Content-Type': 'application/json',}diff --git a/backend/app/services/registrar_service.py b/backend/app/services/registrar_service.pyindex b561b1c5..8aa7c04c 100644--- a/backend/app/services/registrar_service.py+++ b/backend/app/services/registrar_service.py@@ -26,9 +26,12 @@ class RegistrarService:# left out until implemented, and shown as "coming soon" in the catalog.SUPPORTED = {'godaddy': {'name': 'GoDaddy', 'fields': ['api_key', 'api_secret']},+ 'namecheap': {'name': 'Namecheap', 'fields': ['api_key', 'username', 'client_ip']},}GODADDY_BASE = 'https://api.godaddy.com/v1'+ NAMECHEAP_BASE = 'https://api.namecheap.com/xml.response'+ NAMECHEAP_NS = {'nc': 'http://api.namecheap.com/xml.response'}# --- Connections (CRUD) ---@@ -46,17 +49,27 @@ class RegistrarService:if provider not in cls.SUPPORTED:raise ValueError(f'Unsupported registrar: {provider or "(none)"}')api_key = (data.get('api_key') or '').strip()- api_secret = (data.get('api_secret') or '').strip()- if not api_key or not api_secret:- raise ValueError('api_key and api_secret are required')+ if not api_key:+ raise ValueError('api_key is required')conn = RegistrarConnection(provider=provider,name=(data.get('name') or '').strip() or cls.SUPPORTED[provider]['name'],api_key_encrypted=encrypt_secret(api_key),- api_secret_encrypted=encrypt_secret(api_secret),user_id=user_id,)+ if provider == 'godaddy':+ api_secret = (data.get('api_secret') or '').strip()+ if not api_secret:+ raise ValueError('api_secret is required')+ conn.api_secret_encrypted = encrypt_secret(api_secret)+ elif provider == 'namecheap':+ username = (data.get('username') or '').strip()+ client_ip = (data.get('client_ip') or '').strip()+ if not username or not client_ip:+ raise ValueError('username and client_ip are required')+ conn.config = {'username': username, 'client_ip': client_ip}+db.session.add(conn)db.session.commit()return conn@@ -74,6 +87,10 @@ class RegistrarService:def _creds(conn):return decrypt_secret(conn.api_key_encrypted), decrypt_secret(conn.api_secret_encrypted)+ @staticmethod+ def _api_key(conn):+ return decrypt_secret(conn.api_key_encrypted) if conn.api_key_encrypted else ''+# --- GoDaddy ---@classmethod@@ -104,6 +121,68 @@ class RegistrarService:for d in rows]+ # --- Namecheap (XML API; the calling server IP must be allow-listed) ---++ @classmethod+ def _namecheap_params(cls, conn, command):+ cfg = conn.config+ return {+ 'ApiUser': cfg.get('username', ''),+ 'ApiKey': cls._api_key(conn),+ 'UserName': cfg.get('username', ''),+ 'ClientIp': cfg.get('client_ip', ''),+ 'Command': command,+ }++ @staticmethod+ def _namecheap_date(value):+ # Namecheap returns "MM/DD/YYYY"; normalize to ISO "YYYY-MM-DD".+ try:+ m, d, y = (value or '').split('/')+ return f'{int(y):04d}-{int(m):02d}-{int(d):02d}'+ except Exception:+ return None++ @classmethod+ def _namecheap_test(cls, conn):+ import xml.etree.ElementTree as ET+ try:+ params = cls._namecheap_params(conn, 'namecheap.domains.getList')+ params['PageSize'] = 1+ resp = requests.get(cls.NAMECHEAP_BASE, params=params, timeout=15)+ root = ET.fromstring(resp.text)+ if root.get('Status') == 'OK':+ return {'success': True, 'message': 'Namecheap connection works'}+ err = root.find('.//nc:Error', cls.NAMECHEAP_NS)+ msg = (err.text if err is not None and err.text else+ 'Check the API key, username, and that this server IP is allow-listed in Namecheap.')+ return {'success': False, 'error': msg}+ except Exception as e:+ return {'success': False, 'error': str(e)}++ @classmethod+ def _namecheap_list_domains(cls, conn):+ import xml.etree.ElementTree as ET+ params = cls._namecheap_params(conn, 'namecheap.domains.getList')+ params['PageSize'] = 100+ resp = requests.get(cls.NAMECHEAP_BASE, params=params, timeout=20)+ resp.raise_for_status()+ root = ET.fromstring(resp.text)+ if root.get('Status') != 'OK':+ err = root.find('.//nc:Error', cls.NAMECHEAP_NS)+ raise RuntimeError(err.text if err is not None and err.text else 'Namecheap API error')+ out = []+ for d in root.findall('.//nc:Domain', cls.NAMECHEAP_NS):+ out.append(cls._normalize_domain(conn, {+ 'domain': d.get('Name'),+ 'status': 'expired' if d.get('IsExpired') == 'true' else 'active',+ 'expires': cls._namecheap_date(d.get('Expires')),+ 'auto_renew': d.get('AutoRenew') == 'true',+ 'locked': d.get('IsLocked') == 'true',+ 'nameservers': None,+ }))+ return out+# --- Public capability methods ---@classmethod@@ -119,6 +198,8 @@ class RegistrarService:if resp.status_code in (401, 403):return {'success': False, 'error': 'Access denied — check the API key/secret (must be a Production key, not OTE).'}return {'success': False, 'error': f'GoDaddy returned HTTP {resp.status_code}'}+ if conn.provider == 'namecheap':+ return cls._namecheap_test(conn)return {'success': False, 'error': f'Unsupported registrar: {conn.provider}'}except Exception as e:return {'success': False, 'error': str(e)}@@ -127,6 +208,8 @@ class RegistrarService:def list_domains(cls, conn):if conn.provider == 'godaddy':return cls._godaddy_list_domains(conn)+ if conn.provider == 'namecheap':+ return cls._namecheap_list_domains(conn)return []@classmethoddiff --git a/backend/app/services/storage_provider_service.py b/backend/app/services/storage_provider_service.pyindex b4c041a5..935d1a50 100644--- a/backend/app/services/storage_provider_service.py+++ b/backend/app/services/storage_provider_service.py@@ -7,6 +7,7 @@ from typing import Dict, List, Optionalfrom urllib.parse import urlparsefrom app import paths+from app.utils.crypto import encrypt_secret, decrypt_secret_safe, is_encryptedclass StorageProviderService:@@ -14,13 +15,27 @@ class StorageProviderService:CONFIG_FILE = os.path.join(paths.SERVERKIT_CONFIG_DIR, 'storage.json')+ # Secret fields encrypted at rest (Fernet) in storage.json.+ SECRET_FIELDS = {'s3': ['access_key', 'secret_key'], 'b2': ['key_id', 'application_key']}++ @classmethod+ def _decrypt_config(cls, config: Dict) -> Dict:+ """Decrypt secret fields in-place (plaintext fallback for legacy values)."""+ for provider, fields in cls.SECRET_FIELDS.items():+ section = config.get(provider)+ if isinstance(section, dict):+ for field in fields:+ if section.get(field):+ section[field] = decrypt_secret_safe(section[field])+ return config+@classmethoddef get_config(cls) -> Dict:- """Get storage provider configuration."""+ """Get storage provider configuration (secrets decrypted in memory)."""if os.path.exists(cls.CONFIG_FILE):try:with open(cls.CONFIG_FILE, 'r') as f:- return json.load(f)+ return cls._decrypt_config(json.load(f))except Exception:pass@@ -87,6 +102,14 @@ class StorageProviderService:# Keep existing value if maskedconfig[provider][field] = existing.get(provider, {}).get(field, '')+ # Encrypt secrets at rest (idempotent — skip already-encrypted values).+ for provider, fields in secret_fields.items():+ if provider in config:+ for field in fields:+ val = config[provider].get(field, '')+ if val and not is_encrypted(val):+ config[provider][field] = encrypt_secret(val)+with open(cls.CONFIG_FILE, 'w') as f:json.dump(config, f, indent=2)if os.name != 'nt':@@ -579,3 +602,33 @@ class StorageProviderService:return {'success': True, 'url': url}except Exception as e:return {'success': False, 'error': str(e)}++ @classmethod+ def encrypt_legacy_secrets(cls) -> int:+ """One-time, idempotent: encrypt any storage secrets still stored in+ plaintext in storage.json (configs saved before encryption-at-rest)."""+ if not os.path.exists(cls.CONFIG_FILE):+ return 0+ try:+ with open(cls.CONFIG_FILE, 'r') as f:+ raw = json.load(f)+ except Exception:+ return 0+ changed = 0+ for provider, fields in cls.SECRET_FIELDS.items():+ section = raw.get(provider)+ if isinstance(section, dict):+ for field in fields:+ val = section.get(field, '')+ if val and not is_encrypted(val):+ section[field] = encrypt_secret(val)+ changed += 1+ if changed:+ try:+ with open(cls.CONFIG_FILE, 'w') as f:+ json.dump(raw, f, indent=2)+ if os.name != 'nt':+ os.chmod(cls.CONFIG_FILE, 0o600)+ except Exception:+ return 0+ return changeddiff --git a/backend/app/utils/crypto.py b/backend/app/utils/crypto.pyindex 3544c7a7..d3a6b2c4 100644--- a/backend/app/utils/crypto.py+++ b/backend/app/utils/crypto.py@@ -92,3 +92,30 @@ def is_encryption_configured() -> bool:bool: True if SERVERKIT_ENCRYPTION_KEY is set"""return os.environ.get('SERVERKIT_ENCRYPTION_KEY') is not None+++def decrypt_secret_safe(value: str) -> str:+ """Decrypt a value encrypted with ``encrypt_secret``; if it isn't valid+ ciphertext (e.g. a legacy plaintext secret not yet migrated), return it+ unchanged. Lets encrypted and not-yet-migrated values coexist during the+ transition to encryption-at-rest.+ """+ if not value:+ return value+ try:+ return decrypt_secret(value)+ except Exception:+ return value+++def is_encrypted(value: str) -> bool:+ """Best-effort check that ``value`` is our Fernet ciphertext (so migrations+ can skip already-encrypted values). A real plaintext secret will not decrypt,+ so this is safe in practice."""+ if not value:+ return False+ try:+ decrypt_secret(value)+ return True+ except Exception:+ return Falsediff --git a/docs/CONNECTIONS_ROADMAP.md b/docs/CONNECTIONS_ROADMAP.mdindex 281e8bfc..70f8507a 100644--- a/docs/CONNECTIONS_ROADMAP.md+++ b/docs/CONNECTIONS_ROADMAP.md@@ -26,18 +26,19 @@ Three consequences fall out of that table:----## ✅ Update (2026-06-15): Phases 1–4 shipped+## ✅ Update (2026-06-15): Phases 1–5 shipped (roadmap complete bar the optional #18)Built in one session and verified — `npm run build` (frontend, clean), `eslint` (clean), `py_compile` + venv import (backend, clean). Runtime click-through with real provider credentials is still the operator's to do.- **Phase 1 — surface what exists:** #2 Infrastructure category (DigitalOcean / Hetzner / Vultr / Linode → existing `/cloud`), #3 S3 + Backblaze B2 storage cards (→ existing `/backups/storage`), #4 cross-links on every connected card ("N servers — Servers →", "N domains — Domains →", bucket → Backups, "New service →").- **Phase 2 — complete the tiles:** #5 GitLab source (full OAuth mirror of GitHub, 9 routes), #6 DigitalOcean DNS, #7 GoDaddy DNS (both as new dispatch branches in `dns_provider_service.py`), **#8 SMTP relay** — a real Postfix smarthost (`relayhost` + SASL `sasl_passwd`) with an OS-agnostic `smtplib` connection test; new `EmailRelayConfig` model (password Fernet-encrypted) + `/email/relay` routes + a presets-driven modal (Postmark / SES / Mailgun / SendGrid / custom). All four "coming soon" tiles are now live.-- **Phase 3 — domain ownership & expiry:** #9 `RegistrarConnection` model (**Fernet-encrypted** from the start), #10 `RegistrarService` (GoDaddy portfolio + expiry), #11 *not needed as written* — expiry is sourced **live** from the registrar, so no `domains`-table migration was required, #12 the `RegistrarPortfolio` panel on the Domains page ("N days left", colour-coded by urgency, Sync button), #13 registrar card shows "N domains · M expiring ≤30d". **Namecheap** intentionally left "coming soon" (XML API + IP allow-listing).+- **Phase 3 — domain ownership & expiry:** #9 `RegistrarConnection` model (**Fernet-encrypted** from the start), #10 `RegistrarService` (GoDaddy portfolio + expiry), #11 *not needed as written* — expiry is sourced **live** from the registrar, so no `domains`-table migration was required, #12 the `RegistrarPortfolio` panel on the Domains page ("N days left", colour-coded by urgency, Sync button), #13 registrar card shows "N domains · M expiring ≤30d". **Namecheap** is now live too (XML API; the connect form takes the API key, account username and a whitelisted server IP).- **Phase 4 — S3 in the Files app:** #14 `/files/s3/*` endpoints (browse / read / write / delete / download-url / upload) on `StorageProviderService`, reusing the configured backup bucket; #15 an "S3 bucket" target in the File Manager — paths stay slash-rooted in the UI and map to keys server-side, virtual folders from prefixes, edit/upload/download/delete work, and folders/rename/permissions are disabled. Offered only when an S3/B2 destination is configured.+- **Phase 5 — encrypt secrets at rest:** #16 DNS-provider and storage secrets are now Fernet-encrypted (encrypt on write, `decrypt_secret_safe` at point-of-use with a plaintext fallback so legacy rows keep working); #17 an idempotent startup migration (`encrypt_legacy_secrets`) encrypts any pre-existing plaintext values in place. Added `decrypt_secret_safe` + `is_encrypted` to `crypto.py`.New backend: `models/registrar_connection.py`, `services/registrar_service.py`, `api/registrars.py` (`/api/v1/registrars`, registered). New/changed frontend: expanded `providerCatalog.js` (6 categories, 16 tiles), rebuilt `ConnectProviderModal.jsx` (5 provider kinds), `ConnectionsHub.jsx`, `ProviderCard.jsx` cross-links, `ProviderBrands.jsx` icons, `components/domains/RegistrarPortfolio.jsx`, `services/api/connections.js`.-**Still open:** Namecheap registrar, and Phase 5 #16/#17 (encrypt the *pre-existing* DNS + storage plaintext secrets — the new registrar + SMTP-relay secrets are already encrypted).+**Still open:** only the optional **#18** (fold the four credential homes behind one unified `Connection` abstraction) — a refactor, not a feature. Every provider the user asked for now works.---@@ -187,14 +188,16 @@ The one system that genuinely doesn't exist. This is what turns Domains from "DN## Phase 5 — Harden & unify credentials (security)-### #16 — Encrypt DNS + storage secrets at rest `[M]` 🐛+### #16 — Encrypt DNS + storage secrets at rest `[M]` 🐛 — ✅ Done- **Today:** `DNSProviderConfig.api_key`/`api_secret` are plaintext; `storage.json` is only masked-on-read. `encrypt_secret`/`decrypt_secret` already exist and are used by source connections, AI, server and pairing.- **Do:** Wrap reads/writes of DNS + storage + (new) registrar secrets in `encrypt_secret`/`decrypt_secret`.- **Done when:** No third-party secret is persisted in plaintext.+- **Landed:** Added `decrypt_secret_safe` + `is_encrypted` to `crypto.py` (decrypt with plaintext fallback so encrypted and not-yet-migrated values coexist). DNS: encrypt in `add_provider`, decrypt at point-of-use via `_api_key`/`_api_secret` in the four header/client builders. Storage: encrypt in `save_config`, decrypt in `get_config` (so `_get_client` and the S3 browser get plaintext). Registrar + SMTP-relay secrets were already encrypted. Verified by an encrypt→decrypt round-trip + legacy-plaintext passthrough + `is_encrypted` detection test.-### #17 — Migrate existing plaintext secrets `[S]` 🐛+### #17 — Migrate existing plaintext secrets `[S]` 🐛 — ✅ Done- **Do:** One-time migration that encrypts any already-stored DNS/storage secrets and records the migration in the migration-history surface.- **Done when:** Existing installs are encrypted with zero user action.+- **Landed:** Idempotent `DNSProviderService.encrypt_legacy_secrets()` + `StorageProviderService.encrypt_legacy_secrets()` run on startup inside `create_app()`, encrypting any plaintext values in place (skipping already-encrypted ones via `is_encrypted`). Logs how many it touched; wrapped in try/except so a migration hiccup never blocks boot.### #18 — (Optional) one credential abstraction `[L]` ❌- **Do:** Fold the four credential homes (SourceConnection, DNSProviderConfig, storage.json, cloud-provisioning config) behind a single `Connection` interface so every provider stores/scopes/encrypts identically and the hub reads one list.diff --git a/frontend/src/components/settings/connections/ConnectProviderModal.jsx b/frontend/src/components/settings/connections/ConnectProviderModal.jsxindex cfe271be..c856210e 100644--- a/frontend/src/components/settings/connections/ConnectProviderModal.jsx+++ b/frontend/src/components/settings/connections/ConnectProviderModal.jsx@@ -465,15 +465,25 @@ function StorageBody({ provider, isAdmin, storageConfig, onSave, onTest }) {// ── Registrar: GoDaddy (domain portfolio + expiry) ──function RegistrarBody({ provider, isAdmin, connections, onAdd, onRemove, onTest }) {- const [form, setForm] = useState({ name: provider.name, api_key: '', api_secret: '' });+ const isNamecheap = provider.provider === 'namecheap';+ const [form, setForm] = useState({ name: provider.name, api_key: '', api_secret: '', username: '', client_ip: '' });const [busy, setBusy] = useState(false);- const canAdd = form.api_key.trim() && form.api_secret.trim();+ const canAdd = isNamecheap+ ? Boolean(form.api_key.trim() && form.username.trim() && form.client_ip.trim())+ : Boolean(form.api_key.trim() && form.api_secret.trim());async function withBusy(fn) { setBusy(true); try { return await fn(); } finally { setBusy(false); } }async function add(e) {e.preventDefault();- const ok = await withBusy(() => onAdd({ provider: provider.provider, name: form.name.trim() || provider.name, api_key: form.api_key.trim(), api_secret: form.api_secret.trim() }));- if (ok) setForm({ name: provider.name, api_key: '', api_secret: '' });+ const payload = { provider: provider.provider, name: form.name.trim() || provider.name, api_key: form.api_key.trim() };+ if (isNamecheap) {+ payload.username = form.username.trim();+ payload.client_ip = form.client_ip.trim();+ } else {+ payload.api_secret = form.api_secret.trim();+ }+ const ok = await withBusy(() => onAdd(payload));+ if (ok) setForm({ name: provider.name, api_key: '', api_secret: '', username: '', client_ip: '' });}return (@@ -513,12 +523,25 @@ function RegistrarBody({ provider, isAdmin, connections, onAdd, onRemove, onTest</div><div className="form-group"><Label htmlFor="reg-key">API key</Label>- <Input id="reg-key" value={form.api_key} onChange={(e) => setForm((f) => ({ ...f, api_key: e.target.value }))} placeholder="GoDaddy API key (Production)" autoComplete="off" />- </div>- <div className="form-group">- <Label htmlFor="reg-secret">API secret</Label>- <Input id="reg-secret" type="password" value={form.api_secret} onChange={(e) => setForm((f) => ({ ...f, api_secret: e.target.value }))} placeholder="GoDaddy API secret" autoComplete="off" />+ <Input id="reg-key" value={form.api_key} onChange={(e) => setForm((f) => ({ ...f, api_key: e.target.value }))} placeholder={isNamecheap ? 'Namecheap API key' : 'GoDaddy API key (Production)'} autoComplete="off" /></div>+ {isNamecheap ? (+ <>+ <div className="form-group">+ <Label htmlFor="reg-user">API username</Label>+ <Input id="reg-user" value={form.username} onChange={(e) => setForm((f) => ({ ...f, username: e.target.value }))} placeholder="Namecheap account username" autoComplete="off" />+ </div>+ <div className="form-group">+ <Label htmlFor="reg-ip">Allow-listed IP</Label>+ <Input id="reg-ip" value={form.client_ip} onChange={(e) => setForm((f) => ({ ...f, client_ip: e.target.value }))} placeholder="This server's public IP" autoComplete="off" />+ </div>+ </>+ ) : (+ <div className="form-group">+ <Label htmlFor="reg-secret">API secret</Label>+ <Input id="reg-secret" type="password" value={form.api_secret} onChange={(e) => setForm((f) => ({ ...f, api_secret: e.target.value }))} placeholder="GoDaddy API secret" autoComplete="off" />+ </div>+ )}</div>{provider.docUrl && (<a className="conn-form__doc" href={provider.docUrl} target="_blank" rel="noreferrer">diff --git a/frontend/src/components/settings/connections/providerCatalog.js b/frontend/src/components/settings/connections/providerCatalog.jsindex f2cd8d1d..e5ce0fb9 100644--- a/frontend/src/components/settings/connections/providerCatalog.js+++ b/frontend/src/components/settings/connections/providerCatalog.js@@ -81,7 +81,11 @@ export const CONNECTION_PROVIDERS = [blurb: 'Track domains you own at GoDaddy and when they expire.',docUrl: 'https://developer.godaddy.com/keys', manageHref: '/domains',},- { id: 'namecheap', category: 'registrar', name: 'Namecheap', comingSoon: true, blurb: 'Domain ownership and expiry from Namecheap.' },+ {+ id: 'namecheap', category: 'registrar', name: 'Namecheap', kind: 'registrar', provider: 'namecheap',+ blurb: 'Track domains you own at Namecheap and when they expire.',+ docUrl: 'https://ap.www.namecheap.com/settings/tools/apiaccess/', manageHref: '/domains',+ },// ── Email & delivery ──{