fix limiter

This commit is contained in:
flynn
2022-02-03 20:53:55 -05:00
parent fb98bcaa01
commit 70a10f9941
6 changed files with 8 additions and 8 deletions

View File

@@ -7,7 +7,7 @@ fi
if [[ "$1" = "web" ]]
then
exec poetry run gunicorn -b 0.0.0.0:5000 -w 2 --access-logfile - --error-log - --access-logformat "%({x-forwarded-for}i)s %(h)s %(l)s %(u)s %(t)s \"%(r)s\" %(s)s %(b)s \"%(f)s\" \"%(a)s\"" pypistats.run:app
exec poetry run gunicorn -b 0.0.0.0:5000 -w 2 --access-logfile - --error-log - --access-logformat "%({x-forwarded-for}i)s %(l)s %(h)s %(l)s %(u)s %(t)s \"%(r)s\" %(s)s %(b)s \"%(f)s\" \"%(a)s\"" pypistats.run:app
fi
if [[ "$1" = "celery" ]]

View File

@@ -20,7 +20,7 @@ spec:
spec:
containers:
- name: pypistats-flower
image: us.gcr.io/pypistats-org/pypistats:10
image: us.gcr.io/pypistats-org/pypistats:11
imagePullPolicy: Always
args: ["flower"]
envFrom:

View File

@@ -20,14 +20,14 @@ spec:
spec:
containers:
- name: beat
image: us.gcr.io/pypistats-org/pypistats:10
image: us.gcr.io/pypistats-org/pypistats:11
imagePullPolicy: Always
args: ["beat"]
envFrom:
- secretRef:
name: pypistats-secrets
- name: celery
image: us.gcr.io/pypistats-org/pypistats:10
image: us.gcr.io/pypistats-org/pypistats:11
imagePullPolicy: Always
args: ["celery"]
envFrom:

View File

@@ -20,7 +20,7 @@ spec:
spec:
initContainers:
- name: migrate
image: us.gcr.io/pypistats-org/pypistats:10
image: us.gcr.io/pypistats-org/pypistats:11
imagePullPolicy: Always
envFrom:
- secretRef:
@@ -28,7 +28,7 @@ spec:
args: ["migrate"]
containers:
- name: web
image: us.gcr.io/pypistats-org/pypistats:10
image: us.gcr.io/pypistats-org/pypistats:11
imagePullPolicy: Always
envFrom:
- secretRef:

View File

@@ -19,7 +19,7 @@ env = os.environ.get("ENV", "development")
app = create_app(configs[env])
# Rate limiting per IP/worker
app.wsgi_app = ProxyFix(app.wsgi_app)
app.wsgi_app = ProxyFix(app.wsgi_app, x_for=2)
limiter = Limiter(app, key_func=get_remote_address, application_limits=["5 per second", "30 per minute"])
app.logger.info(f"Environment: {env}")

View File

@@ -1,6 +1,6 @@
[tool.poetry]
name = "pypistatsorg"
version = "10"
version = "11"
description = "Download counts dashboard for python packages"
authors = ["Flynn <crf204@gmail.com>"]