mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-04-25 17:16:00 +03:00
[GH-ISSUE #1531] Question: How to set ALLOWED_HOSTS and CSRF_TRUSTED_ORIGINS for Web UI #3926
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#3926
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 @VertyyBird on GitHub (Oct 11, 2024).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/1531
I followed the instructions on the wiki, the docker container for ArchiveBox is running, I did
archivebox server 0.0.0.0:8005but I get a 400 error when going to my site. I turned on debug and got a detailed error that I'll put at the end of this post. If you want to see the error first hand, you can go to https://archive.verty.gay. I'll leave it as is for now.I'm running DirectAdmin on the same server and used this custom httpd.conf for the domain I want the web UI on:
I'm not sure what I've done wrong here, any help is appreciated.
Error Report
@pirate commented on GitHub (Oct 11, 2024):
The title of the error says you have not added your domain to
ALLOWED_HOSTS, did you try adding it?To help any further I need the full output of
archivebox version(as mentioned in the issue template) + the contents ofArchiveBox.confand yourdocker-compose.ymlfile if you are using one.@VertyyBird commented on GitHub (Oct 11, 2024):
Sorry about that, I didn't see a template when I wrote my post. But yes, I did add the domain to
ALLOWED_HOSTS. Both when I first editeddocker-compose.ymland afterwards I ranarchivebox config --set ALLOWED_HOSTS=archive.verty.gayHere's what you asked for.
archivebox version output
ArchiveBox.conf
docker-compose.yml
@pirate commented on GitHub (Oct 11, 2024):
Aha I believe the value in
docker-compose.ymlis wrong, it should beALLOWED_HOSTS=archive.verty.gaynotALLOWED_HOSTS=https://archive.verty.gay/.CSRF_TRUSTED_ORIGINS takes a full url prefix, whereas ALLOWED_HOSTS takes a bare domain.
In v0.8.x you will only need to set ALLOWED_HOSTS, and the docs will be improved to make this clearer.
Sorry it's annnoying right now to have to set both in a slightly different way.
Btw environment variables (
docker-compose.ymlenvironment:) take precendece over anything set inArchiveBox.conf. There's no need to set things in both places, I recommend only usingArchiveBox.conf, so you can remove both those settings from yourdocker-compose.ymland just set them inArchiveBox.conf.@VertyyBird commented on GitHub (Oct 12, 2024):
Sorry it took a while to get back on this. That did fix my issue. Also had to redo the ports, but that was user error on my part.
Thanks for the help :)