teable icon indicating copy to clipboard operation
teable copied to clipboard

add an enviroment option to disable user self registration

Open mz0in opened this issue 11 months ago • 2 comments

This will add environment option to disable user self registration , this is a simple method that can be triggered after the first run of the application and the owner or admin register him self and then can make sure that only user with valid invitation link is able to sign in , or he can provide another instance that has the user registration allowed.

mz0in avatar Mar 13 '24 17:03 mz0in

Hi, I want this feature too. I think that it's better to pass through config layer (like https://github.com/teableio/teable/blob/develop/apps/nestjs-backend/src/configs/base.config.ts). And .env example file that you're modifying is related to front part of the app. Do you want to make changes or can I submit another PR ?

Nainterceptor avatar Mar 19 '24 22:03 Nainterceptor

Hi, I want this feature too. I think that it's better to pass through config layer (like develop/apps/nestjs-backend/src/configs/base.config.ts). And .env example file that you're modifying is related to front part of the app. Do you want to make changes or can I submit another PR ?

hello , you can add a new PR , since this PR is not approved yet by the teable team , your approach does the same goal so go on , Thanks

mz0in avatar Mar 20 '24 16:03 mz0in

We released the basic functionality of the Admin panel, You can now disable user registration and create new Spaces here. image

Migration tip: you need to find yourself in the database user table and change the is_admin field to true

UPDATE "public"."users" SET "is_admin" = 't' WHERE "email" = '[email protected]';

For the newly deployed instance, the first user will become the administrator

tea-artist avatar Jun 28 '24 09:06 tea-artist

We released the basic functionality of the Admin panel, You can now disable user registration and create new Spaces here. image

Migration tip: you need to find yourself in the database user table and change the is_admin field to true

UPDATE "public"."users" SET "is_admin" = 't' WHERE "email" = '[email protected]';

For the newly deployed instance, the first user will become the administrator

Step-by-step on how to do this for non-advanced users on an already running docker instance? 🙏

nicholas-mn avatar Jun 28 '24 09:06 nicholas-mn

@mini-mini-oss If you're deploying with docker standalone example. You can find the database account information in the .env file.

POSTGRES_DB=_db_name
POSTGRES_USER=_db_user_name_
POSTGRES_PASSWORD=_db_pass_

In the following commands, replace the actual value

Find the database container id

docker ps

Entry container (replace with the container_id of the previous step

docker exec -it _container_id_ bash

Login database (replace with the db_user, db_name, press Enter and you may be asked to enter your password)

psql -U _db_user_ -d _db_name_

Enter SQL to update your administrator account (Be sure to replace email with your registered account)

UPDATE "public"."users" SET "is_admin" = 't' WHERE "email" = '[email protected]';

If successful, it will be displayed

UPDATE 1

tea-artist avatar Jun 28 '24 11:06 tea-artist

@mini-mini-oss If you're deploying with docker standalone example. You can find the database account information in the .env file.

POSTGRES_DB=_db_name
POSTGRES_USER=_db_user_name_
POSTGRES_PASSWORD=_db_pass_

In the following commands, replace the actual value

Find the database container id

docker ps

Entry container (replace with the container_id of the previous step

docker exec -it _container_id_ bash

Login database (replace with the db_user, db_name, press Enter and you may be asked to enter your password)

psql -U _db_user_ -d _db_name_

Enter SQL to update your administrator account (Be sure to replace email with your registered account)

UPDATE "public"."users" SET "is_admin" = 't' WHERE "email" = '[email protected]';

If successful, it will be displayed

UPDATE 1

Great, thank you so much! I will definitely keep an eye on future development - you guys are doing a fantastic job. 😊🙏

nicholas-mn avatar Jun 28 '24 11:06 nicholas-mn