ragflow icon indicating copy to clipboard operation
ragflow copied to clipboard

Feat: login page supports to hide the registration button through environment variables.

Open hitechbeijing opened this issue 10 months ago • 11 comments

What problem does this PR solve?

注册功能无法关闭可能导致安全风险,通过环境变量控制注册功能的开启与关闭一定程度上可解决此问题

hitechbeijing avatar Mar 07 '25 06:03 hitechbeijing

Appreciations!

KevinHuSh avatar Mar 07 '25 07:03 KevinHuSh

ok changed

hitechbeijing avatar Mar 11 '25 10:03 hitechbeijing

HIDE_SIGNUP=0

hitechbeijing avatar Mar 11 '25 10:03 hitechbeijing

The login page cannot get the value of the environment variable defined in docker/.env through process.env.

cike8899 avatar Mar 12 '25 03:03 cike8899

Why can't we get the process.env.HIDE_SIGNUP value during testing? How to accomplish that?

KevinHuSh avatar Mar 13 '25 02:03 KevinHuSh

I have tested the code below and it works well with Docker:

const hide_signup = process.env.HIDE_SIGNUP === '1';

At 2025-03-13 10:53:03, "Kevin Hu" @.***> wrote:

Why can't we get the process.env.HIDE_SIGNUP value during testing? How to accomplish that?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you modified the open/close state.Message ID: @.***>

KevinHuSh left a comment (infiniflow/ragflow#5757)

Why can't we get the process.env.HIDE_SIGNUP value during testing? How to accomplish that?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you modified the open/close state.Message ID: @.***>

hitechbeijing avatar Mar 13 '25 03:03 hitechbeijing

Although I am not a participant, I have a suggestion to be able to debug from src we can add HIDE_SIGNUP =1 here: https://github.com/infiniflow/ragflow/blob/main/web/.env

isthaison avatar Mar 13 '25 04:03 isthaison

The environment variables are from the /ragflow/docker/.env file, and docker-compose.yml references this .env file, so it will not work without Docker. How to achieve this is not important. Adding HIDE_SIGNUP=1 in web/.env is a good idea without using Docker.

At 2025-03-13 12:24:35, "so95" @.***> wrote:

Although I am not a participant, I have a suggestion to be able to debug from src we can add HIDE_SIGNUP =1 here: https://github.com/infiniflow/ragflow/blob/main/web/.env

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you modified the open/close state.Message ID: @.***>

isthaison left a comment (infiniflow/ragflow#5757)

Although I am not a participant, I have a suggestion to be able to debug from src we can add HIDE_SIGNUP =1 here: https://github.com/infiniflow/ragflow/blob/main/web/.env

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you modified the open/close state.Message ID: @.***>

hitechbeijing avatar Mar 13 '25 04:03 hitechbeijing

image

isthaison avatar Mar 13 '25 05:03 isthaison

At 2025-03-13 13:03:11, "so95" @.***> wrote:

image.png (view on web)

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you modified the open/close state.Message ID: @.***>

isthaison left a comment (infiniflow/ragflow#5757)

image.png (view on web)

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you modified the open/close state.Message ID: @.***>

hitechbeijing avatar Mar 13 '25 05:03 hitechbeijing

So, it's not feasible to disable signing-up only via envirement variable in the container, isn't it? And there's no place to know for others how to disable it via adding variable in [/ragflow/blob/main/web/.env](https://github.com/infiniflow/ragflow/blob/main/web/.env). This PR is gona close. Thanks anyway.

KevinHuSh avatar Mar 14 '25 01:03 KevinHuSh

I can use the .env to do it in the container Hope you find other way to hide the regisitation button.

At 2025-03-14 09:54:21, "Kevin Hu" @.***> wrote:

So, it's not feasible to disable signing-up only via envirement variable in the container, isn't it? And there's no place to know for others how to disable it via adding variable in /ragflow/blob/main/web/.env. This PR is gona close. Thanks anyway.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you modified the open/close state.Message ID: @.***>

KevinHuSh left a comment (infiniflow/ragflow#5757)

So, it's not feasible to disable signing-up only via envirement variable in the container, isn't it? And there's no place to know for others how to disable it via adding variable in /ragflow/blob/main/web/.env. This PR is gona close. Thanks anyway.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you modified the open/close state.Message ID: @.***>

hitechbeijing avatar Mar 14 '25 02:03 hitechbeijing

https://github.com/hitechbeijing/ragflow/pull/1 I have changes a litle modified working on dev

isthaison avatar Mar 14 '25 03:03 isthaison