main: Added tlsa and a few bug fixes
All checks were successful
Build Docker / Build Master (push) Successful in 26s
Build Docker / Build Bot (push) Successful in 25s

This commit is contained in:
2023-08-17 13:27:57 +10:00
parent 1f316e3a94
commit d6db4adf50
6 changed files with 65 additions and 7 deletions

View File

@@ -166,6 +166,26 @@ def list_workers():
return jsonify({'success': 'true', 'workers': worker_list})
@app.route('/tlsa', methods=['GET'])
def tlsa():
domain = request.args.get('domain')
if domain == None:
return jsonify({'error': 'Invalid domain', 'success': 'false'})
# Check if domain exists
if not site_exists(domain):
return jsonify({'error': 'Domain does not exist', 'success': 'false'})
# Get worker
worker = site_worker(domain)
if worker == None:
return jsonify({'error': 'Domain does not exist', 'success': 'false'})
# Get TLSA record
resp=requests.get("http://"+worker + ":5000/tlsa?domain=" + domain,timeout=2)
return resp.json()
def get_sites_count():
# If file doesn't exist, create it