mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-11 14:56:57 +08:00
fix(auth): single-user deployment by default, no open registration
Registration logic redesigned: - Empty DB (first-time setup): registration always open, no config needed - After first user exists: registration closed by default - Multi-user opt-in: set REGISTRATION_ENABLED=true + MAX_USERS=N in .env Config defaults changed: - RegistrationEnabled: true → false (closed after first user) - MaxUsers: 10 → 1 (single-user deployment default) This eliminates the confusion of multiple users appearing in a personal deployment where Telegram is bound to a single admin account.
This commit is contained in:
@@ -55,8 +55,8 @@ type Config struct {
|
||||
func Init() {
|
||||
cfg := &Config{
|
||||
APIServerPort: 8080,
|
||||
RegistrationEnabled: true,
|
||||
MaxUsers: 10, // Default: 10 users allowed
|
||||
RegistrationEnabled: false, // Default: closed after first user registers (first-time setup always allowed)
|
||||
MaxUsers: 1, // Default: single-user deployment
|
||||
ExperienceImprovement: true, // Default: enabled to help improve the product
|
||||
// Database defaults
|
||||
DBType: "sqlite",
|
||||
|
||||
Reference in New Issue
Block a user