first 4 steps of launch
This commit is contained in:
@@ -18,6 +18,7 @@ import json
|
||||
import smtplib
|
||||
import requests
|
||||
from functools import wraps
|
||||
import socket
|
||||
|
||||
# Set up logging to show in console
|
||||
logging.basicConfig(
|
||||
@@ -1681,4 +1682,40 @@ def init_routes(main_bp):
|
||||
flash('This page is only available in master instances.', 'error')
|
||||
return redirect(url_for('main.dashboard'))
|
||||
|
||||
return render_template('main/launch_progress.html')
|
||||
# Get NGINX settings
|
||||
nginx_settings = KeyValueSettings.get_value('nginx_settings')
|
||||
|
||||
return render_template('main/launch_progress.html', nginx_settings=nginx_settings)
|
||||
|
||||
@main_bp.route('/api/check-dns', methods=['POST'])
|
||||
@login_required
|
||||
@require_password_change
|
||||
def check_dns():
|
||||
if not os.environ.get('MASTER', 'false').lower() == 'true':
|
||||
return jsonify({'error': 'Unauthorized'}), 403
|
||||
|
||||
data = request.get_json()
|
||||
if not data or 'domains' not in data:
|
||||
return jsonify({'error': 'No domains provided'}), 400
|
||||
|
||||
domains = data['domains']
|
||||
results = {}
|
||||
|
||||
for domain in domains:
|
||||
try:
|
||||
# Try to resolve the domain
|
||||
ip_address = socket.gethostbyname(domain)
|
||||
results[domain] = {
|
||||
'resolved': True,
|
||||
'ip': ip_address
|
||||
}
|
||||
except socket.gaierror:
|
||||
results[domain] = {
|
||||
'resolved': False,
|
||||
'error': 'No DNS record found'
|
||||
}
|
||||
|
||||
return jsonify({
|
||||
'success': True,
|
||||
'results': results
|
||||
})
|
||||
Reference in New Issue
Block a user