fix: geopulse: add user creation script

This commit is contained in:
CrazyWolf13
2026-03-26 15:43:41 +01:00
parent 5f25ce38b2
commit 2507c012c3
3 changed files with 18 additions and 2 deletions

View File

@@ -68,4 +68,4 @@ echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}${CL}"
echo -e "${INFO}${YW} To create an admin account, run:${CL}"
echo -e "${TAB}${BGN}echo 'GEOPULSE_ADMIN_EMAIL=you@example.com' >> /etc/geopulse/geopulse.env && systemctl restart geopulse-backend${CL}"
echo -e "${TAB}${BGN}/usr/local/bin/create-geopulse-admin${CL}"

View File

@@ -184,6 +184,22 @@ systemctl enable -q --now nginx
systemctl reload nginx
msg_ok "Configured Nginx"
msg_info "Creating Admin Helper"
cat <<'EOF' >/usr/local/bin/create-geopulse-admin
#!/usr/bin/env bash
read -rp "Enter admin email address: " ADMIN_EMAIL
if [[ -z "$ADMIN_EMAIL" ]]; then
echo "No email provided. Aborting."
exit 1
fi
sed -i '/^GEOPULSE_ADMIN_EMAIL=/d' /etc/geopulse/geopulse.env
echo "GEOPULSE_ADMIN_EMAIL=${ADMIN_EMAIL}" >>/etc/geopulse/geopulse.env
systemctl restart geopulse-backend
echo "Admin email set to '${ADMIN_EMAIL}'. Register with this email in the GeoPulse UI to receive admin privileges."
EOF
chmod +x /usr/local/bin/create-geopulse-admin
msg_ok "Created Admin Helper"
motd_ssh
customize
cleanup_lxc

View File

@@ -33,7 +33,7 @@
},
"notes": [
{
"text": "To create an admin account: `echo 'GEOPULSE_ADMIN_EMAIL=you@example.com' >> /etc/geopulse/geopulse.env && systemctl restart geopulse-backend` — then register with that email in the UI.",
"text": "To create an admin account, run `/usr/local/bin/create-geopulse-admin` inside the container, then register with that email in the GeoPulse UI.",
"type": "info"
}
]