From 4f26644290bb12e61c8896007fc90a89477d8517 Mon Sep 17 00:00:00 2001 From: Jacob Schantli Date: Tue, 3 Mar 2026 17:52:20 -0800 Subject: [PATCH] Upload files to "/" --- fedora-deploy.sh | 92 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 fedora-deploy.sh diff --git a/fedora-deploy.sh b/fedora-deploy.sh new file mode 100644 index 0000000..bd0072f --- /dev/null +++ b/fedora-deploy.sh @@ -0,0 +1,92 @@ +#!/bin/bash +# ============================================================================== +# FEDORA SERVER DEPLOYMENT SCRIPT (React + Vite + Nginx) +# ============================================================================== +# This script configures a Fedora Server to host your Fedora-PIS website. +# It handles Nginx setup, Firewall rules, and SELinux permissions. +# ============================================================================== + +# --- CONFIGURATION --- +DOMAIN="10.1.22.62" # Replace with your actual domain or new IP +INSTALL_DIR="/var/www/fedora-website" + +echo "🚀 Starting deployment on Fedora Server..." + +# 1. Update and Install Dependencies +echo "📦 Installing Nginx, Node.js, and Security Tools..." +sudo dnf update -y +sudo dnf install -y nginx nodejs git certbot python3-certbot-nginx + +# 2. Prepare Directory +echo "📁 Setting up web directory at $INSTALL_DIR..." +sudo mkdir -p $INSTALL_DIR +sudo chown -R $USER:$USER $INSTALL_DIR + +# 3. Build the Project +echo "🏗️ Building the React application..." +cd $INSTALL_DIR +if [ -f "package.json" ]; then + npm install + npm run build +else + echo "⚠️ Warning: No package.json found. Make sure your files are in $INSTALL_DIR" + exit 1 +fi + +# 4. Configure Nginx +echo "⚙️ Configuring Nginx for $DOMAIN..." +cat <