wallabag / docker

Official docker-composer for wallabag.
572 stars 150 forks source link

deploy with fly.io get Invalid CSRF token error #397

Closed zouyq closed 4 months ago

zouyq commented 5 months ago

I deploy wallabag into fly.io with dockerfile,sometimes get Invalid CSRF token. when login;

recording

After completing the deployment, sometimes I can log in successfully for the first time. However, after successfully logging in and making some configuration changes, it automatically logs me out. Upon logging out, when I try to log in again by entering the username and password, it redirects back to the login page. Clicking again leads to an error: "Invalid CSRF token." Subsequently, I am unable to log in successfully. It's very strange. this is my fly.io toml file

# fly.toml app configuration file generated for bag on 2024-01-26T08:51:22+08:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = "xxxx"
primary_region = "lax"

[build]

[env]
  SYMFONY__ENV__DOMAIN_NAME = "https://xxxx.fly.dev"

[http_service]
  internal_port = 80

[[vm]]
  cpu_kind = "shared"
  cpus = 1
  memory_mb = 256
Kdecherf commented 4 months ago

Hello @zouyq,

wallabag relies on session data for keeping users logged in and temp data like csrf tokens for forms. For that these data are either stored on the filesystem or in a cache system like redis.

You may need to check that the folder var/sessions is persisted on your Fly Machine to survive redeploy or restart.

zouyq commented 4 months ago

yes,fixed