feat(server): Add config option to disable admin registration#24539
feat(server): Add config option to disable admin registration#24539provokateurin wants to merge 1 commit intoimmich-app:mainfrom
Conversation
|
Ok, I'll have a look! |
|
I added a switch, but while trying to confirm that it works i realized that it is pretty useless. You can only see the settings page if you have already registered an admin user and are logged in as this user. So this config option does not make sense if you don't use the config.json file. Also disabling after already having created an admin user will have no effect. @jrasm91 what do you think? |
3e94bdb to
d318d64
Compare
|
Oh, true. Probably we don't need the switch in the UI, since it's useless in this case. I think we should probably still add it to the dto though, since that is used for validation. I'm actually surprised that the functionality would work without validation. How is it loading the value from the config file if wasn't added to the dto? |
|
Isn't the Dto only used for API stuff? As far as I could tell it's not really used in this case, as the config value is only used on the server. |
d318d64 to
a03fd3f
Compare
a03fd3f to
60edd06
Compare
|
It uses it for validation, even when it is loaded from a file. You should be able to see this easily by using a string instead of a boolean for the new property and it will load the file just fine. After you add the property and https://github.com/immich-app/immich/blob/main/server/src/utils/config.ts#L105 |
|
After some thought, I've realized a few things:
What do you think about leaving all the config as is, and just extending the |
|
OK, apparently there are other use cases for wanting to disable the sign up endpoint, regardless of password or oauth setup. Do you mind putting here instead? firstTimeSetup: {
enabled: boolean;
} |
|
Sorry for all the noise. I decided to implement this as an ENV instead of a config, and went ahead and did it myself in #24628. |
Description
Since it is possible to create Immich admin users via OIDC, registering an admin user first is no longer a strict requirement. Therefore an option (default disabled) is needed to skip this step.
Fixes #18847
How Has This Been Tested?
Checklist:
src/services/uses repositories implementations for database calls, filesystem operations, etc.src/repositories/is pretty basic/simple and does not have any immich specific logic (that belongs insrc/services/)Please describe to which degree, if any, an LLM was used in creating this pull request.
None, all written by hand.