Update electron builds, fix backend issues

This commit is contained in:
LukeGus
2025-09-28 16:45:24 -05:00
parent cfa7c26c49
commit d1b4345206
16 changed files with 410 additions and 1811 deletions

View File

@@ -32,11 +32,9 @@ if [ "$ENABLE_SSL" = "true" ]; then
DOMAIN=${SSL_DOMAIN:-localhost}
# Check if certificates already exist and are valid
if [ -f "/app/data/ssl/termix.crt" ] && [ -f "/app/data/ssl/termix.key" ]; then
echo "SSL certificates found, checking validity..."
# Check if certificate is still valid (not expired within 30 days)
if openssl x509 -in /app/data/ssl/termix.crt -checkend 2592000 -noout >/dev/null 2>&1; then
echo "SSL certificates are valid and will be reused for domain: $DOMAIN"
else
@@ -47,7 +45,6 @@ if [ "$ENABLE_SSL" = "true" ]; then
echo "SSL certificates not found, will generate new ones..."
fi
# Generate certificates only if they don't exist or are invalid
if [ ! -f "/app/data/ssl/termix.crt" ] || [ ! -f "/app/data/ssl/termix.key" ]; then
echo "Generating SSL certificates for domain: $DOMAIN"
@@ -101,6 +98,18 @@ echo "Starting backend services..."
cd /app
export NODE_ENV=production
if [ -f "package.json" ]; then
VERSION=$(grep '"version"' package.json | sed 's/.*"version": *"\([^"]*\)".*/\1/')
if [ -n "$VERSION" ]; then
export VERSION
echo "Detected version: $VERSION"
else
echo "Warning: Could not extract version from package.json"
fi
else
echo "Warning: package.json not found"
fi
if command -v su-exec > /dev/null 2>&1; then
su-exec node node dist/backend/backend/starter.js
else