Skip to content

Commit

Permalink
deploy scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
polymorpher committed Nov 12, 2023
1 parent 77835b2 commit 55450e0
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
6 changes: 6 additions & 0 deletions voice/relay/deploy/enable.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
sudo setcap CAP_NET_BIND_SERVICE=+eip /usr/bin/node
sudo cp voice-ai-relay.service /etc/systemd/system/voice-ai-relay.service
sudo systemctl start voice-ai-relay
sudo systemctl enable voice-ai-relay
systemctl status voice-ai-relay
2 changes: 2 additions & 0 deletions voice/relay/deploy/log.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
journalctl -u voice-ai-relay
8 changes: 8 additions & 0 deletions voice/relay/deploy/port.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
!#/bin/sh
sudo iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT
sudo iptables -A INPUT -i eth0 -p tcp --dport 3000 -j ACCEPT
sudo iptables -A INPUT -i eth0 -p tcp --dport 443 -j ACCEPT
sudo iptables -A INPUT -i eth0 -p tcp --dport 8443 -j ACCEPT
sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3000
sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 8443
sudo iptables --flush
15 changes: 15 additions & 0 deletions voice/relay/deploy/voice-ai-relay.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Unit]
Description=Voice AI Relay Server
Documentation=https://github.com/harmony-one/x/
After=network.target

[Service]
Environment=PORT=80 HTTPS_PORT=443
Type=simple
User=worker
WorkingDirectory=/opt/git/x/voice/relay
ExecStart=/usr/bin/node /opt/git/x/voice/relay/bin/run.js
Restart=on-failure

[Install]
WantedBy=multi-user.target

0 comments on commit 55450e0

Please sign in to comment.