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

Make it possible to disable account creation #198

Merged
merged 1 commit into from Jun 30, 2022

Conversation

prusnak
Copy link
Contributor

@prusnak prusnak commented Jun 16, 2022

This covers the usecase when LndHub is used to serve closed communities
which do not want to accept new members anymore (friends, families, etc).

The PR introduces a new envconfig option CREATE_ACCOUNTS which is true
by default but can be set to false if needed.

@bumi
Copy link
Contributor

bumi commented Jun 20, 2022

great!
I am wondering if we should define some admin API key for that? Instead of a boolean we could define some kind of "secret / api token" that is required when calling the /create endpoint.

This would allow admins to still create accounts but the endpoint is not publicly available.
This is also helpful when you run lndhub as part of an "micro-service" architecture. (e.g. creating accounts for users from within another application)

@prusnak
Copy link
Contributor Author

prusnak commented Jun 20, 2022

Instead of a boolean we could define some kind of "secret / api token" that is required when calling the /create endpoint.

Thats an interesting idea, but I still would sleep better if there was an option to disable this feature completely. Maybe by setting the secret to some particular value (e.g. "DISABLED")?

@bumi
Copy link
Contributor

bumi commented Jun 20, 2022

OK. I am fine with both. Is that a good pattern?

  • we can also add an admin API token to limit the account creation endpoint in a future PR.

If we keep the boolean: what do you think about naming the env variable ALLOW_ACCOUNT_CREATION?

How would create accounts if it is disabled? The workflow would be to first have it enabled, create certain accounts and then disable it?

@prusnak
Copy link
Contributor Author

prusnak commented Jun 21, 2022

Renamed the variable to ALLOW_ACCOUNT_CREATION

I agree that the secret API token can be added in the later PR.

This covers the usecase when LndHub is used to serve closed communities
which do not want to accept new members anymore (friends, families, etc).

The PR introduces a new envconfig option CREATE_ACCOUNTS which is true
by default but can be set to false if needed.
@kiwiidb
Copy link
Contributor

kiwiidb commented Jun 30, 2022

Looks good. In an enterprise environment you could also solve this at an ingress level. But this would indeed be useful for personal/family use.

@kiwiidb kiwiidb merged commit 5adf1a8 into getAlby:main Jun 30, 2022
@prusnak prusnak deleted the create-accounts-option branch July 9, 2022 17:00
@prusnak prusnak restored the create-accounts-option branch July 9, 2022 17:00
@prusnak prusnak deleted the create-accounts-option branch July 9, 2022 17:00
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

3 participants