Dhurgh commited on
Commit
59b6f66
·
unverified ·
1 Parent(s): b968ee5

Add FireTech Arch Linux Auto-Deployer script

Browse files

This script automates the deployment of the FireTech application on Arch Linux, including installation, configuration, and server startup.

Files changed (1) hide show
  1. Deploy-FireTech.ps1 +41 -0
Deploy-FireTech.ps1 ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # FireTech Messenger - Arch Linux Auto-Deployer
2
+ Write-Host "Starting FireTech Arch Deployment..." -ForegroundColor Cyan
3
+
4
+ # 1. Install Arch if not present
5
+ if (!(wsl -l | Select-String "archlinux")) {
6
+ Write-Host "Installing Arch Linux..." -ForegroundColor Yellow
7
+ wsl --install archlinux
8
+ }
9
+
10
+ # 2. Run the setup commands inside Arch
11
+ Write-Host "Configuring Arch Linux Environment..." -ForegroundColor Yellow
12
+ wsl -d archlinux -u root -- bash -c @"
13
+ # Update and Install
14
+ pacman -Syu --noconfirm
15
+ pacman -S --noconfirm git nodejs npm postgresql sudo nano
16
+
17
+ # Setup Database
18
+ mkdir -p /run/postgresql
19
+ chown postgres:postgres /run/postgresql
20
+ sudo -u postgres initdb -D /var/lib/postgres/data
21
+ sudo -u postgres postgres -D /var/lib/postgres/data > /dev/null 2>&1 &
22
+ sleep 3
23
+ sudo -u postgres createdb railway
24
+
25
+ # Clone and Install App
26
+ cd ~
27
+ git clone https://github.com/dhurghamCreation/FireTech-Messager-Server.git
28
+ cd FireTech-Messager-Server
29
+ npm install
30
+
31
+ # Create .env
32
+ echo "DATABASE_URL=postgresql://postgres@localhost:5432/railway" > .env
33
+ echo "JWT_SECRET=firetech_secret_123" >> .env
34
+ echo "PORT=3000" >> .env
35
+
36
+ # Start Server
37
+ Write-Host "SERVER IS STARTING..."
38
+ node server.js
39
+ "@
40
+
41
+ Write-Host "Deployment Finished!" -ForegroundColor Green