1
0
mirror of https://github.com/binary-kitchen/doorlockd synced 2024-12-22 18:34:25 +01:00

display: allow only local connections

Signed-off-by: Ralf Ramsauer <ralf@binary-kitchen.de>
This commit is contained in:
Ralf Ramsauer 2018-03-18 15:48:00 +01:00
parent eeafa6350f
commit 8bf57eaf54

View File

@ -10,7 +10,7 @@ from time import sleep
from random import sample from random import sample
from serial import Serial from serial import Serial
from flask import Flask, render_template, request, Markup from flask import abort, Flask, render_template, request, Markup
from flask_bootstrap import Bootstrap from flask_bootstrap import Bootstrap
from flask_socketio import SocketIO from flask_socketio import SocketIO
from flask_wtf import FlaskForm from flask_wtf import FlaskForm
@ -230,6 +230,8 @@ def on_connect():
@webapp.route('/display') @webapp.route('/display')
def display(): def display():
if request.remote_addr != '127.0.0.1':
abort(403)
return render_template('display.html') return render_template('display.html')