diff --git a/ct/akaunting.sh b/ct/akaunting.sh index bed5a808..bb6df16e 100644 --- a/ct/akaunting.sh +++ b/ct/akaunting.sh @@ -52,7 +52,7 @@ function update_script() { cd /opt/akaunting $STD composer install --no-dev --optimize-autoloader $STD npm install - $STD npm run dev + $STD npm run production $STD php artisan migrate --force $STD php artisan optimize:clear chown -R www-data:www-data /opt/akaunting diff --git a/ct/blinko.sh b/ct/blinko.sh index 65a49a47..c5458692 100644 --- a/ct/blinko.sh +++ b/ct/blinko.sh @@ -47,9 +47,12 @@ function update_script() { msg_info "Updating Application" cd /opt/blinko - $STD bun install + $STD bun install --unsafe-perm + $STD bun run build:web + $STD bun run build:seed + mkdir -p /opt/blinko/server/public + cp -r /opt/blinko/dist/public/. /opt/blinko/server/public/ 2>/dev/null || true $STD bunx prisma migrate deploy - $STD bun run build msg_ok "Updated Application" msg_info "Starting Service" diff --git a/install/akaunting-install.sh b/install/akaunting-install.sh index bca0590b..5678ac31 100644 --- a/install/akaunting-install.sh +++ b/install/akaunting-install.sh @@ -28,7 +28,7 @@ msg_info "Setting up Akaunting" cd /opt/akaunting $STD composer install --no-dev --optimize-autoloader $STD npm install -$STD npm run dev +$STD npm run production cat </opt/akaunting/.env APP_NAME=Akaunting APP_ENV=production diff --git a/install/blinko-install.sh b/install/blinko-install.sh index da49be2b..7577be5d 100644 --- a/install/blinko-install.sh +++ b/install/blinko-install.sh @@ -31,15 +31,19 @@ msg_info "Setting up Blinko" cd /opt/blinko cat </opt/blinko/.env NODE_ENV=production +PORT=1111 DATABASE_URL=postgresql://${PG_DB_USER}:${PG_DB_PASS}@127.0.0.1:5432/${PG_DB_NAME} -NEXT_PUBLIC_BASE_URL=http://${LOCAL_IP}:1111 NEXTAUTH_URL=http://${LOCAL_IP}:1111 NEXTAUTH_SECRET=$(openssl rand -base64 32) +NEXT_PUBLIC_BASE_URL=http://${LOCAL_IP}:1111 EOF -$STD bun install -$STD bunx prisma generate +$STD bun install --unsafe-perm +$STD bun run build:web +$STD bun run build:seed +mkdir -p /opt/blinko/server/public +cp -r /opt/blinko/dist/public/. /opt/blinko/server/public/ 2>/dev/null || true $STD bunx prisma migrate deploy -$STD bun run build +$STD node /opt/blinko/dist/seed.js msg_ok "Set up Blinko" msg_info "Creating Service" @@ -51,9 +55,9 @@ After=network.target postgresql.service [Service] Type=simple User=root -WorkingDirectory=/opt/blinko +WorkingDirectory=/opt/blinko/server EnvironmentFile=/opt/blinko/.env -ExecStart=/usr/bin/node /opt/blinko/.next/standalone/server.js +ExecStart=/usr/bin/node /opt/blinko/dist/index.js Restart=on-failure RestartSec=5 diff --git a/install/invoiceshelf-install.sh b/install/invoiceshelf-install.sh index a701df49..1de218fb 100644 --- a/install/invoiceshelf-install.sh +++ b/install/invoiceshelf-install.sh @@ -28,8 +28,6 @@ fetch_and_deploy_gh_release "invoiceshelf" "InvoiceShelf/InvoiceShelf" "tarball" msg_info "Setting up InvoiceShelf" cd /opt/invoiceshelf cp .env.example .env -APP_KEY=$($STD php artisan key:generate --show) -sed -i "s|^APP_KEY=.*|APP_KEY=${APP_KEY}|" .env sed -i "s|^APP_ENV=.*|APP_ENV=production|" .env sed -i "s|^APP_DEBUG=.*|APP_DEBUG=false|" .env sed -i "s|^APP_URL=.*|APP_URL=http://${LOCAL_IP}|" .env @@ -40,6 +38,7 @@ sed -i "s|^DB_DATABASE=.*|DB_DATABASE=${PG_DB_NAME}|" .env sed -i "s|^DB_USERNAME=.*|DB_USERNAME=${PG_DB_USER}|" .env sed -i "s|^DB_PASSWORD=.*|DB_PASSWORD=${PG_DB_PASS}|" .env $STD composer install --no-dev --optimize-autoloader +$STD php artisan key:generate $STD yarn install $STD yarn build mkdir -p storage/framework/{cache,sessions,views} storage/logs bootstrap/cache diff --git a/install/solidtime-install.sh b/install/solidtime-install.sh index b8cfc3e3..74b64fd8 100644 --- a/install/solidtime-install.sh +++ b/install/solidtime-install.sh @@ -28,8 +28,6 @@ fetch_and_deploy_gh_release "solidtime" "solidtime-io/solidtime" "tarball" msg_info "Setting up SolidTime" cd /opt/solidtime cp .env.example .env -APP_KEY=$($STD php artisan key:generate --show) -sed -i "s|^APP_KEY=.*|APP_KEY=${APP_KEY}|" .env sed -i "s|^APP_ENV=.*|APP_ENV=production|" .env sed -i "s|^APP_DEBUG=.*|APP_DEBUG=false|" .env sed -i "s|^APP_URL=.*|APP_URL=http://${LOCAL_IP}|" .env @@ -40,11 +38,13 @@ sed -i "s|^DB_DATABASE=.*|DB_DATABASE=${PG_DB_NAME}|" .env sed -i "s|^DB_USERNAME=.*|DB_USERNAME=${PG_DB_USER}|" .env sed -i "s|^DB_PASSWORD=.*|DB_PASSWORD=${PG_DB_PASS}|" .env $STD composer install --no-dev --optimize-autoloader +$STD php artisan key:generate $STD npm install $STD npm run build mkdir -p storage/framework/{cache,sessions,views} storage/logs bootstrap/cache chown -R www-data:www-data /opt/solidtime chmod -R 775 storage bootstrap/cache +$STD php artisan storage:link $STD php artisan migrate --force msg_ok "Set up SolidTime"