Files
hihala-dashboard/setup-nginx.sh
fahed b7ad978e29
All checks were successful
Deploy HiHala Dashboard / deploy (push) Successful in 7s
Migrate from Create React App to Vite
CRA (react-scripts 5.0.1) is abandoned and incompatible with TypeScript 5.x.
Vite provides faster builds, active maintenance, and native TS5 support.

- Replace react-scripts with vite + @vitejs/plugin-react
- Move index.html to root with script module entry point
- Replace setupProxy.js with vite.config.ts proxy config
- Rename env vars from REACT_APP_ to VITE_ prefix
- Update tsconfig for bundler module resolution
- Add nginx setup script for deployment

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 17:24:11 +03:00

38 lines
1.2 KiB
Bash

#!/bin/bash
# Create nginx config for dashboard.tools.hihala.com
sudo tee /etc/nginx/sites-available/dashboard.tools.hihala.com > /dev/null <<'EOF'
server {
listen 80;
listen [::]:80;
server_name dashboard.tools.hihala.com;
location /.well-known/acme-challenge/ {
root /var/www/html;
}
location / {
proxy_pass http://127.0.0.1:3001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
EOF
sudo ln -sf /etc/nginx/sites-available/dashboard.tools.hihala.com /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx
# Test ACME challenge path
sudo mkdir -p /var/www/html/.well-known/acme-challenge/
echo "test" | sudo tee /var/www/html/.well-known/acme-challenge/test
curl -s http://dashboard.tools.hihala.com/.well-known/acme-challenge/test && echo " - OK"
rm -f /var/www/html/.well-known/acme-challenge/test
# Run certbot
sudo certbot --nginx -d dashboard.tools.hihala.com