added CSRF trusted origin config, added tzdata - needed in debug mode #22
No reviewers
Labels
No Label
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: mhu/shimatta-kenkyusho#22
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "sst/some-weird-stuff-with-docker"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -56,6 +56,7 @@ if get_env_value('DJANGO_FORCE_DEV_MODE', default=False) == 'True':
ALLOWED_HOSTS = ['127.0.0.1', 'localhost', get_env_value('DJANGO_ALLOWED_HOST')]
CSRF_TRUSTED_ORIGINS =['https://' + get_env_value('DJANGO_ALLOWED_HOST')]
This seems very unsafe!
I'm still processing that 😄 So I will probably come back to this PR tomorrow when I had a nights sleep over that.
@ -240,2 +239,4 @@
SECURE_SSL_REDIRECT = False
# allow detection of https behind "old" nginx
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
I don't get this. This should only be a problem, if django actually wants to check for HTTPS.
I don't need tha toption and everything looks fine.
Have you checked that Line #239 says
SECURE_SSL_REDIRECT = False
in your case as well when running?If this is the case:
Can you have a look at your
docker ps
when running it from the docker compose setup and see if the container is "healthy"?This health check uses a curl command to get a static HTTP OK response. This only works without https, because inside the container there is not https setup.
Can you also have a look at:
https://stackoverflow.com/questions/28001659/django-secure-proxy-ssl-header-requires-referer
This describes some other stuff and mentions a sort of redirect loop, I think you also experienced before, right?
https://medium.com/django-deployment/how-to-fix-djangos-https-redirects-in-nginx-63d304ddb19c
Tossing that into the mix as well...
Okay, I think I found the root cause of the issue:
So django either detects it from the WSGI or from the set header if the setting sis set.
I guess our container IPs are differntly random bricking that?!
I will do some further tests on my side and look, what the formwarded protocol looks like.
As I was finally able to reproduce all that stuff, it's okay.