docs: Add 1 and update 4 files
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 38s

This commit is contained in:
Your Name
2025-09-20 10:11:14 +12:00
parent 70585358b8
commit fb02cbd0e8
5 changed files with 66 additions and 9 deletions

33
logserver/scripts/setup-user.sh Executable file
View File

@@ -0,0 +1,33 @@
#!/bin/bash
# Script to create a custom user for Kibana login
# This runs after Elasticsearch is up and creates the user defined in service.env
# Wait for Elasticsearch to be ready
echo "Waiting for Elasticsearch to be ready..."
until curl -s -u elastic:${ELASTIC_PASSWORD} http://localhost:9200/_cluster/health | grep -q '"status":"yellow"\|"status":"green"'; do
sleep 5
done
echo "Creating user '${KIBANA_USERNAME}'..."
# Create the custom user with superuser role
curl -X POST -u elastic:${ELASTIC_PASSWORD} \
-H "Content-Type: application/json" \
http://localhost:9200/_security/user/${KIBANA_USERNAME} \
-d '{
"password" : "'${KIBANA_USER_PASSWORD}'",
"roles" : [ "superuser" ],
"full_name" : "Admin User",
"email" : "admin@example.com"
}'
if [ $? -eq 0 ]; then
echo ""
echo "User '${KIBANA_USERNAME}' created successfully!"
echo "You can now log in to Kibana with:"
echo " Username: ${KIBANA_USERNAME}"
echo " Password: ${KIBANA_USER_PASSWORD}"
else
echo "Note: User might already exist or there was an error"
fi