diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 6dbf4bc..ad80147 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -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" ]] diff --git a/kubernetes/flower.yaml b/kubernetes/flower.yaml index cf165e4..729dc9c 100644 --- a/kubernetes/flower.yaml +++ b/kubernetes/flower.yaml @@ -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: diff --git a/kubernetes/tasks.yaml b/kubernetes/tasks.yaml index e05170a..267ed88 100644 --- a/kubernetes/tasks.yaml +++ b/kubernetes/tasks.yaml @@ -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: diff --git a/kubernetes/web.yaml b/kubernetes/web.yaml index b047fee..98eee75 100644 --- a/kubernetes/web.yaml +++ b/kubernetes/web.yaml @@ -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: diff --git a/pypistats/run.py b/pypistats/run.py index 0dacaf8..05f71b0 100644 --- a/pypistats/run.py +++ b/pypistats/run.py @@ -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}") diff --git a/pyproject.toml b/pyproject.toml index 089bb90..b4ee384 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pypistatsorg" -version = "10" +version = "11" description = "Download counts dashboard for python packages" authors = ["Flynn "]