Deployment improvements: - Add template env files (.envs.example/) for documentation - Create init-production.sh for one-time server setup - Create build-activepieces.sh for building/deploying AP image - Update deploy.sh with --deploy-ap flag - Make custom-pieces-metadata.sql idempotent - Update DEPLOYMENT.md with comprehensive instructions Frontend: - Redirect logged-in business owners from root domain to tenant dashboard - Redirect logged-in users from /login to /dashboard on their tenant - Log out customers on wrong subdomain instead of redirecting 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
30 lines
1.2 KiB
Bash
30 lines
1.2 KiB
Bash
#!/bin/sh
|
|
|
|
# Set default values if not provided
|
|
export AP_APP_TITLE="${AP_APP_TITLE:-Activepieces}"
|
|
export AP_FAVICON_URL="${AP_FAVICON_URL:-https://cdn.activepieces.com/brand/favicon.ico}"
|
|
|
|
# Debug: Print environment variables
|
|
echo "AP_APP_TITLE: $AP_APP_TITLE"
|
|
echo "AP_FAVICON_URL: $AP_FAVICON_URL"
|
|
|
|
# Process environment variables in index.html BEFORE starting services
|
|
envsubst '${AP_APP_TITLE} ${AP_FAVICON_URL}' < /usr/share/nginx/html/index.html > /usr/share/nginx/html/index.html.tmp && \
|
|
mv /usr/share/nginx/html/index.html.tmp /usr/share/nginx/html/index.html
|
|
|
|
# Register custom pieces (publish to Verdaccio and insert metadata)
|
|
if [ -f /usr/src/app/publish-pieces.sh ]; then
|
|
/usr/src/app/publish-pieces.sh || echo "Warning: Custom pieces registration had issues"
|
|
fi
|
|
|
|
# Start Nginx server
|
|
nginx -g "daemon off;" &
|
|
|
|
# Start backend server
|
|
if [ "$AP_CONTAINER_TYPE" = "APP" ] && [ "$AP_PM2_ENABLED" = "true" ]; then
|
|
echo "Starting backend server with PM2 (APP mode)"
|
|
pm2-runtime start dist/packages/server/api/main.cjs --name "activepieces-app" --node-args="--enable-source-maps" -i 0
|
|
else
|
|
echo "Starting backend server with Node.js (WORKER mode or default)"
|
|
node --enable-source-maps dist/packages/server/api/main.cjs
|
|
fi |