Skip to content
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

CSRF verification failed. Request aborted. #772

Closed
Tracked by #783
spiralham opened this issue Feb 25, 2025 · 6 comments · Fixed by #786
Closed
Tracked by #783

CSRF verification failed. Request aborted. #772

spiralham opened this issue Feb 25, 2025 · 6 comments · Fixed by #786

Comments

@spiralham
Copy link

After updating to version 0.13.7 I'm getting this when trying to add a new Youtube channel: (If it matters I'm using postgres)

Image

Image

@meeb
Copy link
Owner

meeb commented Feb 25, 2025

Ah, this'll be a Django 5-ism after the upgrade. Thanks for the issue. Can you confirm that your TUBESYNC_HOSTS env var is set correctly?

@tcely tcely moved this from Untriaged to Todo in Status Feb 25, 2025
@jimsnevets
Copy link

jimsnevets commented Feb 25, 2025

First time installing this today, having the same issue, running in Docker.

Been trying various TUBESYNC_HOSTS and CSRF_TRUSTED_ORIGINS configs to no avail.

@tcely
Copy link
Contributor

tcely commented Feb 25, 2025

Try pulling an older image from before that change to get up and running:

docker pull ghcr.io/meeb/tubesync:latest@sha256:d668a7f3cbbe4215773144fd88e1a8c0edef9cd0af46504a0e8b2f83569a0f25

We'll work on solving this for the newer version, but you shouldn't have to wait for that to finish.

@jimsnevets
Copy link

Thanks, managed to get this working for now by manually editing settings.py within the container.

Added the following line, restarted the container:

CSRF_TRUSTED_ORIGINS = ['http://192.168.1.20:4848']

Perhaps that's a new format required by Django? I'm not across this much at all, but just some things I've picked up working on this.

@tcely
Copy link
Contributor

tcely commented Feb 25, 2025

That's interesting. Thanks.

FYI, local_settings.py is meant for you to copy and modify with anything you want to change. You can bind mount a file into your docker container.

Something like this:

mkdir -v -p ~/.config/tubesync/config
# copy from a running container named TubeSync
docker cp -a TubeSync:/app/tubesync/local_settings.py - | tar -C ~/.config/tubesync/ -xpv
# OR use curl to download the latest version from GitHub
curl -Lo ~/.config/tubesync/local_settings.py \
  'https://github.com/meeb/tubesync/raw/refs/heads/main/tubesync/tubesync/local_settings.py.container'

# Edit ~/.config/tubesync/local_settings.py with any changes
editor ~/.config/tubesync/local_settings.py

# Stop and remove the old TubeSync container without the mount
docker stop TubeSync
docker rm TubeSync

# Temporarily pull a working version of the image
docker pull ghcr.io/meeb/tubesync:latest@sha256:d668a7f3cbbe4215773144fd88e1a8c0edef9cd0af46504a0e8b2f83569a0f25

# Start the TubeSync container with the new bind mount.
# Do NOT forget to change the source for your /downloads volume,
# in the example below.
docker run --name TubeSync -d -p 4848:4848 \
  -v ~/.config/tubesync/local_settings.py:/app/tubesync/local_settings.py:ro \
  -e PUID="$(id -u)" \
  -e PGID="$(id -g)" \
  -v ~/.config/tubesync/config:/config \
  -v /some/directory/tubesync-downloads:/downloads \
  ghcr.io/meeb/tubesync:latest

@spiralham
Copy link
Author

Ah, this'll be a Django 5-ism after the upgrade. Thanks for the issue. Can you confirm that your TUBESYNC_HOSTS env var is set correctly?

I've not set TUBESYNC_HOSTS since the default * was okay for me. When I do set it however, TubeSync fails to start and throws Invalid HTTP_HOST header: '127.0.0.1:8080'. You may need to add '127.0.0.1' to ALLOWED_HOSTS. several times in the log. Based on the rest of this thread it looks like work is already underway to fix this so I'll just wait for that. Let me know if I can provide any more info though.

@tcely tcely moved this from Todo to In Progress in Status Feb 27, 2025
@meeb meeb closed this as completed in #786 Feb 27, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in Status Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants