Commit d8e46e30 by Tu Nombre

Mejora critica de seguridad

1 parent 7a65f711
#-*- coding: utf-8 -*- #-*- coding: utf-8 -*-
from flask import Flask, render_template, request, url_for, make_response, redirect from flask import Flask, render_template, request, url_for, make_response, redirect
from flask import send_from_directory, abort
from iselenium import SeleniumInterface as SI from iselenium import SeleniumInterface as SI
import random, json, os, datetime, ingenieros,apollo, fosadiaria import random, json, os, datetime, ingenieros,apollo, fosadiaria
import configuracion import configuracion
...@@ -53,6 +54,13 @@ def main(): ...@@ -53,6 +54,13 @@ def main():
bypass = False bypass = False
) )
@app.route('/protected_static/<path:filename>')
def protected_static(filename):
if "login" in request.cookies:
return send_from_directory('protected_static', filename)
else:
return abort(403)
@app.route('/historico') @app.route('/historico')
def historico(): def historico():
if "login" not in request.cookies: if "login" not in request.cookies:
...@@ -115,6 +123,9 @@ def manual(): ...@@ -115,6 +123,9 @@ def manual():
bypass = True bypass = True
) )
@app.route('/anomalies', methods = ['POST']) @app.route('/anomalies', methods = ['POST'])
def anomalies(): def anomalies():
if "login" not in request.cookies: if "login" not in request.cookies:
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<meta http-equiv="X-UA-Compatible" content="ie=edge"> <meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="{{ url_for('static', filename = 'styles/general.css') }}"> <link rel="stylesheet" href="{{ url_for('static', filename = 'styles/general.css') }}">
<script src="{{ url_for('static', filename = 'src/historico.js') }}"></script> <script src="/protected_static/historico.js"></script>
<!--INCLUIMOS LA FUENTE <!--INCLUIMOS LA FUENTE
<link rel="stylesheet" media="screen" href="https://fontlibrary.org/face/cmu-typewriter" type="text/css" /> <link rel="stylesheet" media="screen" href="https://fontlibrary.org/face/cmu-typewriter" type="text/css" />
--> -->
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!