Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
MrColumbo opened this issue Aug 7, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@MrColumbo
Copy link

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 MrColumbo added the bug Something isn't working label Aug 7, 2022
@derneuere
Copy link
Member

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?

@MrColumbo
Copy link
Author

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?

@splattergamesextended
Copy link

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.

@derneuere
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants