cnoe-io / idpbuilder

Spin up a complete internal developer platform with only Docker required as a dependency.
https://cloud-native.slack.com/archives/C05TN9WFN5S
Apache License 2.0
174 stars 56 forks source link

[Bug]: deleting gitea pod force user to reset password #296

Open csantanapr opened 3 months ago

csantanapr commented 3 months ago

What is your environment, configuration, and command?

idpbuilder v0.5.0

What did you do and What did you see instead?

Delete gitea pod Try to access gitea UI you get prompted to change to a new password, the old password no longer works

Screenshot 2024-06-13 at 6 46 52 PM Screenshot 2024-06-13 at 6 48 14 PM

Additional Information. Logs.

No response

cmoulliard commented 3 months ago

This occurs as the giteaAdmin password is generated when a gitea pod is created

2024/06/12 13:54:31 ...2@v2.27.1/command.go:272:Run() [I] PING DATABASE sqlite3
2024/06/12 13:54:31 cmd/migrate.go:33:runMigrate() [I] AppPath: /usr/local/bin/gitea
2024/06/12 13:54:31 cmd/migrate.go:34:runMigrate() [I] AppWorkPath: /data
2024/06/12 13:54:31 cmd/migrate.go:35:runMigrate() [I] Custom path: /data/gitea
2024/06/12 13:54:31 cmd/migrate.go:36:runMigrate() [I] Log path: /data/log
2024/06/12 13:54:31 cmd/migrate.go:37:runMigrate() [I] Configuration file: /data/gitea/conf/app.ini
No admin user 'giteaAdmin' found. Creating now...
New user 'giteaAdmin' has been successfully created!
...

Ideally the admin password should be created separately using the gitea client (as I don't think that we can do that using curl) and next the kubernetes secret containing it created

gitea admin user create --admin --username gitea_admin --password gitea_admin --email "gitea@local.domain" --must-change-password=false
gitea admin user change-password --username gitea_admin --password gitea_admin