-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJustfile
46 lines (34 loc) · 1.02 KB
/
Justfile
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
server_host := `cat rathole-domain.txt`
ssh_host := "root@" + server_host
default:
just --list
host:
echo {{server_host}}
ssh:
ssh {{ssh_host}}
start:
#!/usr/bin/env bash
set -ue
# create the resorces
# build the config
./scripts/build-rathole-config.py
# scp the configs to the server
scp config/rathole-server.toml {{ssh_host}}:
scp config/Caddyfile {{ssh_host}}:
# scp the scripts to the server
scp scripts/run-server-tmux.sh {{ssh_host}}:
scp scripts/run-caddy.sh {{ssh_host}}:
scp scripts/download-caddy.sh {{ssh_host}}:
# ensure the rathole bin is downloaded
./scripts/download-rathole.sh
# scp the rathole binary to the server
scp bin/rathole {{ssh_host}}:
# run the download-caddy script
ssh {{ssh_host}} "./download-caddy.sh"
# start the rathole server
ssh {{ssh_host}} "./run-server-tmux.sh"
# start caddy
ssh {{ssh_host}} "./run-caddy.sh"
echo "https srever address https://{{server_host}}"
# run the rathole client
./bin/rathole -c config/rathole-client.toml