Small fixes
This commit is contained in:
parent
026618b8d1
commit
572fcbed6d
|
@ -33,4 +33,5 @@ EXPOSE 8080/tcp
|
|||
# Copy in the code
|
||||
COPY slinky slinky/
|
||||
COPY templates templates/
|
||||
COPY config.yaml .
|
||||
COPY main.py .
|
||||
|
|
|
@ -1,2 +1,4 @@
|
|||
---
|
||||
db: sqlite:///slinky.db
|
||||
allowed_ips:
|
||||
- 127.0.0.1
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
flask
|
||||
flask_bootstrap
|
||||
flask_wtf
|
||||
psycopg2-binary
|
||||
pyyaml
|
||||
waitress
|
||||
Flask-SQLAlchemy
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<!-- Begin page content -->
|
||||
<main class="container">
|
||||
<div class="container">
|
||||
<h1 class="mt-5">Add a shortcode</h1>
|
||||
<h1 class="mt-5">Shortcodes</h1>
|
||||
</div>
|
||||
<br />
|
||||
<div id="content">
|
||||
|
|
|
@ -82,7 +82,7 @@ def protect(func: Callable[..., Response]) -> Callable[..., Response]:
|
|||
|
||||
@wraps(func)
|
||||
def check_ip(*args: Any, **kwargs: Any) -> Response:
|
||||
if request.remote_addr not in cfg['allowed_ips']:
|
||||
if request.headers['X-Forwarded-For'] not in cfg['allowed_ips']:
|
||||
print(f'Protected URL access attempt from {request.remote_addr}')
|
||||
return Response('Not found', 404)
|
||||
return func(*args, **kwargs)
|
||||
|
|
Loading…
Reference in a new issue