Compare commits

...

7 Commits

Author SHA1 Message Date
CanbiZ
0916af7b45 remove space 2025-11-18 11:06:40 +01:00
CanbiZ
274d7a75c4 remove empty line 2025-11-18 11:06:13 +01:00
CanbiZ
80cd78d947 Refactor LibreNMS credentials output format
Updated the script to change how LibreNMS credentials are written to the creds file, adding a header for clarity.
2025-11-18 11:05:50 +01:00
Michel Roegl-Brunner
2a5f431272 Update credentials and add generation 2025-11-18 09:09:02 +01:00
Michel Roegl-Brunner
495e341143 Update credentials and add generation 2025-11-18 08:36:53 +01:00
Michel Roegl-Brunner
3057502c61 librenms.json aktualisieren 2025-11-17 19:49:16 +01:00
Michel Roegl-Brunner
b5155906a8 librenms-install.sh aktualisieren 2025-11-17 19:48:21 +01:00
2 changed files with 17 additions and 4 deletions

View File

@@ -28,8 +28,13 @@
}
],
"default_credentials": {
"username": "admin",
"password": "admin"
"username": null,
"password": null
},
"notes": []
"notes": [
{
"text": "After installation, the admin user credentials are saved in the file ~/librenms.creds inside the container.",
"type": "info"
}
]
}

View File

@@ -113,11 +113,19 @@ mkdir -p /etc/bash_completion.d/
cp /opt/librenms/misc/lnms-completion.bash /etc/bash_completion.d/
cp /opt/librenms/snmpd.conf.example /etc/snmp/snmpd.conf
APP_PASSWORD=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
APP_USER="admin"
{
echo "LibreNMS Credentials"
echo "Username: ${APP_USER}"
echo "Password: ${APP_PASSWORD}"
} >>~/librenms.creds
$STD su - librenms -s /bin/bash -c "cd /opt/librenms && COMPOSER_ALLOW_SUPERUSER=1 composer install --no-dev"
$STD su - librenms -s /bin/bash -c "cd /opt/librenms && php8.4 artisan migrate --force"
$STD su - librenms -s /bin/bash -c "cd /opt/librenms && php8.4 artisan key:generate --force"
$STD su - librenms -s /bin/bash -c "cd /opt/librenms && lnms db:seed --force"
$STD su - librenms -s /bin/bash -c "cd /opt/librenms && lnms user:add -p admin -r admin admin"
$STD su - librenms -s /bin/bash -c "cd /opt/librenms && lnms user:add -p ${APP_PASSWORD} ${APP_USER} --role=admin"
RANDOM_STRING=$(openssl rand -base64 16 | tr -dc 'a-zA-Z0-9')
sed -i "s/RANDOMSTRINGHERE/$RANDOM_STRING/g" /etc/snmp/snmpd.conf