Add a comprehensive Rocky Linux installation guide and streamline domain configuration
Add a detailed guide for installing the application on Rocky Linux, including systemd service setup and Nginx configuration. Streamline domain setting by introducing a script to update environment variables and rebuild the frontend, and remove the URL input from the flyer component. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 923ae0e3-a363-4db8-b04a-e8baca2a1330 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 3d999b96-66af-4728-92b9-3a39ade05f44 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8af7d2ec-2cc3-4ece-8af3-9f071488d072/923ae0e3-a363-4db8-b04a-e8baca2a1330/qCk7LE3 Replit-Helium-Checkpoint-Created: true
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
#!/usr/bin/env bash
|
||||
# set-domain.sh — Configure le nom de domaine et reconstruit le frontend
|
||||
#
|
||||
# Usage : bash scripts/set-domain.sh https://votredomaine.fr
|
||||
#
|
||||
# Ce script :
|
||||
# 1. Met à jour la variable VITE_APP_URL dans .env
|
||||
# 2. Reconstruit le frontend (le QR code sera mis à jour)
|
||||
#
|
||||
# Prérequis : pnpm installé, être à la racine du projet
|
||||
|
||||
set -e
|
||||
|
||||
DOMAIN="${1:-}"
|
||||
|
||||
if [ -z "$DOMAIN" ]; then
|
||||
echo "Usage : bash scripts/set-domain.sh https://votredomaine.fr"
|
||||
echo ""
|
||||
echo "Exemples :"
|
||||
echo " bash scripts/set-domain.sh https://lavoixdupeuple.fr"
|
||||
echo " bash scripts/set-domain.sh http://192.168.1.10:8080"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ENV_FILE=".env"
|
||||
|
||||
# Créer .env si absent
|
||||
if [ ! -f "$ENV_FILE" ]; then
|
||||
touch "$ENV_FILE"
|
||||
echo "Fichier .env créé."
|
||||
fi
|
||||
|
||||
# Mettre à jour ou ajouter VITE_APP_URL
|
||||
if grep -q "^VITE_APP_URL=" "$ENV_FILE"; then
|
||||
sed -i "s|^VITE_APP_URL=.*|VITE_APP_URL=${DOMAIN}|" "$ENV_FILE"
|
||||
echo "VITE_APP_URL mis à jour : ${DOMAIN}"
|
||||
else
|
||||
echo "VITE_APP_URL=${DOMAIN}" >> "$ENV_FILE"
|
||||
echo "VITE_APP_URL ajouté : ${DOMAIN}"
|
||||
fi
|
||||
|
||||
# Exporter pour que Vite le lise pendant le build
|
||||
export VITE_APP_URL="${DOMAIN}"
|
||||
|
||||
echo ""
|
||||
echo "Reconstruction du frontend..."
|
||||
pnpm --filter @workspace/voix-du-peuple run build --config vite.config.selfhost.ts
|
||||
|
||||
echo ""
|
||||
echo "Terminé. Le QR code pointe maintenant vers : ${DOMAIN}"
|
||||
echo "Redémarrez Nginx si le build est en production : systemctl reload nginx"
|
||||
Reference in New Issue
Block a user