-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhostcfg.txt
46 lines (36 loc) · 1.55 KB
/
hostcfg.txt
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# hostcfg.txt - run from build environment
# log onto the host linux instance
ssh USER@HOST_IP_ADDR
# On first setup of the host machine
mkdir xdk
mkdir xqiz.it
mkdir xqiz.it/lib
mkdir xqiz.it/platform
cd xqiz.it
echo '{"dName":"CN=xtc-platform.localhost.xqiz.it",
"cert-provider":"self",
"httpPort":8080,
"httpsPort":8090
}' > platform/cfg.json
# copy your latest build to HOST_IP_ADDR
# Build paths may be different but we should probably be opinionated
scp -r ~/xtclang/xvm/xdk/build/install/xdk/* USER@HOST_IP_ADDR:~/xdk
scp -r ~/xtclang/platform/lib/* USER@HOST_IP_ADDR:~/xqiz.it/lib
# update the HOST_MACHINE ~/.bashrc
export XDK_HOME="/Users/USER/xdk" [where USER is the local account]
# amend iptables forwarding rules
# Redirect incoming traffic on port 80 to port 8080
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.168.86.47:8080
# Redirect incoming traffic on port 443 to port 8090
sudo iptables -t nat -A PREROUTING -p tcp --dport 443 -j DNAT --to-destination 192.168.86.47:8090
# Ensure return traffic is routed correctly
sudo iptables -t nat -A POSTROUTING -p tcp -d 192.168.86.47 --dport 8080 -j MASQUERADE
sudo iptables -t nat -A POSTROUTING -p tcp -d 192.168.86.47 --dport 8090 -j MASQUERADE
# maintained for when/if we use non-locally signed certs
# ensure that "openssl" and "keytool" are installed
# sudo apt install certbot
# start the paas from ~/ in debug mode
cd
xec -L xqiz.it/lib/ kernel.xqiz.it $password
# or in "production" mode
nohup xec -L xqiz.it/lib/ kernel.xqiz.it $password &> platform.out&USER