diff --git a/backend/app/routes/cf_accounts.py b/backend/app/routes/cf_accounts.py index 6792004..2e92fe9 100644 --- a/backend/app/routes/cf_accounts.py +++ b/backend/app/routes/cf_accounts.py @@ -54,7 +54,8 @@ def create_cf_account(current_admin): api_token=data['api_token'], # TODO: Encrypt this max_domains=data.get('max_domains', 100), notes=data.get('notes'), - is_active=data.get('is_active', True) + is_active=data.get('is_active', True), + use_for_verification=data.get('use_for_verification', True) ) db.session.add(account) @@ -105,6 +106,8 @@ def update_cf_account(current_admin, account_id): account.notes = data['notes'] if 'is_active' in data: account.is_active = data['is_active'] + if 'use_for_verification' in data: + account.use_for_verification = data['use_for_verification'] db.session.commit() diff --git a/backend/migrations/add_use_for_verification.sql b/backend/migrations/add_use_for_verification.sql new file mode 100644 index 0000000..104a626 --- /dev/null +++ b/backend/migrations/add_use_for_verification.sql @@ -0,0 +1,15 @@ +-- Migration: Add use_for_verification field to cloudflare_account table +-- Date: 2026-01-12 + +-- Add use_for_verification column +ALTER TABLE cloudflare_account +ADD COLUMN IF NOT EXISTS use_for_verification BOOLEAN DEFAULT TRUE; + +-- Update existing records to TRUE (default behavior) +UPDATE cloudflare_account +SET use_for_verification = TRUE +WHERE use_for_verification IS NULL; + +-- Add comment +COMMENT ON COLUMN cloudflare_account.use_for_verification IS 'Whether this account can be used for customer domain verification'; + diff --git a/frontend/src/pages/CFAccounts.jsx b/frontend/src/pages/CFAccounts.jsx index 56964b8..1b62121 100644 --- a/frontend/src/pages/CFAccounts.jsx +++ b/frontend/src/pages/CFAccounts.jsx @@ -14,6 +14,7 @@ const CFAccounts = () => { max_domains: 100, notes: '', is_active: true, + use_for_verification: true, }); useEffect(() => { @@ -67,6 +68,7 @@ const CFAccounts = () => { max_domains: account.max_domains, notes: account.notes || '', is_active: account.is_active, + use_for_verification: account.use_for_verification !== undefined ? account.use_for_verification : true, }); } else { resetForm(); @@ -83,6 +85,7 @@ const CFAccounts = () => { max_domains: 100, notes: '', is_active: true, + use_for_verification: true, }); }; @@ -221,6 +224,21 @@ const CFAccounts = () => { +
+ Allow this account to be used for customer domain verification +
+