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

add an enviroment option to disable user self registration #441

Closed
wants to merge 3 commits into from

Conversation

mz0in
Copy link

@mz0in mz0in commented Mar 13, 2024

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.

This will add a step to disable user sign up , when the env is set to true : DISABLE_SIGNUP=true  , the default is false
@Nainterceptor
Copy link

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 ?

@mz0in
Copy link
Author

mz0in commented Mar 20, 2024

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

@tea-artist
Copy link
Contributor

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 tea-artist closed this Jun 28, 2024
@nicholas-mn
Copy link

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? 🙏

@tea-artist
Copy link
Contributor

tea-artist commented Jun 28, 2024

@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

@nicholas-mn
Copy link

@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. 😊🙏

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

Successfully merging this pull request may close these issues.

None yet

4 participants