#!/bin/bash # Install and run website-data on this machine (backend port 3025). # Usage: ./install-website-data.sh # Then run update-proxy-nginx.sh from repo root for proxy + certificate (data.certificator.4nkweb.com). set -e SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" cd "$SCRIPT_DIR" echo "=== Installation website-data ===" if [ ! -d node_modules ]; then echo "Installation des dépendances..." npm install fi echo "Build..." npm run build echo "Installation du service systemd..." sudo sed "s|/srv/4NK/data.certificator.4nkweb.com|${SCRIPT_DIR}|g" website-data.service > /tmp/website-data.service sudo cp /tmp/website-data.service /etc/systemd/system/ sudo systemctl daemon-reload sudo systemctl enable website-data sudo systemctl start website-data echo "=== website-data installé et démarré (port 3025) ===" echo "Pour proxy + certificat: ./update-proxy-nginx.sh (depuis la racine du dépôt)"