forked from 5stackgg/5stack-panel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgame-node-server-setup.sh
More file actions
executable file
·60 lines (42 loc) · 2.33 KB
/
game-node-server-setup.sh
File metadata and controls
executable file
·60 lines (42 loc) · 2.33 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
source setup-env.sh "$@"
echo "Installing Game Node Server dependencies..."
curl -sfL https://tailscale.com/install.sh | sh
echo "Generate and enter your Tailscale auth key: https://login.tailscale.com/admin/settings/keys, make sure to select the \"Pre Approved\" option"
echo -e "\033[1;36mEnter your Tailscale auth key:\033[0m"
read TAILSCALE_AUTH_KEY
while [ -z "$TAILSCALE_AUTH_KEY" ]; do
echo "Tailscale auth key cannot be empty. Please enter your Tailscale auth key:"
read TAILSCALE_AUTH_KEY
done
curl -sfL https://get.k3s.io | sh -s - --disable=traefik --vpn-auth="name=tailscale,joinKey=${TAILSCALE_AUTH_KEY}";
echo -e "\033[1;36mEnter your Tailscale network name (e.g. example.ts.net) from https://login.tailscale.com/admin/dns:\033[0m"
read TAILSCALE_NET_NAME
while [ -z "$TAILSCALE_NET_NAME" ]; do
echo "Tailscale network name cannot be empty. Please enter your Tailscale network name (e.g. example.ts.net):"
read TAILSCALE_NET_NAME
done
update_env_var "overlays/config/api-config.env" "TAILSCALE_NET_NAME" "$TAILSCALE_NET_NAME"
echo -e "\033[1;31mCreate an OAuth Client with the Auth Keys (\`auth_keys\`) scope with write access from https://login.tailscale.com/admin/settings/oauth\033[0m"
echo -e "\033[1;36mEnter your Secret Key from the step above:\033[0m"
read TAILSCALE_SECRET_ID
while [ -z "$TAILSCALE_SECRET_ID" ]; do
echo "Tailscale secret key cannot be empty. Please enter your Tailscale secret key:"
read TAILSCALE_SECRET_ID
done
update_env_var "overlays/local-secrets/tailscale-secrets.env" "TAILSCALE_SECRET_ID" "$TAILSCALE_SECRET_ID"
echo -e "\033[1;36mEnter the Client ID from the Step Above:\033[0m"
read TAILSCALE_CLIENT_ID
while [ -z "$TAILSCALE_CLIENT_ID" ]; do
echo "Tailscale client ID cannot be empty. Please enter your Tailscale client ID:"
read TAILSCALE_CLIENT_ID
done
update_env_var "overlays/config/api-config.env" "TAILSCALE_CLIENT_ID" "$TAILSCALE_CLIENT_ID"
echo -e "\033[1;36mOn the tailscale dashboard you should see your node come online, once it does enter the IP Address of the node:\033[0m"
read TAILSCALE_NODE_IP
while [ -z "$TAILSCALE_NODE_IP" ]; do
echo "Tailscale node IP cannot be empty. Please enter your Tailscale node IP:"
read TAILSCALE_NODE_IP
done
update_env_var "overlays/config/api-config.env" "TAILSCALE_NODE_IP" "$TAILSCALE_NODE_IP"
source update.sh "$@"