hanko
hanko copied to clipboard
failed to validate config: failed to validate passcode settings: failed to validate email settings: from_address must not be empty
Checklist
- [X] I could not find a solution in the existing issues or docs.
- [X] I agree to follow this project's Code of Conduct.
Describe the bug
https://github.com/teamhanko/hanko/blob/main/backend/README.md I was following this tutorial.
When I try to call the following command docker run --mount type=bind,source=<PATH-TO-CONFIG-FILE>,target=/config/config.yaml -p 8000:8000 -it ghcr.io/teamhanko/hanko:main migrate up
I got this error "failed to validate config: failed to validate passcode settings: failed to validate email settings: from_address must not be empty"
I have changed the PATH-TO-CONFIG-FILE to my actual config.yaml path.
Reproducing the bug
- Install docker
- run docker pull mysql
- Setup the config.yaml
- run docker run --mount type=bind,source=<PATH-TO-CONFIG-FILE>,target=/config/config.yaml -p 8000:8000 -it ghcr.io/teamhanko/hanko:main migrate up
Logs
2023/06/15 11:02:36 Using config file: ./config/config.yaml
2023/06/15 11:02:36 failed to validate config: failed to validate passcode settings: failed to validate email settings: from_address must not be empty
Configuration
No response
Hanko Version
N/A
OS Hanko Backend
macOS
OS Version Hanko Backend
No response
OS
None
OS Version
Ventura 13.2
Browser Version
No response
Environment
Docker
Additional Context
No response
Looks like we always validate the complete config, although we only need to validate the database part of the config for the migrate
command. So we should only validate the parts of the config file that we need for each command.
As a workaround you can add all required fields to the config e.g:
database:
user: hanko
password: hanko
host: localhost
port: 3306
dialect: mysql
database: hanko
passcode:
smtp:
host: example.com
secrets:
keys:
- <CHANGE-ME>
service:
name: Hanko-Test
Also i see, that the readme refers to an outdated docker image, it should be ghcr.io/teamhanko/hanko:latest
instead of main
.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.