From 32a56708cc4abd7ca693607302264de67f9587d1 Mon Sep 17 00:00:00 2001 From: Teddysun Date: Sat, 16 Sep 2023 14:57:18 +0900 Subject: [PATCH] Update Dockerfile.architecture --- docker/hysteria/Dockerfile.architecture | 6 +++--- docker/hysteria/README.md | 27 ++++++++++++++++--------- docker/hysteria/client.json | 13 ------------ docker/hysteria/client.yaml | 9 +++++++++ docker/hysteria/server.json | 6 ------ docker/hysteria/server.yaml | 15 ++++++++++++++ 6 files changed, 45 insertions(+), 31 deletions(-) delete mode 100644 docker/hysteria/client.json create mode 100644 docker/hysteria/client.yaml delete mode 100644 docker/hysteria/server.json create mode 100644 docker/hysteria/server.yaml diff --git a/docker/hysteria/Dockerfile.architecture b/docker/hysteria/Dockerfile.architecture index 26eb882..5746238 100644 --- a/docker/hysteria/Dockerfile.architecture +++ b/docker/hysteria/Dockerfile.architecture @@ -1,5 +1,5 @@ # Dockerfile for hysteria based alpine -# Copyright (C) 2022 Teddysun +# Copyright (C) 2023 Teddysun # Reference URL: # https://github.com/HyNetwork/hysteria @@ -9,7 +9,7 @@ LABEL maintainer="Teddysun " ARG TARGETPLATFORM WORKDIR /root COPY hysteria.sh /root/hysteria.sh -COPY server.json /etc/hysteria/server.json +COPY server.yaml /etc/hysteria/server.yaml RUN set -ex \ && apk add --no-cache bash tzdata ca-certificates \ && chmod +x /root/hysteria.sh \ @@ -18,4 +18,4 @@ RUN set -ex \ VOLUME /etc/hysteria ENV TZ=Asia/Shanghai -CMD [ "/usr/bin/hysteria", "server", "--config", "/etc/hysteria/server.json" ] +CMD [ "/usr/bin/hysteria", "server", "-c", "/etc/hysteria/server.yaml" ] diff --git a/docker/hysteria/README.md b/docker/hysteria/README.md index 765af9d..75f2a6e 100644 --- a/docker/hysteria/README.md +++ b/docker/hysteria/README.md @@ -22,21 +22,30 @@ It can be found at [Docker Hub][4]. ## Start a container -You **must create a configuration file** `/etc/hysteria/server.json` in host at first: +You **must create a configuration file** `/etc/hysteria/server.yaml` in host at first: ``` $ mkdir -p /etc/hysteria ``` -A sample in JSON like below: +A sample in yaml like below: ``` -{ - "listen": ":8998", - "cert": "/etc/hysteria/cert.crt", - "key": "/etc/hysteria/private.key", - "obfs": "dGVkZHlzdW4uY29tCg==" -} +listen: :8998 + +tls: + cert: /etc/hysteria/cert.crt + key: /etc/hysteria/private.key + +auth: + type: password + password: your_password + +resolver: + type: https + https: + addr: 8.8.8.8:443 + timeout: 10s ``` And put the `cert.crt`, `private.key` to the `/etc/hysteria/`. @@ -49,7 +58,7 @@ $ docker run -d -p 8998:8998 --name hysteria --restart=always -v /etc/hysteria:/ **Warning**: The port number must be same as configuration and opened in firewall. -[1]: https://github.com/HyNetwork/hysteria +[1]: https://github.com/apernet/hysteria [2]: https://docs.docker.com/ [3]: https://docs.docker.com/install/ [4]: https://hub.docker.com/r/teddysun/hysteria/ \ No newline at end of file diff --git a/docker/hysteria/client.json b/docker/hysteria/client.json deleted file mode 100644 index 7a6dfd5..0000000 --- a/docker/hysteria/client.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "server": "IP:8998", - "obfs": "dGVkZHlzdW4uY29tCg==", - "up_mbps": 200, - "down_mbps": 1000, - "insecure": true, - "socks5": { - "listen": "127.0.0.1:1080" - }, - "http": { - "listen": "127.0.0.1:1081" - } -} diff --git a/docker/hysteria/client.yaml b/docker/hysteria/client.yaml new file mode 100644 index 0000000..0309bfe --- /dev/null +++ b/docker/hysteria/client.yaml @@ -0,0 +1,9 @@ +server: "IP:8998" + +auth: your_password + +tls: + sni: www.example.com + +socks5: + listen: 127.0.0.1:1080 diff --git a/docker/hysteria/server.json b/docker/hysteria/server.json deleted file mode 100644 index cd401bd..0000000 --- a/docker/hysteria/server.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "listen": ":8998", - "cert": "/etc/hysteria/cert.crt", - "key": "/etc/hysteria/private.key", - "obfs": "dGVkZHlzdW4uY29tCg==" -} diff --git a/docker/hysteria/server.yaml b/docker/hysteria/server.yaml new file mode 100644 index 0000000..dbc3d3a --- /dev/null +++ b/docker/hysteria/server.yaml @@ -0,0 +1,15 @@ +listen: :8998 + +tls: + cert: /etc/hysteria/cert.crt + key: /etc/hysteria/private.key + +auth: + type: password + password: your_password + +resolver: + type: https + https: + addr: 8.8.8.8:443 + timeout: 10s