diff --git a/master/main.py b/master/main.py index 0dbc366..aacbe9d 100644 --- a/master/main.py +++ b/master/main.py @@ -233,6 +233,35 @@ def site_status(): return jsonify({'success': 'false', 'domain': domain, 'ip': publicIP, 'tlsa': 'none','error': 'No TLSA record found'}) +@app.route('/info') +def site_status(): + domain = request.args.get('domain') + if domain == None: + return "

Invalid domain

" + + # Check if domain exists + if not site_exists(domain): + return "

Domain does not exist

" + + # Get worker + worker = site_worker(domain) + if worker == None: + return "

Domain does not exist

" + + # Get worker ip + ip = workerIP_PRIV(worker) + + # Get TLSA record + resp=requests.get("http://"+ip + ":5000/tlsa?domain=" + domain,timeout=2) + json = resp.json() + publicIP = workerIP(worker) + + if "tlsa" in json: + tlsa = json['tlsa'] + return "

Domain: " + domain + "


IP: " + publicIP + "


TLSA: " + tlsa + "


Make sure to add the TLSA record to `_443._tcp." + domain + "` or `*." + domain + "`

" + else: + return "

Domain: " + domain + "


IP: " + publicIP + "


TLSA: none


No TLSA record found

" + @app.route('/tlsa', methods=['GET']) def tlsa(): domain = request.args.get('domain') @@ -651,7 +680,7 @@ def addsite(): html += "

Domain: " + domain + "

" html += "

Worker: " + worker.split(':')[0] + "

" html += "

Worker IP: " + worker.split(':')[1].strip('\n') + "

" - html += "

Check status here

" + html += "

Check status

" return html