-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathstart.sh
More file actions
29 lines (23 loc) 路 744 Bytes
/
Copy pathstart.sh
File metadata and controls
29 lines (23 loc) 路 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
set -e
apt-get update -qq && apt-get install -y -qq curl git unzip
curl -fsSL https://bun.sh/install | bash
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
# Hapus dulu kalau sudah ada
rm -rf /app/qwen-gate
git clone https://github.com/youssefvdel/qwen-gate.git /app/qwen-gate
cd /app/qwen-gate
bun install
RAILWAY_PORT="${PORT:-8080}"
bun -e "
const fs = require('fs');
let raw = fs.readFileSync('config.json', 'utf8');
raw = raw.replace(/\/\/[^\n]*/g, '').replace(/\/\*[\s\S]*?\*\//g, '');
const cfg = JSON.parse(raw);
cfg.HOST = '0.0.0.0';
cfg.PORT = '$RAILWAY_PORT';
fs.writeFileSync('config.json', JSON.stringify(cfg, null, 2));
console.log('Patched HOST:', cfg.HOST, 'PORT:', cfg.PORT);
"
bun start