Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
aditya-shri committed Aug 28, 2022
1 parent dc2080b commit 1719020
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

if [[ -z "${PASSWORD}" ]]; then
PASSWORD="5c301bb8-6c77-41a0-a606-4ba11bbab084"
if [[ -z "${Password}" ]]; then
Password="5c301bb8-6c77-41a0-a606-4ba11bbab084"
fi
ENCRYPT="chacha20-ietf-poly1305"
QR_Path="/qr"
Expand All @@ -25,7 +25,7 @@ fi

# TODO: bug when PASSWORD contain '/'
sed -e "/^#/d"\
-e "s/\${PASSWORD}/${PASSWORD}/g"\
-e "s/\${PASSWORD}/${Password}/g"\
-e "s/\${ENCRYPT}/${ENCRYPT}/g"\
-e "s|\${V2_Path}|${V2_Path}|g"\
/conf/shadowsocks-libev_config.json > /etc/shadowsocks-libev/config.json
Expand All @@ -39,11 +39,11 @@ sed -e "/^#/d"\
-e "$s"\
/conf/nginx_ss.conf > /etc/nginx/conf.d/ss.conf

if [ "$Domain" = "no" ]; then
if [ "${Domain}" = "no" ]; then
echo "Aditya's Personal VPN"
else
plugin=$(echo -n "v2ray;path=${V2_Path};host=${Domain};tls" | sed -e 's/\//%2F/g' -e 's/=/%3D/g' -e 's/;/%3B/g')
ss="ss://$(echo -n ${ENCRYPT}:${PASSWORD} | base64 -w 0)@${Domain}:443?plugin=${plugin}"
ss="ss://$(echo -n ${ENCRYPT}:${Password} | base64 -w 0)@${Domain}:443?plugin=${plugin}"
echo "${ss}" | tr -d '\n' > /wwwroot/index.html
echo -n "${ss}" | qrencode -s 6 -o /wwwroot/vpn.png
fi
Expand Down

0 comments on commit 1719020

Please sign in to comment.