From 2061023c1578644c5490030f3ef57c5e6d58b6a7 Mon Sep 17 00:00:00 2001 From: "RZ_MINIX\\rober" Date: Sun, 15 Jun 2025 20:45:21 -0700 Subject: [PATCH] Clean up repository - remove runtime files, add proper gitignore --- README.md | 0 deploy-react-app.sh | 105 ++++++++++++++++++++++++++++++++++ mosquitto-new.conf | 16 ++++++ rabbitmq/config/rabbitmq.conf | 2 - rabbitmq/definitions.json | 38 ------------ 5 files changed, 121 insertions(+), 40 deletions(-) delete mode 100644 README.md create mode 100644 deploy-react-app.sh create mode 100644 mosquitto-new.conf delete mode 100644 rabbitmq/config/rabbitmq.conf delete mode 100644 rabbitmq/definitions.json diff --git a/README.md b/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/deploy-react-app.sh b/deploy-react-app.sh new file mode 100644 index 0000000..ff3184c --- /dev/null +++ b/deploy-react-app.sh @@ -0,0 +1,105 @@ +#!/bin/bash +set -e + +echo "Deploying React application using volume mounts..." + +# Check if React app is already built +if [ ! -d ~/server-setup/well_mob_pwa/build ]; then + echo "React build directory not found. Building React application..." + cd ~/server-setup/well_mob_pwa + + # Set environment variables to bypass TypeScript errors + export CI=false + export TSC_COMPILE_ON_ERROR=true + export ESLINT_NO_DEV_ERRORS=true + export DISABLE_ESLINT_PLUGIN=true + + # Build the React app + npm run build + + # Check if build was successful + if [ ! -d "build" ]; then + echo "React build failed. Please check the errors." + exit 1 + fi + echo "React build completed successfully." + cd ~/server-setup +else + echo "Using existing React build directory." +fi + +# Return to server-setup directory +cd ~/server-setup + +# Ensure we have the Nginx config for the React app +if [ ! -f ./nginx/conf.d/react.conf ]; then + echo "Creating Nginx configuration for React app..." + mkdir -p ./nginx/conf.d + + # Try with sudo if needed + if ! cat > ./nginx/conf.d/react.conf << 'EOL' +server { + listen 80; + server_name react.eluxnetworks.net; + + location / { + root /usr/share/nginx/html/react; + try_files $uri $uri/ /index.html; + add_header Cache-Control "no-cache, no-store, must-revalidate"; + } + + # For static assets + location /assets/ { + root /usr/share/nginx/html/react; + expires 1y; + add_header Cache-Control "public, max-age=31536000"; + access_log off; + } +} +EOL + then + echo "Permission denied. Trying with sudo..." + sudo tee ./nginx/conf.d/react.conf > /dev/null << 'EOL' +server { + listen 80; + server_name react.eluxnetworks.net; + + location / { + root /usr/share/nginx/html/react; + try_files $uri $uri/ /index.html; + add_header Cache-Control "no-cache, no-store, must-revalidate"; + } + + # For static assets + location /assets/ { + root /usr/share/nginx/html/react; + expires 1y; + add_header Cache-Control "public, max-age=31536000"; + access_log off; + } +} +EOL + fi +fi + +# Update permissions for acme.json if needed +if [ -f acme.json ]; then + chmod 600 acme.json +fi + +echo "Restarting Docker containers..." +docker compose down +docker compose up -d + +# Check container status +echo "Checking container status..." +sleep 5 +docker compose ps + +echo "React application deployment completed." +echo "Please verify that all sites are working correctly:" +echo "- http://eluxnetworks.net/" +echo "- https://eluxnetworks.net/" +echo "- https://eluxnetworks.net/well_tests/ (user: well_tester, pass: TestWell_2025)" +echo "- https://eluxnetworks.net/shared/" +echo "- https://react.eluxnetworks.net/assets/login-backgroud.png" \ No newline at end of file diff --git a/mosquitto-new.conf b/mosquitto-new.conf new file mode 100644 index 0000000..a7769b3 --- /dev/null +++ b/mosquitto-new.conf @@ -0,0 +1,16 @@ +# Basic configuration +persistence true +persistence_location /mosquitto/data +log_dest file /mosquitto/log/mosquitto.log +log_type warning +log_type error +log_type notice +log_type information + +# Only standard MQTT port - no TLS here +listener 1883 +protocol mqtt + +# Authentication +allow_anonymous false +password_file /mosquitto/config/passwd diff --git a/rabbitmq/config/rabbitmq.conf b/rabbitmq/config/rabbitmq.conf deleted file mode 100644 index 9a346bb..0000000 --- a/rabbitmq/config/rabbitmq.conf +++ /dev/null @@ -1,2 +0,0 @@ -management.load_definitions = /etc/rabbitmq/definitions.json - diff --git a/rabbitmq/definitions.json b/rabbitmq/definitions.json deleted file mode 100644 index ee24b03..0000000 --- a/rabbitmq/definitions.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "users": [ - { - "name": "admin", - "password_hash": "YX91m9ZBhL8oXzpxcrYtVAOv4vgTDfS0YCCYJA1UDPPbNJ+m", - "hashing_algorithm": "rabbit_password_hashing_sha256", - "tags": ["administrator"] - }, - { - "name": "well_pipe", - "password_hash": "AzdMI/4joetKPS2J5AsBOVKMZzW6Dp/ov6xal8vFbLpal43F", - "hashing_algorithm": "rabbit_password_hashing_sha256", - "tags": ["api_user"] - } - ], - "vhosts": [ - { - "name": "/" - } - ], - "permissions": [ - { - "user": "admin", - "vhost": "/", - "configure": ".*", - "write": ".*", - "read": ".*" - }, - { - "user": "well_pipe", - "vhost": "/", - "configure": ".*", - "write": ".*", - "read": ".*" - } - ] -} -