Skip to content

Commit 9be0035

Browse files
committed
fix alibaba cloud installation issue
1 parent 645ecd8 commit 9be0035

1 file changed

Lines changed: 37 additions & 10 deletions

File tree

‎cyberpanel.sh‎

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,20 @@ sed -i 's|git clone https://github.com/usmannasir/cyberpanel|echo downloaded|g'
139139
#change to CDN first, regardless country
140140
sed -i 's|http://|https://|g' install.py
141141

142-
if ! grep -q "1.1.1.1" /etc/resolv.conf ; then
143-
echo -e "\nnameserver 1.1.1.1" >> /etc/resolv.conf
144-
fi
145-
if ! grep -q "8.8.8.8" /etc/resolv.conf ; then
146-
echo -e "\nnameserver 8.8.8.8" >> /etc/resolv.conf
142+
if [[ $PROVIDER == "Alibaba Cloud" ]] ; then
143+
if ! grep -q "100.100.2.136" /etc/resolv.conf ; then
144+
echo -e "\nnameserver 100.100.2.136" >> /etc/resolv.conf
145+
fi
146+
if ! grep -q "100.100.2.138" /etc/resolv.conf ; then
147+
echo -e "\nnameserver 100.100.2.138" >> /etc/resolv.conf
148+
fi
149+
else
150+
if ! grep -q "1.1.1.1" /etc/resolv.conf ; then
151+
echo -e "\nnameserver 1.1.1.1" >> /etc/resolv.conf
152+
fi
153+
if ! grep -q "8.8.8.8" /etc/resolv.conf ; then
154+
echo -e "\nnameserver 8.8.8.8" >> /etc/resolv.conf
155+
fi
147156
fi
148157
cp /etc/resolv.conf /etc/resolv.conf-tmp
149158

@@ -162,9 +171,11 @@ if [[ $PROVIDER == "Alibaba Cloud" ]] && [[ $SERVER_OS == "Ubuntu" ]] ; then
162171
mkdir /root/.config/pip
163172
cat << EOF > /root/.config/pip/pip.conf
164173
[global]
165-
index-url = https://mirrors.aliyun.com/pypi/simple/
174+
index-url = https://pypi.python.org/simple/
175+
[install]
176+
trusted-host=pypi.python.org
166177
EOF
167-
echo -e "\nSet to Aliyun pip repo..."
178+
echo -e "\nSet pip repo..."
168179
fi
169180
#seems Alibaba cloud , other than CN , also requires change on ubuntu.
170181

@@ -203,7 +214,9 @@ gpgcheck = 1" > MariaDB.repo
203214
mkdir /root/.config/pip
204215
cat << EOF > /root/.config/pip/pip.conf
205216
[global]
206-
index-url = https://mirrors.aliyun.com/pypi/simple/
217+
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
218+
[install]
219+
trusted-host=pypi.tuna.tsinghua.edu.cn
207220
EOF
208221
echo -e "\nSet to Aliyun pip repo..."
209222
cat << EOF > composer.sh
@@ -248,12 +261,14 @@ EOF
248261
if [[ $SERVER_OS == "Ubuntu" ]] ; then
249262
echo $'\n89.208.248.38 rpms.litespeedtech.com\n' >> /etc/hosts
250263
echo -e "Mirror server set..."
251-
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
264+
pip config set global.index-url https://pypi.python.org/simple/
252265
mkdir /root/.config
253266
mkdir /root/.config/pip
254267
cat << EOF > /root/.config/pip/pip.conf
255268
[global]
256-
index-url = https://mirrors.aliyun.com/pypi/simple/
269+
index-url = https://pypi.python.org/simple/
270+
[install]
271+
trusted-host=pypi.python.org
257272
EOF
258273
echo -e "\nSet to Aliyun pip repo..."
259274
if [[ $PROVIDER == "Tencent Cloud" ]] ; then
@@ -549,6 +564,8 @@ if [[ $SERVER_OS == "CentOS" ]] ; then
549564
fi
550565

551566
if [[ $SERVER_OS == "Ubuntu" ]] ; then
567+
systemctl stop redis-server
568+
rm -f /var/run/redis/redis-server.pid
552569
systemctl enable redis-server
553570
systemctl start redis-server
554571
fi
@@ -1101,6 +1118,16 @@ fi
11011118
if grep "CyberPanel installation successfully completed" /var/log/installLogs.txt > /dev/null; then
11021119

11031120
if [[ $DEV == "ON" ]] ; then
1121+
1122+
if [[ $PROVIDER == "Alibaba Cloud" ]] && [[ $SERVER_OS == "Ubuntu" ]] ; then
1123+
cat << EOF > /root/.config/pip/pip.conf
1124+
[global]
1125+
index-url = https://pypi.python.org/simple/
1126+
[install]
1127+
trusted-host=pypi.python.org
1128+
EOF
1129+
fi
1130+
11041131
virtualenv -p /usr/bin/python3 /usr/local/CyberCP
11051132
source /usr/local/CyberCP/bin/activate
11061133
wget -O requirements.txt https://raw.githubusercontent.com/usmannasir/cyberpanel/$BRANCH_NAME/requirments.txt

0 commit comments

Comments
 (0)