docker icon indicating copy to clipboard operation
docker copied to clipboard

Invalid CSRF token with Docker Compose setup

Open cb3inco opened this issue 1 year ago • 1 comments

I'm having a slightly similar problem to this issue: https://github.com/wallabag/docker/issues/397

I just setup Wallabag with docker compose as follows:

services:
  wallabag:
    image: wallabag/wallabag
    container_name: wallabag-server
    env_file: ./wallabag.env
    volumes:
      - ./data/app/images:/var/www/wallabag/web/assets/images
    networks:
      - traefik
      - wallabag
    restart: unless-stopped
    labels:
      - "diun.enable=true"

      - "traefik.enable=true"
      - "traefik.docker.network=traefik"
      - "traefik.http.routers.wallabag.rule=Host(`wallabag.example.com`)"
      - "traefik.http.routers.wallabag.entrypoints=https"
      - "traefik.http.routers.wallabag.tls.certResolver=letls"
    healthcheck:
      test: ["CMD", "wget" ,"--no-verbose", "--tries=1", "--spider", "http://localhost/api/info"]
      interval: 1m
      timeout: 3s
    depends_on:
      - db
      - redis
  db:
    image: mariadb
    container_name: wallabag-db
    restart: unless-stopped
    env_file: ./wallabag.env
    volumes:
      - ./data/db:/var/lib/mysql
    healthcheck:
      test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
      interval: 20s
      timeout: 3s
    networks:
      - wallabag
    labels:
      - "diun.enable=true"
  redis:
    image: redis:alpine
    container_name: wallabag-redis
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 20s
      timeout: 3s
    networks:
      - wallabag
    labels:
      - "diun.enable=true"
networks:
  traefik:
    external: true
    name: traefik
  wallabag:
    external: true
    name: wallabag

I can log in with the default wallabag username and password (with no Invalid CSRF Token), I created another account, signed out and attempted to sign in, but get: Invalid CSRF Token. It goes back to the log in page. However, if a go to https://wallabag.example.com/quickstart - my new user is signed in.

My setup is behind Cloudflare.

cb3inco avatar Nov 01 '24 18:11 cb3inco

could you share more about how you deploy the wallabag behind cloudflare? I'm using worker as reverse proxy, now hitting the same issue. Thanks!

honglonglong avatar Mar 26 '25 12:03 honglonglong