Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Revert "allow full domain name to be specified" #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},

"AppName": {
"description": "App Name filled in at the top (or even full domain if there is a custom one) to generate the configuration and QR code. If you don’t want to generate it, enter no",
"description": "App Name filled in at the top to generate the configuration and QR code. If you don’t want to generate it, enter no",
"value": "no"
},

Expand Down
13 changes: 2 additions & 11 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,6 @@ if [[ -z "${QR_Path}" ]]; then
fi
echo ${QR_Path}

case "$AppName" in
*.*)
export DOMAIN="$AppName"
;;
*)
export DOMAIN="$AppName.herokuapp.com"
;;
esac

bash /conf/shadowsocks-libev_config.json > /etc/shadowsocks-libev/config.json
echo /etc/shadowsocks-libev/config.json
cat /etc/shadowsocks-libev/config.json
Expand All @@ -43,8 +34,8 @@ if [ "$AppName" = "no" ]; then
echo "Do not generate QR-code"
else
[ ! -d /wwwroot/${QR_Path} ] && mkdir /wwwroot/${QR_Path}
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}"
plugin=$(echo -n "v2ray;path=/${V2_Path};host=${AppName}.herokuapp.com;tls" | sed -e 's/\//%2F/g' -e 's/=/%3D/g' -e 's/;/%3B/g')
ss="ss://$(echo -n ${ENCRYPT}:${PASSWORD} | base64 -w 0)@${AppName}.herokuapp.com:443?plugin=${plugin}"
echo "${ss}" | tr -d '\n' > /wwwroot/${QR_Path}/index.html
echo -n "${ss}" | qrencode -s 6 -o /wwwroot/${QR_Path}/vpn.png
fi
Expand Down