librephotos icon indicating copy to clipboard operation
librephotos copied to clipboard

admin passwords magically changes and I need to use the python script to reset it

Open MrColumbo opened this issue 2 years ago • 3 comments

What architecture is LibrePhotos running on:

x64 or ARM

x64

How is LibrePhotos installed:

Docker, Kubernetes, or .deb

docker

If running via Docker or Kubernetes please list version including docker-compose:

DO NOT EDIT

The .env file has everything you need to edit.

Run options:

1. Use prebuilt images (preferred method):

run cmd: docker-compose up -d

2. Build images on your own machine:

build cmd: COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker-compose build

run cmd: docker-compose up -d

version: "3.3" services: proxy: image: reallibrephotos/librephotos-proxy:${tag} restart: always volumes: - ${myPhotos}:/data - ${proMedia}:/protected_media ports: - ${httpPort}:80 depends_on: - backend - frontend

db: image: postgres:13 restart: always environment: - POSTGRES_USER=${dbUser} - POSTGRES_PASSWORD=${dbPass} - POSTGRES_DB=${dbName} volumes: - ${dbLocation}:/var/lib/postgresql/data command: postgres -c fsync=off -c synchronous_commit=off -c full_page_writes=off -c random_page_cost=1.0

frontend: image: reallibrephotos/librephotos-frontend:${tag} restart: always depends_on: - backend

backend: image: reallibrephotos/librephotos:${tag} restart: always volumes: - ${myPhotos}:/data - ${proMedia}:/protected_media - ${logLocation}:/logs - ${cachedir}:/root/.cache

environment:
  - SECRET_KEY=${shhhhKey}
  - BACKEND_HOST=backend
  - ADMIN_EMAIL=${adminEmail}
  - ADMIN_USERNAME=${userName}
  - ADMIN_PASSWORD=${userPass}
  - DB_BACKEND=postgresql
  - DB_NAME=${dbName}
  - DB_USER=${dbUser}
  - DB_PASS=${dbPass}
  - DB_HOST=${dbHost}
  - DB_PORT=5432
  - REDIS_HOST=redis
  - REDIS_PORT=6379
  - MAPBOX_API_KEY=${mapApiKey}
  - WEB_CONCURRENCY=${gunniWorkers}
  - SKIP_PATTERNS=${skipPatterns}
  - DEBUG=0
  - HEAVYWEIGHT_PROCESS=${HEAVYWEIGHT_PROCESS}

# Wait for Postgres
depends_on:
  - db

redis: image: redis:6 restart: always

Are you running LibrePhotos on a virtual machine if so please list:

LXC debian container in proxmox

How is you picture library mounted on the host (or in the virtual machine):

Local file system (Type), NFS, or SMB lxc proxmox mount (no network share ike nfs or smb)

Description of issue:

After a little while (not sure if is days or weeks) the admin password does not work anymore. I use the manage.py to reset it but I like to not need to do that all the time. I have setup an admin pw in the env file but when it happens it is neither the default one (admin if I am not mistaken) or the one from the enf file and not the one I set via manage.py (which is the same as in the env file anyway)

How can we reproduce it:

Additional Information:

  • Include a ZIP file containing your log files.
  • Provide pictures or links to videos that clearly demonstrate the issue. logs.zip

MrColumbo avatar Aug 07 '22 11:08 MrColumbo

My guess would be that the secret key changed and your system rebooted. If you do not set a secret key, then it will generate one and will put it into the log folder as secret.key. Do you clean your logs in regular intervals and could that be the reason?

derneuere avatar Aug 07 '22 22:08 derneuere

thanks for the quick feedback. May I ask how do I set the secret key? I found some conversations about it in other issues but I am missing the big picture. I noticed that in the docker compose it uses the data from the environment variable shhhhKey .....should I somehow set that to a fixed value?

MrColumbo avatar Aug 27 '22 17:08 MrColumbo

thanks for the quick feedback. May I ask how do I set the secret key? I found some conversations about it in other issues but I am missing the big picture. I noticed that in the docker compose it uses the data from the environment variable shhhhKey .....should I somehow set that to a fixed value?

yes, there is a file that is being generated on first boot called "secret.key" (should appear under /"your docker folder"/data/logs/ - set the path to that file instead of the shhhkey variable in the compose file and it should work again.

splattergamesextended avatar Sep 04 '22 16:09 splattergamesextended

Sounds to me like an issue where users deleted the secret key / log folder. Added a follow up ticket to better document it: #818

derneuere avatar Apr 13 '23 08:04 derneuere