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

How to for the Finalization part #635

Closed
simple-it opened this issue Jan 19, 2022 · 4 comments
Closed

How to for the Finalization part #635

simple-it opened this issue Jan 19, 2022 · 4 comments

Comments

@simple-it
Copy link

I don't know how to perform the 2 following steps:

  1. Assign the role ADMIN to this user (directly in the database)
  2. Delete the original Admin (directly in the database)

Can it be explained?

@dtslvr
Copy link
Member

dtslvr commented Jan 19, 2022

Hi @simple-it

  • Connect to your database with a proper tool. I'm using pgAdmin for it.
    Then find the table User and the row you would like to edit. In the column role, change the value from USER to ADMIN (1.)
  • After that you should have two users with the role ADMIN. You can delete the older one (2.)

@simple-it
Copy link
Author

But pAdmin or other client are not allowed to connecting to DB.

I don't have xp in Docker and Postgres but I know for MySQl server before external connection I ve to allow that.

Maybe I ve to configure in the Postgres Docker?

@juic3pow3rs
Copy link

juic3pow3rs commented Jan 20, 2022

You can also use psql to accomplish that.
Assumptions:

  • you used the docker-compose.yml and .env in this repo
  • you only created one user after successful startup of ghostfolio

Enter the psql shell within the postgres container:
docker-compose exec postgres psql -U user

Update the role of the new user to ADMIN:
UPDATE "User" SET "role" = 'ADMIN' WHERE "provider" = 'ANONYMOUS';

Delete the original ADMIN user:
DELETE FROM "User" WHERE "alias" = 'Admin'

Exit the psql shell with:
\q



Note:
The double quotes are necessary because of the mixed case column names.
If you have more than one user you would need to use the id of the user to want to grand ADMIN permissions in the WHERE clause,

@dtslvr
Copy link
Member

dtslvr commented Jan 23, 2022

Thank you very much for these instructions @juic3pow3rs! 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants