Skip to content

Commit

Permalink
config: add environment variable to limit the number of users
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethTrecy committed May 26, 2024
1 parent 9ec368d commit 1acc329
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .env.lax.example
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ app.indexPage = "/"
# app.forceGlobalSecureRequests = false
# app.CSPEnabled = false

# If `app.user_count_limit` is 0, there is no limit in the number users allowed in the database.
app.userCountLimit = 0

#--------------------------------------------------------------------
# DATABASE
#--------------------------------------------------------------------
Expand Down
12 changes: 12 additions & 0 deletions app/Config/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,16 @@ class App extends BaseConfig
* @see http://www.w3.org/TR/CSP/
*/
public bool $CSPEnabled = false;

/**
* --------------------------------------------------------------------------
* User Count Limit
* --------------------------------------------------------------------------
*
* Limits the number of users the server allows to register. A value of 0 allows an unlimited
* number of users, as long as the database allows.
*
* @see https://github.com/KennethTrecy/peratorakka_server/issues/16
*/
public int $userCountLimit = 0;
}

0 comments on commit 1acc329

Please sign in to comment.