mirror of
https://github.com/plankanban/planka.git
synced 2026-02-25 03:14:50 +03:00
Deleting Demo User Post Installation #570
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Armageddon0x00 on GitHub (Sep 11, 2024).
Is this a feature for the backend or frontend?
Backend
What would you like?
I would like to be able to delete the default demo user created (the variables configured inside docker env.) inside container with ease.
Since it is explicitly mentioned that Demo user can not be deleted if configured (assuming this deletion is not possible on frontend for some reason), I want a utility like script that will come shipped with
ghcr.io/plankanban/plankathat can be executed inside container for clean up.The script / tool (which we are going to call inside the docker container as delete_default_acc) will do:
Why is this needed?
Due to some bugs (specially defined for first login process by other users too) demo accounts sometimes not disabled on some cases. I do not want to reconfigure everything or risk first login issues again.
I want to be able to delete the default demo user for mainly security purposes since most people that encountered this bug will not recreate/reconfigure (delete volumes, configure env. variables again etc.) their compose.
Other information
There are probably ways doing these (directly connecting to DB and cascade deleting user etc.). I am not doing by hand mostly because I am not sure about the impacts of manually deleting users (specially the default one that is created in first init) after creating a new admin account.
I am willing to help on this issue (if it is okay with the roadmap of the project) and create the script that does work defined in this issue under guidance.
Yes, I am aware this is probably a dirty workaround but with proper documentation and new tool most of the issues mentioned can be resolved.
@daniel-hiller commented on GitHub (Sep 12, 2024):
Why do you not simply remove the variables and restart the container?
After that you are able to delete/change the user
@Armageddon0x00 commented on GitHub (Sep 14, 2024):
Hi @daniel-hiller,
TL;DR
The main reason for this is to use it as a workaround in new user - fresh install user management problems. I do not want to do fresh installs (and risk non-working service again) if I mess up the env. variables.
Example Issues
Take this issues for example (there are more but just as a PoC of my current problem)
issue1
issue2
issue3
issue4 which is unresolved / abondoned
All these issues could be easily solved with the official utility scripts created for user management (talking about specifically docker here.)
My Reasoning
As for my own reason, I created planka using docker compose with everything latest and according to documentation. Set my environment variables (default admin things) and tried to login using those credentials for a solid 6 hours. I debugged everything involved in the process (checked each docker container logs, checked service logs inside each container, checked reverse proxy logs etc. etc.). Spent hours on troubleshooting. Then i restarted the same compose file without changing anything (clearing volumes and networks first as I always did before) and this time it worked.
Now I have my planka service running smooth as butter but I have the demo user enabled with default demo credentials which I have no easy way of removing (also a security issue obviously). And I am not risking 5 more hours to see if I can just create the service without this user.
A Root Cause to be Determined.
To my suprise, when i came to create an bug issue on the subject I saw this has always been a common and unpinned issue in every version. User creation and login problem on fresh installs. A utility script would save this project time, save users from debugging numerous hours etc.
I just feel like a simple addition/workaround like this could provide to be useful and a time saver.
Thanks.
@meltyshev commented on GitHub (Sep 16, 2024):
Hi! It sounds like it might be better to create a script that generates user accounts, so you wouldn't need to set these
DEFAULT_ADMIN_*variables at all 🤔@Armageddon0x00 commented on GitHub (Sep 24, 2024):
Yeah, thats a good idea to but most of the users will not want to bash into the container to run that script.
It might be better to create a startup script that will create a temporary admin user (that is able to create more users and deletable). Then prints the startup user information to container logs (which is a practice most container based applications use already.)
Logic:
Notes:
DEFAULT_ADMIN_*variable set.I will be experimenting on this. If my weak coding skills and project map alligns I will send a PR in the future.
Thanks.
@meltyshev commented on GitHub (Sep 26, 2024):
Sounds like a good option! For compatibility with the
DEFAULT_ADMIN_*environment variables, I suggest creating a user only ifDEFAULT_ADMIN_EMAILis not set. Your PR would be greatly appreciated :)@meltyshev commented on GitHub (May 15, 2025):
Has been resolved in v2 with the new
db:create-admin-usernpm script: https://docs.planka.cloud/docs/configuration/admin-user#by-running-the-script.