Merge pull request #31 from ReturnFI/Dev
* Change SNI * Change SNI Files/CLI/Handler * modify upgrade.sh * modify singbox sub
This commit is contained in:
16
core/cli.py
16
core/cli.py
@ -22,6 +22,7 @@ class Command(Enum):
|
|||||||
UPDATE_HYSTERIA2 = os.path.join(SCRIPT_DIR, 'hysteria2', 'update.sh')
|
UPDATE_HYSTERIA2 = os.path.join(SCRIPT_DIR, 'hysteria2', 'update.sh')
|
||||||
RESTART_HYSTERIA2 = os.path.join(SCRIPT_DIR, 'hysteria2', 'restart.sh')
|
RESTART_HYSTERIA2 = os.path.join(SCRIPT_DIR, 'hysteria2', 'restart.sh')
|
||||||
CHANGE_PORT_HYSTERIA2 = os.path.join(SCRIPT_DIR, 'hysteria2', 'change_port.sh')
|
CHANGE_PORT_HYSTERIA2 = os.path.join(SCRIPT_DIR, 'hysteria2', 'change_port.sh')
|
||||||
|
CHANGE_SNI_HYSTERIA2 = os.path.join(SCRIPT_DIR, 'hysteria2', 'change_sni.sh')
|
||||||
GET_USER = os.path.join(SCRIPT_DIR, 'hysteria2', 'get_user.sh')
|
GET_USER = os.path.join(SCRIPT_DIR, 'hysteria2', 'get_user.sh')
|
||||||
ADD_USER = os.path.join(SCRIPT_DIR, 'hysteria2', 'add_user.sh')
|
ADD_USER = os.path.join(SCRIPT_DIR, 'hysteria2', 'add_user.sh')
|
||||||
EDIT_USER = os.path.join(SCRIPT_DIR, 'hysteria2', 'edit_user.sh')
|
EDIT_USER = os.path.join(SCRIPT_DIR, 'hysteria2', 'edit_user.sh')
|
||||||
@ -74,9 +75,13 @@ def cli():
|
|||||||
|
|
||||||
|
|
||||||
@cli.command('install-hysteria2')
|
@cli.command('install-hysteria2')
|
||||||
@click.option('--port', '-p', required=True, help='New port for Hysteria2', type=int, callback=validator.validate_port)
|
@click.option('--port', '-p', required=True, help='Port for Hysteria2', type=int, callback=validator.validate_port)
|
||||||
def install_hysteria2(port: int):
|
@click.option('--sni', '-s', required=False, default='bts.com', help='SNI for Hysteria2 (default: bts.com)', type=str)
|
||||||
run_cmd(['bash', Command.INSTALL_HYSTERIA2.value, str(port)])
|
def install_hysteria2(port: int, sni: str):
|
||||||
|
"""
|
||||||
|
Installs Hysteria2 on the given port and uses the provided or default SNI value.
|
||||||
|
"""
|
||||||
|
run_cmd(['bash', Command.INSTALL_HYSTERIA2.value, str(port), sni])
|
||||||
|
|
||||||
|
|
||||||
@cli.command('uninstall-hysteria2')
|
@cli.command('uninstall-hysteria2')
|
||||||
@ -99,6 +104,11 @@ def restart_hysteria2():
|
|||||||
def change_hysteria2_port(port: int):
|
def change_hysteria2_port(port: int):
|
||||||
run_cmd(['bash', Command.CHANGE_PORT_HYSTERIA2.value, str(port)])
|
run_cmd(['bash', Command.CHANGE_PORT_HYSTERIA2.value, str(port)])
|
||||||
|
|
||||||
|
@cli.command('change-hysteria2-sni')
|
||||||
|
@click.option('--sni', '-s', required=True, help='New SNI for Hysteria2', type=str)
|
||||||
|
def change_hysteria2_sni(sni: str):
|
||||||
|
run_cmd(['bash', Command.CHANGE_SNI_HYSTERIA2.value, sni])
|
||||||
|
|
||||||
@cli.command('get-user')
|
@cli.command('get-user')
|
||||||
@click.option('--username', '-u', required=True, help='Username for the user to get', type=str)
|
@click.option('--username', '-u', required=True, help='Username for the user to get', type=str)
|
||||||
def get_user(username: str):
|
def get_user(username: str):
|
||||||
|
|||||||
@ -1,19 +1,15 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Source the path.sh script to load the CONFIG_FILE variable
|
|
||||||
source /etc/hysteria/core/scripts/path.sh
|
source /etc/hysteria/core/scripts/path.sh
|
||||||
|
|
||||||
# Function to update port number in configuration
|
|
||||||
update_port() {
|
update_port() {
|
||||||
local port=$1
|
local port=$1
|
||||||
|
|
||||||
# Validate the port number
|
|
||||||
if ! [[ "$port" =~ ^[0-9]+$ ]] || [ "$port" -lt 1 ] || [ "$port" -gt 65535 ]; then
|
if ! [[ "$port" =~ ^[0-9]+$ ]] || [ "$port" -lt 1 ] || [ "$port" -gt 65535 ]; then
|
||||||
echo "Invalid port number. Please enter a number between 1 and 65535."
|
echo "Invalid port number. Please enter a number between 1 and 65535."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if the config file exists and update the port number
|
|
||||||
if [ -f "$CONFIG_FILE" ]; then
|
if [ -f "$CONFIG_FILE" ]; then
|
||||||
jq --arg port "$port" '.listen = ":" + $port' "$CONFIG_FILE" > "${CONFIG_FILE}.temp" && mv "${CONFIG_FILE}.temp" "$CONFIG_FILE"
|
jq --arg port "$port" '.listen = ":" + $port' "$CONFIG_FILE" > "${CONFIG_FILE}.temp" && mv "${CONFIG_FILE}.temp" "$CONFIG_FILE"
|
||||||
python3 "$CLI_PATH" restart-hysteria2 > /dev/null 2>&1
|
python3 "$CLI_PATH" restart-hysteria2 > /dev/null 2>&1
|
||||||
|
|||||||
63
core/scripts/hysteria2/change_sni.sh
Normal file
63
core/scripts/hysteria2/change_sni.sh
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Source the necessary paths
|
||||||
|
source /etc/hysteria/core/scripts/path.sh
|
||||||
|
|
||||||
|
update_sni() {
|
||||||
|
local sni=$1
|
||||||
|
|
||||||
|
if [ -z "$sni" ]; then
|
||||||
|
echo "Invalid SNI. Please provide a valid SNI."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd /etc/hysteria/ || exit
|
||||||
|
rm -f ca.key ca.crt
|
||||||
|
|
||||||
|
echo "Generating CA key and certificate for SNI: $sni ..."
|
||||||
|
openssl ecparam -genkey -name prime256v1 -out ca.key >/dev/null 2>&1
|
||||||
|
openssl req -new -x509 -days 36500 -key ca.key -out ca.crt -subj "/CN=$sni" >/dev/null 2>&1
|
||||||
|
chown hysteria:hysteria /etc/hysteria/ca.key /etc/hysteria/ca.crt
|
||||||
|
chmod 640 /etc/hysteria/ca.key /etc/hysteria/ca.crt
|
||||||
|
fingerprint=$(openssl x509 -noout -fingerprint -sha256 -inform pem -in ca.crt | sed 's/.*=//;s/://g')
|
||||||
|
|
||||||
|
sha256=$(python3 - <<EOF
|
||||||
|
import base64
|
||||||
|
import binascii
|
||||||
|
|
||||||
|
# Hexadecimal string
|
||||||
|
hex_string = "$fingerprint"
|
||||||
|
|
||||||
|
# Convert hex to binary
|
||||||
|
binary_data = binascii.unhexlify(hex_string)
|
||||||
|
|
||||||
|
# Encode binary data to base64
|
||||||
|
base64_encoded = base64.b64encode(binary_data).decode('utf-8')
|
||||||
|
|
||||||
|
# Print the result prefixed with 'sha256/'
|
||||||
|
print('sha256/' + base64_encoded)
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
echo "SHA-256 fingerprint generated: $sha256"
|
||||||
|
|
||||||
|
if [ -f "$CONFIG_FILE" ]; then
|
||||||
|
jq --arg sha256 "$sha256" '.tls.pinSHA256 = $sha256' "$CONFIG_FILE" > "${CONFIG_FILE}.temp" && mv "${CONFIG_FILE}.temp" "$CONFIG_FILE"
|
||||||
|
echo "SHA-256 updated successfully in $CONFIG_FILE"
|
||||||
|
else
|
||||||
|
echo "Error: Config file $CONFIG_FILE not found."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f "$CONFIG_ENV" ]; then
|
||||||
|
sed -i "s/^SNI=.*/SNI=$sni/" "$CONFIG_ENV"
|
||||||
|
echo "SNI updated successfully in .config.env"
|
||||||
|
else
|
||||||
|
echo "SNI=$sni" > "$CONFIG_ENV"
|
||||||
|
echo "Created .config.env with new SNI."
|
||||||
|
fi
|
||||||
|
|
||||||
|
python3 "$CLI_PATH" restart-hysteria2 > /dev/null 2>&1
|
||||||
|
echo "Hysteria2 restarted successfully with new SNI: $sni."
|
||||||
|
}
|
||||||
|
|
||||||
|
update_sni "$1"
|
||||||
@ -14,7 +14,7 @@ install_hysteria() {
|
|||||||
|
|
||||||
echo "Generating CA key and certificate..."
|
echo "Generating CA key and certificate..."
|
||||||
openssl ecparam -genkey -name prime256v1 -out ca.key >/dev/null 2>&1
|
openssl ecparam -genkey -name prime256v1 -out ca.key >/dev/null 2>&1
|
||||||
openssl req -new -x509 -days 36500 -key ca.key -out ca.crt -subj "/CN=bts.com" >/dev/null 2>&1
|
openssl req -new -x509 -days 36500 -key ca.key -out ca.crt -subj "/CN=$sni" >/dev/null 2>&1
|
||||||
echo "Downloading geo data..."
|
echo "Downloading geo data..."
|
||||||
wget -O /etc/hysteria/geosite.dat https://raw.githubusercontent.com/Chocolate4U/Iran-v2ray-rules/release/geosite.dat >/dev/null 2>&1
|
wget -O /etc/hysteria/geosite.dat https://raw.githubusercontent.com/Chocolate4U/Iran-v2ray-rules/release/geosite.dat >/dev/null 2>&1
|
||||||
wget -O /etc/hysteria/geoip.dat https://raw.githubusercontent.com/Chocolate4U/Iran-v2ray-rules/release/geoip.dat >/dev/null 2>&1
|
wget -O /etc/hysteria/geoip.dat https://raw.githubusercontent.com/Chocolate4U/Iran-v2ray-rules/release/geoip.dat >/dev/null 2>&1
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
source /etc/hysteria/core/scripts/path.sh
|
source /etc/hysteria/core/scripts/path.sh
|
||||||
|
source /etc/hysteria/core/scripts/utils.sh
|
||||||
|
|
||||||
get_singbox_domain_and_port() {
|
get_singbox_domain_and_port() {
|
||||||
if [ -f "$SINGBOX_ENV" ]; then
|
if [ -f "$SINGBOX_ENV" ]; then
|
||||||
@ -22,6 +23,8 @@ show_uri() {
|
|||||||
local show_all=false
|
local show_all=false
|
||||||
local generate_singbox=false
|
local generate_singbox=false
|
||||||
|
|
||||||
|
load_hysteria2_env
|
||||||
|
|
||||||
while [[ "$#" -gt 0 ]]; do
|
while [[ "$#" -gt 0 ]]; do
|
||||||
case $1 in
|
case $1 in
|
||||||
-u|--username) username="$2"; shift ;;
|
-u|--username) username="$2"; shift ;;
|
||||||
@ -49,9 +52,9 @@ show_uri() {
|
|||||||
local ip_version=$1
|
local ip_version=$1
|
||||||
local ip=$2
|
local ip=$2
|
||||||
if [ "$ip_version" -eq 4 ]; then
|
if [ "$ip_version" -eq 4 ]; then
|
||||||
echo "hy2://$username%3A$authpassword@$ip:$port?obfs=salamander&obfs-password=$obfspassword&pinSHA256=$sha256&insecure=1&sni=bts.com#$username-IPv4"
|
echo "hy2://$username%3A$authpassword@$ip:$port?obfs=salamander&obfs-password=$obfspassword&pinSHA256=$sha256&insecure=1&sni=$SNI#$username-IPv4"
|
||||||
elif [ "$ip_version" -eq 6 ]; then
|
elif [ "$ip_version" -eq 6 ]; then
|
||||||
echo "hy2://$username%3A$authpassword@[$ip]:$port?obfs=salamander&obfs-password=$obfspassword&pinSHA256=$sha256&insecure=1&sni=bts.com#$username-IPv6"
|
echo "hy2://$username%3A$authpassword@[$ip]:$port?obfs=salamander&obfs-password=$obfspassword&pinSHA256=$sha256&insecure=1&sni=$SNI#$username-IPv6"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,4 +115,4 @@ show_uri() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
show_uri "$@"
|
show_uri "$@"
|
||||||
@ -2,6 +2,7 @@ CLI_PATH="/etc/hysteria/core/cli.py"
|
|||||||
USERS_FILE="/etc/hysteria/users.json"
|
USERS_FILE="/etc/hysteria/users.json"
|
||||||
TRAFFIC_FILE="/etc/hysteria/traffic_data.json"
|
TRAFFIC_FILE="/etc/hysteria/traffic_data.json"
|
||||||
CONFIG_FILE="/etc/hysteria/config.json"
|
CONFIG_FILE="/etc/hysteria/config.json"
|
||||||
|
CONFIG_ENV="/etc/hysteria/.configs.env"
|
||||||
TELEGRAM_ENV="/etc/hysteria/core/scripts/telegrambot/.env"
|
TELEGRAM_ENV="/etc/hysteria/core/scripts/telegrambot/.env"
|
||||||
SINGBOX_ENV="/etc/hysteria/core/scripts/singbox/.env"
|
SINGBOX_ENV="/etc/hysteria/core/scripts/singbox/.env"
|
||||||
ONLINE_API_URL="http://127.0.0.1:25413/online"
|
ONLINE_API_URL="http://127.0.0.1:25413/online"
|
||||||
|
|||||||
@ -96,7 +96,7 @@
|
|||||||
"password": "{username}:{password}",
|
"password": "{username}:{password}",
|
||||||
"tls": {
|
"tls": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"server_name": "bts.com",
|
"server_name": "{sni}",
|
||||||
"insecure": true
|
"insecure": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -18,6 +18,20 @@ CERTFILE = os.getenv('HYSTERIA_CERTFILE')
|
|||||||
KEYFILE = os.getenv('HYSTERIA_KEYFILE')
|
KEYFILE = os.getenv('HYSTERIA_KEYFILE')
|
||||||
PORT = int(os.getenv('HYSTERIA_PORT', '3324'))
|
PORT = int(os.getenv('HYSTERIA_PORT', '3324'))
|
||||||
|
|
||||||
|
def load_sni_from_env():
|
||||||
|
sni = "bts.com"
|
||||||
|
try:
|
||||||
|
with open('/etc/hysteria/.configs.env', 'r') as env_file:
|
||||||
|
for line in env_file:
|
||||||
|
if line.startswith('SNI='):
|
||||||
|
sni = line.strip().split('=')[1]
|
||||||
|
break
|
||||||
|
except FileNotFoundError:
|
||||||
|
print("Warning: /etc/hysteria/.configs.env not found. Using default SNI.")
|
||||||
|
return sni
|
||||||
|
|
||||||
|
SNI = load_sni_from_env()
|
||||||
|
|
||||||
RATE_LIMIT = 100
|
RATE_LIMIT = 100
|
||||||
RATE_LIMIT_WINDOW = 60
|
RATE_LIMIT_WINDOW = 60
|
||||||
|
|
||||||
@ -102,8 +116,7 @@ def generate_singbox_config(username, ip_version, fragment):
|
|||||||
config['outbounds'][2]['obfs']['password'] = components['obfs_password']
|
config['outbounds'][2]['obfs']['password'] = components['obfs_password']
|
||||||
config['outbounds'][2]['password'] = f"{username}:{components['password']}"
|
config['outbounds'][2]['password'] = f"{username}:{components['password']}"
|
||||||
|
|
||||||
if fragment:
|
config['outbounds'][2]['tls']['server_name'] = fragment if fragment else SNI
|
||||||
config['outbounds'][2]['tls']['server_name'] = fragment
|
|
||||||
|
|
||||||
config['outbounds'][0]['outbounds'] = ["auto", hysteria_tag]
|
config['outbounds'][0]['outbounds'] = ["auto", hysteria_tag]
|
||||||
config['outbounds'][1]['outbounds'] = [hysteria_tag]
|
config['outbounds'][1]['outbounds'] = [hysteria_tag]
|
||||||
|
|||||||
@ -9,11 +9,9 @@ define_colors() {
|
|||||||
NC='\033[0m' # No Color
|
NC='\033[0m' # No Color
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to get system information
|
|
||||||
get_system_info() {
|
get_system_info() {
|
||||||
OS=$(lsb_release -d | awk -F'\t' '{print $2}')
|
OS=$(lsb_release -d | awk -F'\t' '{print $2}')
|
||||||
ARCH=$(uname -m)
|
ARCH=$(uname -m)
|
||||||
# Fetching detailed IP information in JSON format
|
|
||||||
IP_API_DATA=$(curl -s https://ipapi.co/json/ -4)
|
IP_API_DATA=$(curl -s https://ipapi.co/json/ -4)
|
||||||
ISP=$(echo "$IP_API_DATA" | jq -r '.org')
|
ISP=$(echo "$IP_API_DATA" | jq -r '.org')
|
||||||
IP=$(echo "$IP_API_DATA" | jq -r '.ip')
|
IP=$(echo "$IP_API_DATA" | jq -r '.ip')
|
||||||
@ -53,3 +51,13 @@ check_version() {
|
|||||||
echo -e "${cyan}Bug squashing party!${yellow} Update for the best invitation.${NC}"
|
echo -e "${cyan}Bug squashing party!${yellow} Update for the best invitation.${NC}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
load_hysteria2_env() {
|
||||||
|
if [ -f /etc/hysteria/.configs.env ]; then
|
||||||
|
export $(grep -v '^#' /etc/hysteria/.configs.env | xargs)
|
||||||
|
else
|
||||||
|
echo "Error: configs.env file not found. Using default SNI 'bts.com'."
|
||||||
|
SNI="bts.com"
|
||||||
|
fi
|
||||||
|
}
|
||||||
41
menu.sh
41
menu.sh
@ -12,7 +12,10 @@ hysteria2_install_handler() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
read -p "Enter the new port number you want to use: " port
|
read -p "Enter the SNI (default: bts.com): " sni
|
||||||
|
sni=${sni:-bts.com}
|
||||||
|
|
||||||
|
read -p "Enter the port number you want to use: " port
|
||||||
if ! [[ "$port" =~ ^[0-9]+$ ]] || [ "$port" -lt 1 ] || [ "$port" -gt 65535 ]; then
|
if ! [[ "$port" =~ ^[0-9]+$ ]] || [ "$port" -lt 1 ] || [ "$port" -gt 65535 ]; then
|
||||||
echo "Invalid port number. Please enter a number between 1 and 65535."
|
echo "Invalid port number. Please enter a number between 1 and 65535."
|
||||||
else
|
else
|
||||||
@ -20,7 +23,12 @@ hysteria2_install_handler() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
python3 $CLI_PATH install-hysteria2 --port "$port"
|
|
||||||
|
python3 $CLI_PATH install-hysteria2 --port "$port" --sni "$sni"
|
||||||
|
|
||||||
|
cat <<EOF > /etc/hysteria/.configs.env
|
||||||
|
SNI=$sni
|
||||||
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
hysteria2_add_user_handler() {
|
hysteria2_add_user_handler() {
|
||||||
@ -227,6 +235,25 @@ hysteria2_change_port_handler() {
|
|||||||
python3 $CLI_PATH change-hysteria2-port --port "$port"
|
python3 $CLI_PATH change-hysteria2-port --port "$port"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hysteria2_change_sni_handler() {
|
||||||
|
while true; do
|
||||||
|
read -p "Enter the new SNI (e.g., example.com): " sni
|
||||||
|
|
||||||
|
if [[ "$sni" =~ ^[a-zA-Z0-9.]+$ ]]; then
|
||||||
|
break
|
||||||
|
else
|
||||||
|
echo -e "${red}Error:${NC} SNI can only contain letters, numbers, and dots."
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
python3 $CLI_PATH change-hysteria2-sni --sni "$sni"
|
||||||
|
|
||||||
|
if systemctl is-active --quiet singbox.service; then
|
||||||
|
systemctl restart singbox.service
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
hysteria_upgrade(){
|
hysteria_upgrade(){
|
||||||
bash <(curl https://raw.githubusercontent.com/ReturnFI/Hysteria2/main/upgrade.sh)
|
bash <(curl https://raw.githubusercontent.com/ReturnFI/Hysteria2/main/upgrade.sh)
|
||||||
}
|
}
|
||||||
@ -497,8 +524,9 @@ display_advance_menu() {
|
|||||||
echo -e "${green}[5] ${NC}↝ Telegram Bot"
|
echo -e "${green}[5] ${NC}↝ Telegram Bot"
|
||||||
echo -e "${green}[6] ${NC}↝ SingBox SubLink"
|
echo -e "${green}[6] ${NC}↝ SingBox SubLink"
|
||||||
echo -e "${cyan}[7] ${NC}↝ Change Port Hysteria2"
|
echo -e "${cyan}[7] ${NC}↝ Change Port Hysteria2"
|
||||||
echo -e "${cyan}[8] ${NC}↝ Update Core Hysteria2"
|
echo -e "${cyan}[8] ${NC}↝ Change SNI Hysteria2"
|
||||||
echo -e "${red}[9] ${NC}↝ Uninstall Hysteria2"
|
echo -e "${cyan}[9] ${NC}↝ Update Core Hysteria2"
|
||||||
|
echo -e "${red}[10] ${NC}↝ Uninstall Hysteria2"
|
||||||
echo -e "${red}[0] ${NC}↝ Back to Main Menu"
|
echo -e "${red}[0] ${NC}↝ Back to Main Menu"
|
||||||
echo -e "${LPurple}◇──────────────────────────────────────────────────────────────────────◇${NC}"
|
echo -e "${LPurple}◇──────────────────────────────────────────────────────────────────────◇${NC}"
|
||||||
echo -ne "${yellow}➜ Enter your option: ${NC}"
|
echo -ne "${yellow}➜ Enter your option: ${NC}"
|
||||||
@ -519,8 +547,9 @@ advance_menu() {
|
|||||||
5) telegram_bot_handler ;;
|
5) telegram_bot_handler ;;
|
||||||
6) singbox_handler ;;
|
6) singbox_handler ;;
|
||||||
7) hysteria2_change_port_handler ;;
|
7) hysteria2_change_port_handler ;;
|
||||||
8) python3 $CLI_PATH update-hysteria2 ;;
|
8) hysteria2_change_sni_handler ;;
|
||||||
9) python3 $CLI_PATH uninstall-hysteria2 ;;
|
9) python3 $CLI_PATH update-hysteria2 ;;
|
||||||
|
10) python3 $CLI_PATH uninstall-hysteria2 ;;
|
||||||
0) return ;;
|
0) return ;;
|
||||||
*) echo "Invalid option. Please try again." ;;
|
*) echo "Invalid option. Please try again." ;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
@ -49,6 +49,13 @@ else
|
|||||||
echo "No traffic_data.json found to merge."
|
echo "No traffic_data.json found to merge."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! -f /etc/hysteria/.configs.env ]; then
|
||||||
|
echo ".configs.env not found, creating it with default SNI=bts.com"
|
||||||
|
echo "SNI=bts.com" > /etc/hysteria/.configs.env
|
||||||
|
else
|
||||||
|
echo ".configs.env already exists."
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Setting ownership and permissions"
|
echo "Setting ownership and permissions"
|
||||||
chown hysteria:hysteria /etc/hysteria/ca.key /etc/hysteria/ca.crt
|
chown hysteria:hysteria /etc/hysteria/ca.key /etc/hysteria/ca.crt
|
||||||
chmod 640 /etc/hysteria/ca.key /etc/hysteria/ca.crt
|
chmod 640 /etc/hysteria/ca.key /etc/hysteria/ca.crt
|
||||||
|
|||||||
Reference in New Issue
Block a user