worker: tlsa bug fixes
All checks were successful
Build Docker / Build Bot (push) Successful in 25s
Build Docker / Build Master (push) Successful in 27s

This commit is contained in:
2023-08-17 13:48:08 +10:00
parent fccfddca51
commit d50f130b0e
2 changed files with 8 additions and 8 deletions

View File

@@ -38,9 +38,14 @@ def tlsa():
domain = request.args.get('domain')
if domain == None:
return jsonify({'error': 'Invalid domain', 'success': 'false'})
script = 'bash tlsa.sh ' + domain
# Get output from script
tlsa = os.popen(script).read()
tlsa = None
try:
tlsa_file = open('wordpress-'+domain+'/tlsa.txt', 'r')
tlsa = tlsa_file.readlines()
tlsa_file.close()
except FileNotFoundError:
return jsonify({'error': 'TLSA record not found', 'success': 'false'})
return jsonify({'domain': domain, 'tlsa': tlsa})