immich-app / immich

High performance self-hosted photo and video management solution.
https://immich.app
GNU Affero General Public License v3.0
42.51k stars 2.08k forks source link

CLI enable-password-login broken #10146

Closed ddecamilla closed 2 months ago

ddecamilla commented 2 months ago

The bug

enable-password-login from the cli doesn't re-enable login with password. This bug should be fixed as a "backdoor" option to OAuth if the OAuth service is down.

The OS that Immich Server is running on

Ubuntu 22.04.4 LTS

Version of Immich Server

v1.106.1

Version of Immich Mobile App

v1.106.0

Platform with the issue

Your docker-compose.yml content

name: immich

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    extends:
      file: hwaccel.transcoding.yml
      service: nvenc
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    ports:
      - 2283:3001
    depends_on:
      - redis
      - database
    restart: always

  immich-machine-learning:
    container_name: immich_machine_learning
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    volumes:
      - model-cache:/cache
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    restart: always

  redis:
    container_name: immich_redis
    image: docker.io/redis:6.2-alpine@sha256:d6c2911ac51b289db208767581a5d154544f2b2fe4914ea5056443f62dc6e900
    healthcheck:
      test: redis-cli ping || exit 1
    restart: always

  database:
    container_name: immich_postgres
    image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      POSTGRES_INITDB_ARGS: '--data-checksums'
    volumes:
      - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
    healthcheck:
      test: pg_isready --dbname='${DB_DATABASE_NAME}' || exit 1; Chksum="$$(psql --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' --tuples-only --no-align --command='SELECT SUM(checksum_failures) FROM pg_stat_database')"; echo "checksum failure count is $$Chksum"; [ "$$Chksum" = '0' ] || exit 1
      interval: 5m
      start_interval: 30s
      start_period: 5m
    command: ["postgres", "-c" ,"shared_preload_libraries=vectors.so", "-c", 'search_path="$$user", public, vectors', "-c", "logging_collector=on", "-c", "max_wal_size=2GB", "-c", "shared_buffers=512MB", "-c", "wal_compression=on"]
    restart: always

  backup:
    container_name: immich_db_dumper
    image: prodrigestivill/postgres-backup-local
    env_file:
      - .env
    environment:
      POSTGRES_HOST: database
      POSTGRES_DB: ${DB_DATABASE_NAME}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      SCHEDULE: "@daily"
      BACKUP_NUM_KEEP: 7
      BACKUP_DIR: /db_dumps
      TZ: America/New_York
    volumes:
      - /mnt/data/photos/db_dumps:/db_dumps
      - /etc/localtime:/etc/localtime:ro
    depends_on:
      - database

volumes:
  model-cache:

Your .env content

###################################################################################
# Immich Version
###################################################################################

IMMICH_VERSION=v1.106.1
UPLOAD_LOCATION=/mnt/data/photos

###################################################################################
# Postgres Database
###################################################################################

# NOTE: The following four database variables support Docker secrets by adding a *_FILE suffix to the variable name
# See the docker-compose documentation on secrets for additional details: https://docs.docker.com/compose/compose-file/compose-file-v3/#secrets
DB_HOSTNAME=immich_postgres
DB_USERNAME=xxxxxxxx
DB_PASSWORD=xxxxxxxx
DB_DATABASE_NAME=immich
DB_DATA_LOCATION=./postgres

###################################################################################
# Redis Cache
###################################################################################

REDIS_HOSTNAME=immich_redis

Reproduction steps

1. Disable password login option from GUI while using OAuth
2. Connect to docker server container with "docker exec -it immich_server bash"
3. Run "immich-admin enable-password-login" in default dir /usr/src/app. See [immich docs](https://immich.app/docs/administration/server-commands)
4. Container gives back success with
"Detected CPU Cores: 16
Password login has been enabled."
5. Open immich url in private browser window and ctrl+shift+r, but password login option does not display.

Relevant log output

No response

Additional information

No response

alextran1502 commented 2 months ago

@jrasm91 Confirmed that this is a bug. Do you have any thoughts on this?

alextran1502 commented 2 months ago

I saw this in development, but I am not sure if it is the cause image

alextran1502 commented 2 months ago

I think the issue is where we cache this.config for this call.

image