apitable icon indicating copy to clipboard operation
apitable copied to clipboard

question: How to change the admin user password?

Open vinyll opened this issue 2 years ago • 12 comments

By default the admin account is [email protected] and Apitable2022. If publishing the app we need to customize the password for obvious reasons.

Where to do that?

vinyll avatar Jan 15 '23 19:01 vinyll

By default the admin account is [email protected] and Apitable2022. If publishing the app we need to customize the password for obvious reasons.

Where to do that?

Hi, @vinyll In user profile setting page, there's "Change Password" setting.

mr-kelly avatar Jan 16 '23 01:01 mr-kelly

Thanks for your reply. My first shot was to get there, so it would make total sense to me too. However I see this page with no password editing. Am I missing something obvious here? 🧐

Screenshot 2023-01-16 at 10 59 33

vinyll avatar Jan 16 '23 10:01 vinyll

Same for the space admin members, not there neither. 🤷‍♂️ Screenshot 2023-01-16 at 11 40 37

vinyll avatar Jan 16 '23 10:01 vinyll

@vinyll I know that's not the best way, but I did manage to do a workaround.

  1. Got inside mysql container and login;
  2. Looked into mysql apitable database and table apitable_user;
  3. Figured out that password hash is bcrypt, so generated from a self created password a new hash;
  4. Updated using INSERT;
  5. It worked fine.

I would recommend APITable team to make username and password an external configuration from .env file.

Another option would be generating it when you startup and show it from logs like backend service.

fabioqcorreia avatar Jan 17 '23 22:01 fabioqcorreia

And this issue seems to be more an UI bug than lack of documentation IMO.

fabioqcorreia avatar Jan 17 '23 22:01 fabioqcorreia

Note that cloning the repo and running the latest develop branch locally has the same issue.

Screenshot 2023-01-18 at 06 27 12

vinyll avatar Jan 18 '23 05:01 vinyll

Indeed it's not just a documentation issue but a bug: a ACCOUNT_RESET_PASSWORD_VISIBLE flag is set to false by default, meaning we cannot update a password.

However switching to true does not solve and shows the following blank screen:

Screenshot 2023-01-18 at 10 58 51

Furthermore the default behavior requires a SMS code that is not provided in developer mode.

@mr-kelly what workaround can we put in place to easily offer a user to change his password?

vinyll avatar Jan 24 '23 10:01 vinyll

Furthermore the default behavior requires a SMS code that is not provided in developer mode.

Yes. Due to security and SMS fee problems, we do not provide SMS authentication in the community version. That's why we provide a default username and password. We will fix this change password issue in next sprints ASAP.

mr-kelly avatar Jan 26 '23 08:01 mr-kelly

I leave a password change guide in case someone comes here.

  1. Go to https://bcrypt.online/, convert the desired password to a bcrypt hash string, and copy it.
  2. In the Docker Desktop, find "apitable-mysql-*" and click "Open in terminal" w1
  3. In your terminal, type the following commands one by one, you can remove the $ in front of them.
$ mysql -u root -p
$ apitable@com
$ USE apitable;
$ SELECT * FROM apitable_user;
$ UPDATE apitable_user SET password='YOUR_NEW_BCRYPT_HASH' WHERE email='[email protected]';

hmmhmmhm avatar Feb 19 '23 19:02 hmmhmmhm

Not having SMS for community edition sounds very fair. However it is still required for editing the password for community, which therefore makes no sense.

Thanks @hmmhmmhm for the workaround, I had the same idea in mind but didn't move forward to make it happen. You saved me an hour! 💯

BTW ApiTable looks very promissing, it went crazily fast to 7k⭐️ while we were just a very few a couple of weeks ago. You guys are doing an amazing job!

vinyll avatar Feb 19 '23 21:02 vinyll

And just to clarify, here's how to add a Space Member account: After connecting to the terminal as shown above, log in to mysql and enter the SQL command below.

INSERT INTO apitable_user (uuid, nick_name, code, mobile_phone, email, password, created_at, updated_at)
VALUES (
    UUID(),
    'YOU_WANT_NICKNAME',
    NULL,
    NULL,
    'YOU_WANT_EMAIL',
    'YOU_WANT_PASSWORD_BCRYPT',
    NOW(),
    NOW()
);

Even though you've entered the above command, it's not fully added yet, you'll need to do the following additional tasks as an administrator.

Settings -> Organization -> Members & Team -> Click Invite Button -> Invite via email -> (Enter the email address you just added)

114 If you've completed the above, users from that account will now be able to access the invited space.

hmmhmmhm avatar Feb 19 '23 21:02 hmmhmmhm

Thanks for your patience... We are working on this fix soon.

mr-kelly avatar Feb 20 '23 03:02 mr-kelly

Based on version v0.18.0-rc.1, the features of registering, inviting users, and changing passwords are ready.

Liamzai avatar Mar 08 '23 01:03 Liamzai