feat(domains): migrate user namespaces to wildcard CNAMEs
Build and publish Docker image / build-and-publish (push) Successful in 8s
Build and publish Docker image / build-and-publish (push) Successful in 8s
This commit is contained in:
1 parent
82fa50e9d5
commit
2768f5f97d
6 files changed
+503
-296
No files matched your search
+5
-19
@@ -20,7 +20,7 @@ bp = Blueprint("domains", __name__)
|
||||
|
||||
@bp.route('/api/dnssec/fix-all', methods=['POST'])
|
||||
def fix_all_dnssec_api():
|
||||
"""Fix DNSSEC delegation for all user domains"""
|
||||
"""Retired: DNSSEC now belongs to the parent zone, not user namespaces."""
|
||||
try:
|
||||
token = get_bearer_token()
|
||||
user = authenticate_user(token)
|
||||
@@ -29,16 +29,7 @@ def fix_all_dnssec_api():
|
||||
if not user or user.get('role') != 'admin':
|
||||
return jsonify({'error': 'Admin access required'}), 403
|
||||
|
||||
if not domain_manager:
|
||||
return jsonify({'error': 'Domain manager not available'}), 503
|
||||
|
||||
# Run the fix
|
||||
domain_manager.fix_all_dnssec_delegations()
|
||||
|
||||
return jsonify({
|
||||
'success': True,
|
||||
'message': 'DNSSEC fix process initiated. Check logs for details.'
|
||||
}), 200
|
||||
return jsonify({'error': 'Per-user DNSSEC delegation is retired; DNSSEC is managed on the parent zone.'}), 410
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"Error fixing DNSSEC: {e}")
|
||||
@@ -46,7 +37,7 @@ def fix_all_dnssec_api():
|
||||
|
||||
@bp.route('/api/dnssec/verify/<username>', methods=['GET'])
|
||||
def verify_dnssec_api(username):
|
||||
"""Verify DNSSEC delegation for a user"""
|
||||
"""Retired: DNSSEC is inherited from the parent zone."""
|
||||
try:
|
||||
token = get_bearer_token()
|
||||
user = authenticate_user(token)
|
||||
@@ -55,12 +46,7 @@ def verify_dnssec_api(username):
|
||||
if not user or (user.get('role') != 'admin' and user.get('username') != username):
|
||||
return jsonify({'error': 'Unauthorized'}), 403
|
||||
|
||||
if not domain_manager:
|
||||
return jsonify({'error': 'Domain manager not available'}), 503
|
||||
|
||||
result = domain_manager.setup_dnssec_delegation(username)
|
||||
|
||||
return jsonify(result), 200 if result.get('success') else 500
|
||||
return jsonify({'error': 'Per-user DNSSEC delegation is retired; DNSSEC is managed on the parent zone.'}), 410
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"Error verifying DNSSEC: {e}")
|
||||
@@ -103,7 +89,7 @@ def sync_domains_api():
|
||||
domains = get_user_domains(user['id'], True)
|
||||
return jsonify({
|
||||
'success': True,
|
||||
'message': 'Domains synced successfully',
|
||||
'message': 'DNS namespace verified and wildcard records are ready',
|
||||
'domains': domains,
|
||||
'count': len(domains)
|
||||
}), 200
|
||||
|
||||
Reference in new issue
Block a user