Linux websever 5.15.0-153-generic #163-Ubuntu SMP Thu Aug 7 16:37:18 UTC 2025 x86_64
Apache/2.4.52 (Ubuntu)
: 192.168.3.70 | : 192.168.1.99
Cant Read [ /etc/named.conf ]
8.1.2-1ubuntu2.23
urlab
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
html /
cqt /
[ HOME SHELL ]
Name
Size
Permission
Action
dist
[ DIR ]
drwxr-xr-x
node_modules
[ DIR ]
drwxr-xr-x
public
[ DIR ]
drwxr-xr-x
server
[ DIR ]
drwxr-xr-x
src
[ DIR ]
drwxr-xr-x
.env
41
B
-rw-r--r--
.env.example
285
B
-rw-r--r--
README.md
2.09
KB
-rw-r--r--
apache-config.conf
2.78
KB
-rw-r--r--
bun.lockb
196.41
KB
-rw-r--r--
components.json
414
B
-rw-r--r--
deploy.sh
4.87
KB
-rw-r--r--
eslint.config.js
765
B
-rw-r--r--
index.html
1.05
KB
-rw-r--r--
package-lock.json
236.95
KB
-rw-r--r--
package.json
2.69
KB
-rw-r--r--
postcss.config.js
81
B
-rw-r--r--
setup-server.sh
7.51
KB
-rw-r--r--
tailwind.config.ts
3.81
KB
-rw-r--r--
tsconfig.app.json
652
B
-rw-r--r--
tsconfig.json
369
B
-rw-r--r--
tsconfig.node.json
481
B
-rw-r--r--
utils.ts
169
B
-rw-r--r--
vite.config.ts
454
B
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : deploy.sh
#!/bin/bash # Deployment script for Quantum Technology Centre Website # This script helps deploy the application to production with proper CORS configuration set -e # Exit on error echo "🚀 Quantum Technology Centre - Production Deployment Script" echo "============================================================" echo "" # Colors for output RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[1;33m' NC='\033[0m' # No Color # Check if running on server read -p "Are you deploying to production server? (y/n): " -n 1 -r echo if [[ ! $REPLY =~ ^[Yy]$ ]]; then echo "Deployment cancelled." exit 1 fi # Step 1: Check environment file echo -e "${YELLOW}Step 1: Checking environment configuration...${NC}" if [ ! -f "server/.env" ]; then echo -e "${RED}❌ Error: server/.env file not found!${NC}" echo "Create it from server/.env.production.example" exit 1 fi # Check for production URLs if ! grep -q "PRODUCTION_URL" server/.env; then echo -e "${RED}❌ Error: PRODUCTION_URL not set in server/.env${NC}" echo "Add your production domain: PRODUCTION_URL=https://your-domain.com" exit 1 fi echo -e "${GREEN}✓ Environment file found${NC}" # Step 2: Check NODE_ENV echo -e "${YELLOW}Step 2: Checking NODE_ENV...${NC}" if grep -q "NODE_ENV=production" server/.env; then echo -e "${GREEN}✓ NODE_ENV is set to production${NC}" else echo -e "${YELLOW}⚠ Warning: NODE_ENV is not set to production${NC}" read -p "Set NODE_ENV=production? (y/n): " -n 1 -r echo if [[ $REPLY =~ ^[Yy]$ ]]; then sed -i 's/NODE_ENV=.*/NODE_ENV=production/' server/.env echo -e "${GREEN}✓ Updated NODE_ENV to production${NC}" fi fi # Step 3: Install dependencies echo -e "${YELLOW}Step 3: Installing backend dependencies...${NC}" cd server npm install --production echo -e "${GREEN}✓ Backend dependencies installed${NC}" # Step 4: Build frontend echo -e "${YELLOW}Step 4: Building frontend...${NC}" cd .. npm install # Check if .env.production exists if [ ! -f ".env.production" ]; then echo -e "${YELLOW}⚠ .env.production not found. Creating from template...${NC}" read -p "Enter your API URL (e.g., https://api.yourdomain.com): " API_URL echo "VITE_API_URL=$API_URL" > .env.production echo -e "${GREEN}✓ Created .env.production${NC}" fi npm run build echo -e "${GREEN}✓ Frontend built successfully${NC}" # Step 5: Test backend CORS echo -e "${YELLOW}Step 5: Testing CORS configuration...${NC}" cd server # Start backend temporarily if not running if ! pgrep -f "node index.js" > /dev/null; then echo "Starting backend for testing..." node index.js > /tmp/quantum-backend.log 2>&1 & BACKEND_PID=$! sleep 3 # Test CORS CORS_TEST=$(curl -s -H "Origin: $(grep PRODUCTION_URL .env | cut -d '=' -f2)" \ -H "Access-Control-Request-Method: GET" \ -X OPTIONS \ http://localhost:5000/api/health -I | grep -i "access-control-allow-origin" || echo "FAILED") if [ "$CORS_TEST" != "FAILED" ]; then echo -e "${GREEN}✓ CORS configuration working${NC}" else echo -e "${RED}❌ CORS test failed. Check logs: /tmp/quantum-backend.log${NC}" kill $BACKEND_PID 2>/dev/null || true exit 1 fi kill $BACKEND_PID 2>/dev/null || true else echo -e "${GREEN}✓ Backend already running${NC}" fi # Step 6: PM2 deployment echo -e "${YELLOW}Step 6: Deploying with PM2...${NC}" if command -v pm2 &> /dev/null; then # Stop existing instance pm2 stop quantum-api 2>/dev/null || true # Start/restart with PM2 pm2 start index.js --name quantum-api --env production pm2 save echo -e "${GREEN}✓ Backend deployed with PM2${NC}" echo "" echo "View logs: pm2 logs quantum-api" echo "Check status: pm2 status" else echo -e "${RED}❌ PM2 not installed. Install with: sudo npm install -g pm2${NC}" exit 1 fi # Step 7: Summary echo "" echo -e "${GREEN}============================================================${NC}" echo -e "${GREEN}🎉 Deployment Complete!${NC}" echo -e "${GREEN}============================================================${NC}" echo "" echo "📋 Next Steps:" echo "1. Configure Nginx to serve frontend from: ./dist" echo "2. Point API subdomain to: http://localhost:5000" echo "3. Enable SSL with: sudo certbot --nginx" echo "4. Test your website and admin portal" echo "" echo "🔍 Monitoring:" echo " • Backend logs: pm2 logs quantum-api" echo " • Backend status: pm2 status" echo " • Restart backend: pm2 restart quantum-api" echo "" echo "🛡️ Security Checklist:" echo " [ ] Changed default admin password" echo " [ ] Generated secure JWT_SECRET" echo " [ ] SSL certificate installed" echo " [ ] Firewall configured (ports 80, 443)" echo " [ ] Backups configured" echo "" echo "📚 Documentation:" echo " • Deployment Guide: README.md" echo " • CORS Configuration: CORS-GUIDE.md" echo ""
Close