Skip to content

Commit

Permalink
Merge pull request Snawoot#4 from Snawoot/fix_escaping
Browse files Browse the repository at this point in the history
escape password for json config
  • Loading branch information
Snawoot authored May 6, 2021
2 parents 0bc6ae6 + b628230 commit 9f55cab
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
6 changes: 1 addition & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ COPY entrypoint.sh /entrypoint.sh
ARG DEBIAN_FRONTEND=noninteractive
RUN set -ex\
&& apt update -y \
&& apt upgrade -y \
&& apt install -y wget unzip qrencode \
&& apt install -y shadowsocks-libev \
&& apt install -y nginx-light \
&& apt autoremove -y \
&& apt install -y wget qrencode shadowsocks-libev nginx-light jq \
&& apt clean -y \
&& chmod +x /entrypoint.sh \
&& mkdir -p /etc/shadowsocks-libev /v2raybin /wwwroot \
Expand Down
2 changes: 1 addition & 1 deletion conf/shadowsocks-libev_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cat <<EOF
{
"server":"127.0.0.1",
"server_port":"2333",
"password":"${PASSWORD}",
"password":${PASSWORD_JSON},
"timeout":300,
"method":"${ENCRYPT}",
"mode": "tcp_only",
Expand Down
2 changes: 2 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ if [[ -z "${PASSWORD}" ]]; then
fi
echo ${PASSWORD}

export PASSWORD_JSON="$(echo -n "$PASSWORD" | jq -Rc)"

if [[ -z "${ENCRYPT}" ]]; then
export ENCRYPT="chacha20-ietf-poly1305"
fi
Expand Down

0 comments on commit 9f55cab

Please sign in to comment.