Skip to content

Commit

Permalink
🚑 Fix forwarding IPs in docker container for security reasons
Browse files Browse the repository at this point in the history
Fixes #16
  • Loading branch information
b0g3r committed Mar 16, 2020
1 parent c0b3e1b commit fe777e3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "ppm-telegram-bot"
version = "0.1.7"
version = "0.1.8"
description = ""
authors = ["Dima Boger <[email protected]>"]
license = "MIT"
Expand Down
10 changes: 9 additions & 1 deletion run-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,12 @@
WORKERS_NUM=${1:-1}
PORT=${2:-8000}

exec 2>&1 gunicorn ppm_telegram_bot.api:app --workers=$WORKERS_NUM --worker-class=uvicorn.workers.UvicornWorker --bind=0.0.0.0:$PORT
# see https://github.com/encode/uvicorn/issues/589
export FORWARDED_ALLOW_IPS="*"

exec 2>&1 gunicorn \
ppm_telegram_bot.api:app \
--forwarded-allow-ips="*" \
--workers=$WORKERS_NUM \
--worker-class=uvicorn.workers.UvicornWorker \
--bind=0.0.0.0:$PORT

0 comments on commit fe777e3

Please sign in to comment.