mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-04-25 17:16:00 +03:00
[GH-ISSUE #1449] Bug: can't set CSRF_TRUSTED_ORIGINS, preventing login when behind a load balancer #3883
Labels
No labels
expected: maybe someday
expected: next release
expected: release after next
expected: unlikely unless contributed
good first ticket
help wanted
pull-request
scope: all users
scope: windows users
size: easy
size: hard
size: medium
size: medium
status: backlog
status: blocked
status: done
status: idea-phase
status: needs followup
status: wip
status: wontfix
touches: API/CLI/Spec
touches: configuration
touches: data/schema/architecture
touches: dependencies/packaging
touches: docs
touches: js
touches: views/replayers/html/css
why: correctness
why: functionality
why: performance
why: security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ArchiveBox#3883
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Originally created by @ethitter on GitHub (Jun 5, 2024).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/1449
Describe the bug
We're trying to run ArchiveBox in AWS Fargate, with the container accessed via an AWS ALB. We've set
ALLOWED_HOSTSto the default of*, but cannot log in due to the CSRF protection on the login page. With debug enabled, we're stuck at this error:Per the Django docs, we need to set
CSRF_TRUSTED_ORIGINS, but that doesn't seem possible right now.Steps to reproduce
devimage, behind load balancerALLOWED_HOSTSenvar to*Screenshots or log output
ArchiveBox version
@dotfrankruan commented on GitHub (Jun 9, 2024):
Same problem here
@carsaig commented on GitHub (Jun 11, 2024):
same issue here. Any suggestions? Pulled it up on two different hosts. No success.
@lkubb commented on GitHub (Jun 11, 2024):
This can be worked around either via https://github.com/ArchiveBox/ArchiveBox/pull/866#issuecomment-2158201512 or by mounting a modified https://github.com/ArchiveBox/ArchiveBox/blob/dev/archivebox/core/settings.py that includes the necessary
CSRF_TRUSTED_ORIGINS = ["https://my.archivebox.domain"]over the original inside the container at/app/archivebox/core/settings.py@nguyenmp commented on GitHub (Oct 21, 2024):
FYI, the environment variable
CSRF_TRUSTED_ORIGINSoverrides anything insettings.pyso when I copied the example docker compose file from the repo, it carriedCSRF_TRUSTED_ORIGINS=https://archivebox.example.comwith it. I was able to figure it out by going to http://localhost:8000/admin/environment/config/ and reading the actual value set.