AFFiNE icon indicating copy to clipboard operation
AFFiNE copied to clipboard

Self-hosted: add config for turn off signup feature

Open chief-nerd opened this issue 11 months ago • 2 comments

What happened?

Wanted to host a test version and close down the signup so users are not accidently signing up to my "private" test system.

Installed Docker Image with supplied docker-compose. Setup all great and easy. Now I tried to deactivate Signups.

1st bug: Found an existing ENV and set OAUTH_GOOGLE_ENABLED=false --> but that is not working. Button is still displayed.

2nd bug: Email signup. No direct ENV. After digging I found in dist/fundamentals/config/default.js -> defaultConfig a flag in auth.enableSignup --> BINGO!


Now I wanted to set it: 1st try: in my mapped config folder (corresponds to /root/.affine/config) in affine.js I added:

AFFiNE.auth.enableSignup = false;
AFFiNE.auth.enableOauth = false;

without effect. :(


Then I tried another "hacky" way I edited affine.env.js and added based on the logic of the Google / Github variables there:

SIGNUP_ENABLED: ['auth.enableSignup', 'boolean'],`

and in my otherwise working .env file:

OAUTH_GOOGLE_ENABLED=false
SIGNUP_ENABLED=false

... also not working :(


So I report this as a "bug" since the functionality seems to be there, but is NOT working.

Distribution version

Web (app.affine.pro)

What browsers are you seeing the problem on if you're using web version?

Chrome

Are you self-hosting?

  • [X] Yes

Relevant log output

No response

Anything else?

No response

chief-nerd avatar Mar 15 '24 08:03 chief-nerd

Issue Status: 🔍 Under Investigation

🔍 Under Investigation

We’ve triaged the issue, but now we need to investigate it more thoroughly. This may require processing additional information like logs or dumps.

This is an automatic reply by the bot.

affine-issue-bot[bot] avatar Mar 15 '24 08:03 affine-issue-bot[bot]

we have refactoring related components in the last two major versions, and the corresponding env var are outdated.

please go to our docs to view the latest available env vars: https://docs.affine.pro/docs/self-host-affine/run-affine-with-custom-options

specifically, in the latest version, as long as the OAUTH_* env are not defined, the oauth feature will be turned off, but there is currently no config item that can turn off the registration feature.

i have recorded the config item of turn off the registration feature in the development schedule, once there are relevant updates, i will associate it with this issue.

darkskygit avatar Mar 15 '24 15:03 darkskygit

Why the close? I thought this was planned?

chief-nerd avatar Jun 16 '24 05:06 chief-nerd

done already actually. wait for the release of 0.15

forehalo avatar Jun 21 '24 08:06 forehalo

Hello, do we already have this feature? I am trying to disable user sign up, and just allow admin to send email. Can we make this reachable?

alissa-tung avatar Jun 30 '24 04:06 alissa-tung

I've just pulled 0.15.7 and it seems this issue still exists?

samwh1te avatar Aug 04 '24 06:08 samwh1te

I'm on 0.16, did you add the possibility of closed signup or invite-only signup? I can't find anything about this in the custom options.

Braintelligence avatar Sep 05 '24 08:09 Braintelligence

I'm on 0.16, did you add the possibility of closed signup or invite-only signup? I can't find anything about this in the custom options.

goto /admin/settings and turn of "Whether allow new registrations"

darkskygit avatar Sep 05 '24 09:09 darkskygit

I'm on 0.16, did you add the possibility of closed signup or invite-only signup? I can't find anything about this in the custom options.

goto /admin/settings and turn of "Whether allow new registrations"

I've been seeing comments across issues and the forums mention this admin panel but had no idea how to get to it, THANK YOU!

Bottleface avatar Sep 10 '24 18:09 Bottleface