File tree Expand file tree Collapse file tree 3 files changed +29
-4
lines changed Expand file tree Collapse file tree 3 files changed +29
-4
lines changed Original file line number Diff line number Diff line change
1
+ # cloud-config
2
+ package_upgrade : true
3
+ packages :
4
+ - apt-transport-https
5
+ - ca-certificates
6
+ - curl
7
+ - wget
8
+ - gnupg-agent
9
+ - software-properties-common
10
+ - git
11
+ runcmd :
12
+ - cd /opt
13
+ - git clone https://github.com/hiddify/hiddify-config/
14
+ - cd hiddify-config
15
+ - echo "USER_SECRET=44da16ea20ff4bac92afae43ef97f067" >config.env
16
+ - echo "MAIN_DOMAIN=example.com" >>config.env
17
+ - bash install.sh
18
+
19
+ power_state :
20
+ mode : reboot
21
+ message : please open https://example.com/44da16ea20ff4bac92afae43ef97f067
Original file line number Diff line number Diff line change 4
4
USER_SECRET = # 32 hex secret for user
5
5
MAIN_DOMAIN = # a subdomain or main domain that is pointed to your server
6
6
7
- CDN_NAME = ar # ar=arvancloud or cf=cloudflare ; if your are not using cdn enter 'ar'
7
+
8
+ # Optional:
8
9
TELEGRAM_AD_TAG = # AD TAG for telegram proxy
Original file line number Diff line number Diff line change @@ -55,9 +55,12 @@ function check_for_env() {
55
55
56
56
random_secret=$( hexdump -vn16 -e' 4/4 "%08X" 1 "\n"' /dev/urandom)
57
57
replace_empty_env USER_SECRET " please enter 32 char user secret" $random_secret " ^([0-9A-Fa-f]{32})$"
58
- replace_empty_env MAIN_DOMAIN " please enter valid domain name to use " " www.example.com" " ^([A-Za-z0-9\.]+\.[a-zA-Z]{2,})$"
59
- DOMAIN_IP=$( dig +short -t a $MAIN_DOMAIN .)
60
58
SERVER_IP=$( curl -Lso- https://api.ipify.org)
59
+ replace_empty_env MAIN_DOMAIN " please enter valid domain name to use " " $SERVER_IP .nip.io" " ^([A-Za-z0-9\.]+\.[a-zA-Z]{2,})$"
60
+
61
+
62
+ DOMAIN_IP=$( dig +short -t a $MAIN_DOMAIN .)
63
+
61
64
62
65
echo " resolving domain $MAIN_DOMAIN -> IP= $DOMAIN_IP ServerIP-> $SERVER_IP "
63
66
if [[ $SERVER_IP != $DOMAIN_IP ]]; then
@@ -85,7 +88,7 @@ function replace_empty_env() {
85
88
echo " Enter $DEFAULT (default value='$DEFAULT ' -> to confirm enter)"
86
89
fi
87
90
88
- read -p " > " RESPONSE
91
+ # read -p "> " RESPONSE
89
92
if [[ -z " $RESPONSE " ]]; then
90
93
RESPONSE=$DEFAULT
91
94
fi
You can’t perform that action at this time.
0 commit comments