janeczku / calibre-web

:books: Web app for browsing, reading and downloading eBooks stored in a Calibre database
GNU General Public License v3.0
12.69k stars 1.33k forks source link

Issue setting up gmail in Docker #3032

Closed jasehigh closed 3 months ago

jasehigh commented 5 months ago

I'm experiencing an issue setting up gmail in calibre-web in Docker.

version: "3.8"
services:
  calibre-web:
    image: lscr.io/linuxserver/calibre-web:latest
    container_name: calibre-web
    environment:
      - TZ="Europe/London"
      - OAUTHLIB_RELAX_TOKEN_SCOPE=1
    volumes:
      - type: bind
        source: /Volumes/data/docker/appdata/calibre-web/gmail.json
        target: /app/calibre-web/gmail.json
      - /Volumes/data/docker/appdata/calibre-web:/config
      - /Volumes/data/docker/media:/media
    ports:
      - 8083:8083
    restart: unless-stopped

I have followed these instructions (https://github.com/janeczku/calibre-web/wiki/Setup-Mailserver#gmail) and have downloaded my credentials, renamed the file to gmail.json and have dropped this in my /config folder.

From the console of my docker container I perform the following:

ps -C "python3 /app/calibre-web/cps.py" -o pid=

This returns the PID that I then use in this command:

kill <pid> && python3 /app/calibre-web/cps.py

I goto calibre-web, and have to login as the default "admin" user, as my user profile/settings have been removed. I select a the folder that contains my calibre database, and then click on the "Setup gmail account as email server" option.

I copy the URL from the docker console, paste this into my browser, and grant google access. Using the URL this gives me, I paste this into another docker console to my container:

curl "<URL>"

This returns the message "The authentication flow has completed. You may close this window.".

The calibre-web window also shows:

"Success! Gmail Account Verified."
"Email Server Settings updated"

I then stop the container and restart. This allows me to log back in as my user. However, once logged back in, the email option is not set to gmail!

Am I missing a step or is thee a known issue? Any assistance is greatly appreciated.

OzzieIsaacs commented 5 months ago

Somehow this is known, yeah: #2699, #2254

mabequinho commented 4 months ago

Setup as a regular mail.

smtp.gmail.com port 587 encryption TLS username: your@gmail.com password: apppasswd