mirror of
https://github.com/getnamingo/registry.git
synced 2025-07-03 09:33:25 +02:00
Fixed #223
This commit is contained in:
parent
887c85c51e
commit
0bf30ff362
4 changed files with 22 additions and 1 deletions
|
@ -884,6 +884,15 @@ function checkPasswordComplexity($password) {
|
|||
}
|
||||
|
||||
function checkPasswordRenewal($lastPasswordUpdateTimestamp) {
|
||||
// Check if expiration should be skipped for this user
|
||||
$skipList = envi('PASSWORD_EXPIRATION_SKIP_USERS');
|
||||
if ($skipList) {
|
||||
$skipUsers = array_map('trim', explode(',', $skipList));
|
||||
if (in_array($_SESSION['auth_username'], $skipUsers, true)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Use configured or default password expiration days
|
||||
$passwordExpiryDays = envi('PASSWORD_EXPIRATION_DAYS') ?: 90; // Default to 90 days
|
||||
|
||||
|
|
|
@ -48,3 +48,5 @@ SUMSUB_TOKEN=
|
|||
SUMSUB_KEY=
|
||||
|
||||
TEST_TLDS=.test,.com.test
|
||||
|
||||
PASSWORD_EXPIRATION_SKIP_USERS=admin,superadmin
|
|
@ -104,6 +104,14 @@ PASSWORD_EXPIRATION_DAYS=180
|
|||
|
||||
This will extend the password expiration to **180** days.
|
||||
|
||||
If you wish to **exclude specific accounts from password expiration**, open `/var/www/cp/.env` and **edit the existing** `PASSWORD_EXPIRATION_SKIP_USERS` line (or add it if missing):
|
||||
|
||||
```bash
|
||||
PASSWORD_EXPIRATION_SKIP_USERS=admin,superadmin
|
||||
```
|
||||
|
||||
Add usernames separated by commas. These accounts will **not be subject to password expiration**.
|
||||
|
||||
**How to Apply Changes**
|
||||
- Edit the `.env` file located at `/var/www/cp/.env`
|
||||
- Save the file and restart Caddy if necessary.
|
||||
|
|
|
@ -248,6 +248,8 @@ awk '
|
|||
|
||||
echo "Automation config modified successfully."
|
||||
|
||||
sed -i '/^TEST_TLDS/ a\\nPASSWORD_EXPIRATION_SKIP_USERS=admin,superadmin' /var/www/cp/.env
|
||||
|
||||
# Start services
|
||||
echo "Starting services..."
|
||||
systemctl start epp
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue