Closed Chacsam closed 1 year ago
I have the same issue.
I am on Ubuntu 22.04.1 LTS and using Portainer CE 2.17.0 Docker 23.0.1.
I tried generating the hash using just ihatemoney generate_password_hash
via the Portainer Console within the container, as well as generating it via the console using the same command you did.
Here's my compose file:
version: "3.9"
services:
ihatemoney:
image: ihatemoney/ihatemoney:latest
environment:
- DEBUG=False
- ACTIVATE_ADMIN_DASHBOARD=True
- ACTIVATE_DEMO_PROJECT=False
- ADMIN_PASSWORD=<hash-generated-as-described-above>
- ALLOW_PUBLIC_PROJECT_CREATION=True
- BABEL_DEFAULT_TIMEZONE=Europe/Vienna
- GREENLET_TEST_CPP=no
- MAIL_DEFAULT_SENDER=Budget Manager <admin@example.com>
- MAIL_PASSWORD=
- MAIL_PORT=25
- MAIL_SERVER=localhost
- MAIL_USE_SSL=False
- MAIL_USE_TLS=False
- MAIL_USERNAME=
- SECRET_KEY=<is-a-secret>
- SESSION_COOKIE_SECURE=False
- SHOW_ADMIN_EMAIL=True
- SQLALCHEMY_DATABASE_URI=sqlite:////database/ihatemoney.db
- SQLALCHEMY_TRACK_MODIFICATIONS=False
- ENABLE_CAPTCHA=True
- LEGAL_LINK=
- PORT=8000
- PUID=0
- PGID=0
ports:
- 32660:8000
I too tried installing this recently and also can't access.. even though I got the proper hash or atleast the one generated by the command.
I tried multiple times, but no change. FWIW here's my Settings and the error I'm getting.
version: "3.9"
services:
ihatemoney:
image: ihatemoney/ihatemoney:latest
container_name: ihatemoney
environment:
- DEBUG=False
- ACTIVATE_ADMIN_DASHBOARD=True
- ACTIVATE_DEMO_PROJECT=False
- ADMIN_PASSWORD=pbkdf2:sha256:260000$jk0qpL7E8i35MrNM$f2ac9f48fa356c44fef95639c3cac588df0eaf455d29753a827f8df74814a709
- ALLOW_PUBLIC_PROJECT_CREATION=False
- BABEL_DEFAULT_TIMEZONE=america/new_york
- GREENLET_TEST_CPP=no
- MAIL_DEFAULT_SENDER=
- MAIL_PASSWORD=
- MAIL_PORT=
- MAIL_SERVER=
- MAIL_USE_SSL=True
- MAIL_USE_TLS=False
- MAIL_USERNAME=
- SECRET_KEY=pingadulce
- SESSION_COOKIE_SECURE=True
- SHOW_ADMIN_EMAIL=True
- SQLALCHEMY_DATABASE_URI=sqlite:////database/ihatemoney.db
- SQLALCHEMY_TRACK_MODIFICATIONS=False
- ENABLE_CAPTCHA=False
- LEGAL_LINK=
- PORT=8000
- PUID=0
- PGID=0
networks:
- nginx_default
ports:
- "8003:8000"
networks:
nginx_default:
external: true
and getting this:
WARN[0000] The "jk0qpL7E8i35MrNM" variable is not set. Defaulting to a blank string.
WARN[0000] The "f2ac9f48fa356c44fef95639c3cac588df0eaf455d29753a827f8df74814a709" variable is not set. Defaulting to a blank string.
Which makes it seem like it's just ignoring everything after "$"
If any of this helps :D
https://github.com/spiral-project/ihatemoney/issues/334#issuecomment-478635244
This fixed it... Might be worth adding this in documentation.. but sharing here for @AkshayRao27 @Chacsam
Made a separate post so if someone runs into my previous example. But I am now operational! Thanks!
I tried the fixes listed in #334
It still doesn't work for me. What might I be doing wrong?
The trick is to put the hash in '':
- ADMIN_PASSWORD='pbkdf2:sha256:260000$randomhash'
When putting the hash in '', the application crashes:
File "/etc/ihatemoney/ihatemoney.cfg", line 4
ADMIN_PASSWORD = ''pbkdf2:sha256:260000$aK5qSyAdIa762UNO$xxxx''
SyntaxError: invalid decimal literal
[2023-07-10 14:35:54 +0000] [8] [INFO] Worker exiting (pid: 8)
[2023-07-10 14:35:54 +0000] [1] [INFO] Shutting down: Master
[2023-07-10 14:35:54 +0000] [1] [INFO] Reason: Worker failed to boot.```
When putting the hash in '', the application crashes:
File "/etc/ihatemoney/ihatemoney.cfg", line 4 ADMIN_PASSWORD = ''pbkdf2:sha256:260000$aK5qSyAdIa762UNO$xxxx'' SyntaxError: invalid decimal literal [2023-07-10 14:35:54 +0000] [8] [INFO] Worker exiting (pid: 8) [2023-07-10 14:35:54 +0000] [1] [INFO] Shutting down: Master [2023-07-10 14:35:54 +0000] [1] [INFO] Reason: Worker failed to boot.```
Single ' not double
So, quoting doesn't work, because it gets quoted again in Python.
But double dollars work fine, I have added some "documentation" about it here: #1183
Hello,
I am trying to install ihatemoney through a Portainer Stack (docker-compose file), but I cannot get the Admin password to work.. Using a https reverse proxy I avoid the invalid CRSF with secure cookies, but I always get "Admin password: This admin password is not the right one. Only x attempts left." on the admin page.
My code to generate the hash:
docker run -it --rm --entrypoint ihatemoney ihatemoney/ihatemoney generate_password_hash
My Docker-compose
Docker 24.0 on a Ubuntu 22.04 container in Proxmox.
Am I doing something wrong?