mirror of
https://github.com/xxoommd/magic.git
synced 2025-07-04 09:42:43 +00:00
updat scripts; update x to v0.3
This commit is contained in:
parent
fb57013052
commit
f7a40906d2
@ -17,15 +17,12 @@ function print_info() {
|
||||
|
||||
declare -A servers
|
||||
servers["yact"]="ssh root@172.50.10.83"
|
||||
servers["tw1"]="ssh root@tw1.xxoommd.asia"
|
||||
servers["tw2"]="ssh root@tw2.xxoommd.asia"
|
||||
servers["tw3"]="ssh root@tw3.xxoommd.asia"
|
||||
servers["hk1"]="ssh root@hk1.xxoommd.asia"
|
||||
servers["hk2"]="ssh root@hk2.xxoommd.asia"
|
||||
servers["us1"]="ssh root@us1.xxoommd.asia"
|
||||
servers["us2"]="ssh root@us2.xxoommd.asia"
|
||||
servers["tw"]="ssh root@tw.xmdgg.xyz"
|
||||
servers["hk"]="ssh root@hk.xmdgg.xyz"
|
||||
servers["us"]="ssh root@us.xmdgg.xyz"
|
||||
servers["ya"]="ssh -p 7189 gaohengyi@jumpserver.yacloud.net"
|
||||
servers["u1"]="ssh root@u1"
|
||||
servers["dev"]="ssh root@125.64.33.85"
|
||||
|
||||
function help() {
|
||||
echo
|
||||
|
@ -1,12 +1,12 @@
|
||||
# Verion 0.2
|
||||
# Verion 0.3
|
||||
|
||||
## QUICK START
|
||||
|
||||
1. Set variable: `DEPLOY_DOMAIN` and `TAG`
|
||||
1. Set variable: `DOMAIN` and `TAG`
|
||||
|
||||
```shell
|
||||
export DEPLOY_DOMAIN=xxx.xxx
|
||||
export TAG=v0.2
|
||||
export DOMAIN=xxx.xxx
|
||||
export TAG=v0.3
|
||||
```
|
||||
|
||||
2. Start
|
||||
|
@ -15,9 +15,9 @@ function loginfo() {
|
||||
echo -e "[INFO] $1"
|
||||
}
|
||||
|
||||
if [[ -z $DEPLOY_DOMAIN ]]; then
|
||||
if [[ -z $DOMAIN ]]; then
|
||||
echo
|
||||
logerr "env:DEPLOY_DOMAIN is not set"
|
||||
logerr "env:DOMAIN is not set"
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
@ -81,7 +81,7 @@ NAIVE_CONFIG="./naive-config.json"
|
||||
function gen_hysteria_config() {
|
||||
|
||||
cat >$HYSTERIA_CONFIG <<EOF
|
||||
server: $DEPLOY_DOMAIN:8443
|
||||
server: $DOMAIN:8443
|
||||
auth: fuckyouall
|
||||
bandwidth:
|
||||
up: 100 mbps
|
||||
@ -99,7 +99,7 @@ function gen_naive_config() {
|
||||
cat >${NAIVE_CONFIG} <<EOF
|
||||
{
|
||||
"listen": "http://127.0.0.1:28081",
|
||||
"proxy": "quic://xxoommd:fuckyouall@$DEPLOY_DOMAIN"
|
||||
"proxy": "quic://xxoommd:fuckyouall@$DOMAIN"
|
||||
}
|
||||
EOF
|
||||
echo -e "[INFO] Generate Done\n"
|
||||
|
@ -27,19 +27,19 @@ function is_valid_domain() {
|
||||
fi
|
||||
}
|
||||
|
||||
echo -e "\n[INFO] Validate DOMAN: ${BLUE}${DEPLOY_DOMAIN}${NC} ..."
|
||||
echo -e "\n[INFO] Validate DOMAN: ${BLUE}${DOMAIN}${NC} ..."
|
||||
|
||||
if [[ -z $DEPLOY_DOMAIN ]]; then
|
||||
if [[ -z $DOMAIN ]]; then
|
||||
echo
|
||||
echo "[${RED}Err${NC}] DEPLOY_DOMAIN is not set"
|
||||
echo "[${RED}Err${NC}] DOMAIN is not set"
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if is_valid_domain "$DEPLOY_DOMAIN"; then
|
||||
echo -e "[INFO] ${BLUE}${UNDERLINE}$DEPLOY_DOMAIN${NC} is a valid domain.\n"
|
||||
if is_valid_domain "$DOMAIN"; then
|
||||
echo -e "[INFO] ${BLUE}${UNDERLINE}$DOMAIN${NC} is a valid domain.\n"
|
||||
else
|
||||
echo -e "[${RED}ERR${NC}] ${BLUE}${UNDERLINE}$DEPLOY_DOMAIN${NC} is not a valid domain. Abort."
|
||||
echo -e "[${RED}ERR${NC}] ${BLUE}${UNDERLINE}$DOMAIN${NC} is not a valid domain. Abort."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -67,9 +67,9 @@ if [ ! -d "${WORKING_DIR}" ]; then
|
||||
fi
|
||||
|
||||
CADDY_STORAGE="${WORKING_DIR}/caddy"
|
||||
CERT_DIR="$CADDY_STORAGE/certificates/acme-v02.api.letsencrypt.org-directory/$DEPLOY_DOMAIN"
|
||||
CRT_FILE="$CERT_DIR/$DEPLOY_DOMAIN.crt"
|
||||
KEY_FILE="$CERT_DIR/$DEPLOY_DOMAIN.key"
|
||||
CERT_DIR="$CADDY_STORAGE/certificates/acme-v02.api.letsencrypt.org-directory/$DOMAIN"
|
||||
CRT_FILE="$CERT_DIR/$DOMAIN.crt"
|
||||
KEY_FILE="$CERT_DIR/$DOMAIN.key"
|
||||
HY_CONFIG_FILE="${WORKING_DIR}/hy-config.yaml"
|
||||
CADDY_CONFIG_FILE="${WORKING_DIR}/Caddyfile"
|
||||
|
||||
@ -86,8 +86,8 @@ cat >${CADDY_CONFIG_FILE} <<EOF
|
||||
storage file_system $CADDY_STORAGE
|
||||
}
|
||||
|
||||
:443, ${DEPLOY_DOMAIN}
|
||||
tls xxoommd@${DEPLOY_DOMAIN}
|
||||
:443, ${DOMAIN}
|
||||
tls xxoommd@${DOMAIN}
|
||||
route {
|
||||
forward_proxy {
|
||||
basic_auth xxoommd fuckyouall
|
||||
@ -96,7 +96,7 @@ tls xxoommd@${DEPLOY_DOMAIN}
|
||||
probe_resistance
|
||||
# upstream socks5://127.0.0.1:40000
|
||||
}
|
||||
respond "hello ${DEPLOY_DOMAIN}@naive!"
|
||||
respond "hello ${DOMAIN}@naive!"
|
||||
}
|
||||
EOF
|
||||
echo -e "[INFO] Generate Done\n"
|
||||
@ -113,7 +113,7 @@ auth:
|
||||
masquerade:
|
||||
type: string
|
||||
string:
|
||||
content: 'hello ${DEPLOY_DOMAIN}@hysteria2'
|
||||
content: 'hello ${DOMAIN}@hysteria2'
|
||||
headers:
|
||||
content-type: text/plain
|
||||
custom-stuff: ice cream so good
|
||||
|
Loading…
x
Reference in New Issue
Block a user