-
-
Notifications
You must be signed in to change notification settings - Fork 962
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added production docker image with preview domain support #1627
Conversation
8f1b9d5
to
ef0fff3
Compare
8a608b3
to
af5cbef
Compare
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
@pauloxnet Unfortunately I see the same HTTP 403 after downgrading to I will try downgrading the docker image to 3.8 and the old stripe to see if it's some other problem (maybe related to the alternate domain?). |
I see. Good Idea. But I think you have downgrade from Python 3.12 to Python 3.8 also in the pipelines. Maybe. |
Thanks! Yeah |
Do you think we can separate this PR having in place all the changes but not the Python 3.12 upgrade ? In this way we can have a preview instance as similar as possible as the production environment? After that we would upgrade to Python 3.12? |
@pauloxnet I see the same 403 with older Stripe and Python 3.8. It's deployed now if you want to try it: https://www.preview.djangoproject.com/fundraising/ (basic auth: Maybe the preview domain needs to be allowed in Stripe or something? Or Stripe is trying to post back to us and getting caught by basic auth? I'm sorry I am not familiar with how this works. |
Sorry, I didn't pay close enough attention to the error. It looks like jQuery is not passing along the basic auth so we're sending a 403 to ourselves. |
@pauloxnet I deployed without basic auth, but I'm afraid I still see the same 403, and I'm out of time to debug at the moment. I'll leave it this way for a little bit and re-install basic auth later today or tomorrow. Please feel free to leave any suggested changes and/or let me know if you would like me to deploy again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still see some error in the pipeline.
I suggest to revert all upgrade of Python and leave in this PR all changes useful to have a preview instance.
When we'll have a working environment to test the donation flow we'll open another PR to upgrade Python and other packages step by step.
Co-authored-by: Paolo Melchiorre <paolo@melchiorre.org>
The issue seems related with CSRF because other POST actions are not working either like:
In the response of the POST call I read |
Good catch. Can you tell why this is happening for the preview domain but not
Since it looks like jQuery was passing on the basicauth after all, I re-deployed it for now to prevent search engines from indexing the site while we debug this. |
It's strange indeed. I think you activate before
I've no idea right now (in Europe). I tag this PR for searching for help from @django/djangoproject-com-maintainters and @django/ops-team |
@pauloxnet It's working now. I forgot to include I believe this PR should be safe to merge even before migrating production to Podman, since it uses the same Python version ( I will look through the PR one more time and mark it ready for review. |
I'll do a final review ASAP |
tox.ini
Outdated
@@ -1,22 +1,13 @@ | |||
[tox] | |||
envlist =py38-{tests,flake8,black,isort} | |||
envlist =py38-{tests,precommit} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would do the changes in this file in a separate PR, I think is not blocking for the goal of this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. I will remove these changes and make a new PR to add Python 3.12 support, hopefully both at the same time, and include these changes there.
Co-authored-by: Paolo Melchiorre <paolo@melchiorre.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Background
Overview
This PR includes the following changes:
Dockerfile
to support a production environment, includinggunicorn
and the necessary C libraries to operate the site.DOMAIN_NAME
(formerly, hard-coded todjangoproject.com
) from the environment. This is necessary to access a "preview" or "staging" version of the site on a different server before it goes live. Previously, we could issue a certificate via ACME DNS on the backend to access the site, but Fastly uses the same ACME challenge URL, so this is not an option. Since the main site uses HSTS, it's noisort
andflake8
checks to run only viapre-commit
Why is all this necessary? Isn't there an easier way to get Python 3.12?