lenis0012 / LoginSecurity

Lightweight and secure user authentication for Bukkit Minecraft servers
https://www.spigotmc.org/resources/loginsecurity.19362/
Apache License 2.0
100 stars 85 forks source link

How to disable registration? #315

Open RPWouters opened 1 year ago

RPWouters commented 1 year ago

I want to shutdown the registration possibility after my friends registered. Because now unwanted players can join and register.

lenis0012 commented 1 year ago

@RPWouters I just added this in the latest dev build. Please give it a tryl There should be an option to disable registration in the config.

lenis0012 commented 1 year ago

https://ci.codemc.io/view/Author/job/lenis0012/job/LoginSecurity/133/

mohaidoss commented 1 year ago

It's working great, thanks @lenis0012 ! Only struggle is the key names used in the config, having multiple enabled keys in the yml, makes it hard to edit the config using sed only

RPWouters commented 1 year ago

It's indeed working, thank you!;

lenis0012 commented 1 year ago

It's working great, thanks @lenis0012 ! Only struggle is the key names used in the config, having multiple enabled keys in the yml, makes it hard to edit the config using sed only

what would you suggest instead?

mohaidoss commented 1 year ago

It's working great, thanks @lenis0012 ! Only struggle is the key names used in the config, having multiple enabled keys in the yml, makes it hard to edit the config using sed only

what would you suggest instead?

@lenis0012 Just to keep the same structure, I would suggest prefixing the keys. For example: config.yml before

registration:
  enabled: true

config.yml after

registration:
  registration_enabled: true

This config can easily be edited with bash command sed, cause there is only one exact match


sed -i "s|registration_enabled\:*|registration_enabled:false|" ./config.yml```
lenis0012 commented 1 year ago

It's working great, thanks @lenis0012 ! Only struggle is the key names used in the config, having multiple enabled keys in the yml, makes it hard to edit the config using sed only

what would you suggest instead?

@lenis0012 Just to keep the same structure, I would suggest prefixing the keys. For example: config.yml before

registration:
  enabled: true

config.yml after

registration:
  registration_enabled: true

This config can easily be edited with bash command sed, cause there is only one exact match

sed -i "s|registration_enabled\:*|registration_enabled:false|" ./config.yml```

I see. if that is the issue would something like "accept-new-users" work as well?

lenis0012 commented 1 year ago

Also I just thought of this but why didn't you just enable whitelisting? @RPWouters

mohaidoss commented 1 year ago

It's working great, thanks @lenis0012 ! Only struggle is the key names used in the config, having multiple enabled keys in the yml, makes it hard to edit the config using sed only

what would you suggest instead?

@lenis0012 Just to keep the same structure, I would suggest prefixing the keys. For example: config.yml before

registration:
  enabled: true

config.yml after

registration:
  registration_enabled: true

This config can easily be edited with bash command sed, cause there is only one exact match

sed -i "s|registration_enabled\:*|registration_enabled:false|" ./config.yml```

I see. if that is the issue would something like "accept-new-users" work as well?

Yes, it would. But the other config values may need that as well !