maj apikaz
This commit is contained in:
parent
d62a0ee43a
commit
0e539b4cac
@ -64,30 +64,17 @@ swagger = Swagger(app, template={
|
|||||||
|
|
||||||
#TODO:
|
#TODO:
|
||||||
# check variables
|
# check variables
|
||||||
# fail2ban (ou alors sur traefik)
|
# fail2ban (ou alors sur traefik: https://github.com/tomMoulard/fail2ban)
|
||||||
# découper app.py en service
|
|
||||||
# quels scripts bash garder ?
|
# quels scripts bash garder ?
|
||||||
#fin TODO
|
#fin TODO
|
||||||
|
|
||||||
#*************************************************
|
#*************************************************
|
||||||
#Filtrer les IP qui peuvent accéder à l'api
|
#Filtrer les IP qui peuvent accéder à l'api
|
||||||
#TODO: au lieu d'avoir les IP en dur, prendre le fichier allow_ip'
|
#fait par traeffik
|
||||||
|
|
||||||
trusted_ips = [
|
# trusted_ips = [
|
||||||
"176.180.83.10",
|
# "1.2.3.4",
|
||||||
"82.64.20.246",
|
# ]
|
||||||
"31.39.14.228",
|
|
||||||
"51.75.112.172",
|
|
||||||
"80.11.47.59",
|
|
||||||
"90.121.138.71",
|
|
||||||
"109.190.2.75",
|
|
||||||
"89.234.177.115",
|
|
||||||
"80.215.140.40",
|
|
||||||
"80.67.176.91",
|
|
||||||
"89.234.177.119",
|
|
||||||
"78.127.1.19",
|
|
||||||
"80.215.236.243"
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
#*************************************************
|
#*************************************************
|
||||||
@ -111,10 +98,10 @@ mail = Mail(app)
|
|||||||
|
|
||||||
|
|
||||||
#*************************************************
|
#*************************************************
|
||||||
@app.before_request
|
# @app.before_request
|
||||||
def limit_remote_addr():
|
# def limit_remote_addr():
|
||||||
if request.environ['HTTP_X_FORWARDED_FOR'] not in trusted_ips:
|
# if request.environ['HTTP_X_FORWARDED_FOR'] not in trusted_ips:
|
||||||
abort(jsonify(message="Et pis quoi encore ?"), 400)
|
# abort(jsonify(message="Et pis quoi encore ?"), 400)
|
||||||
|
|
||||||
#*************************************************
|
#*************************************************
|
||||||
#authent mdp/pass basique
|
#authent mdp/pass basique
|
||||||
|
Loading…
Reference in New Issue
Block a user