Implement data directory configuration and ensure its existence in the main application. Update README with comprehensive features, installation instructions, and usage guidelines for the Adastra Storage Appliance.

This commit is contained in:
2025-12-13 17:52:21 +00:00
parent 72b5c18f29
commit 99694bfa63
4 changed files with 413 additions and 20 deletions

47
packaging/DEBIAN/postinst Executable file
View File

@@ -0,0 +1,47 @@
#!/bin/bash
set -e
# Post-installation script for adastra-storage
INSTALL_DIR="/opt/adastra-storage"
SERVICE_USER="adastra"
SERVICE_GROUP="adastra"
echo "Adastra Storage: Post-installation setup..."
# Create service user if it doesn't exist
if ! id "$SERVICE_USER" &>/dev/null; then
echo "Creating service user: $SERVICE_USER"
useradd -r -s /bin/false -d "$INSTALL_DIR" "$SERVICE_USER" || true
fi
# Set ownership
chown -R "$SERVICE_USER:$SERVICE_GROUP" "$INSTALL_DIR" || true
# Create data directory
mkdir -p "$INSTALL_DIR/data"
chown "$SERVICE_USER:$SERVICE_GROUP" "$INSTALL_DIR/data"
# Enable and start systemd service
if systemctl is-enabled adastra-storage.service >/dev/null 2>&1; then
echo "Service already enabled"
else
systemctl daemon-reload
systemctl enable adastra-storage.service
echo "Service enabled. Start with: systemctl start adastra-storage"
fi
# Set permissions for ZFS commands (if needed)
# Note: Service user may need sudo access or be in appropriate groups
usermod -aG disk "$SERVICE_USER" || true
echo "Adastra Storage installation complete!"
echo "Default admin credentials: username=admin, password=admin"
echo "Please change the default password after first login!"
echo ""
echo "Start the service: systemctl start adastra-storage"
echo "Check status: systemctl status adastra-storage"
echo "View logs: journalctl -u adastra-storage -f"
exit 0