├── .github └── workflows │ └── docker_build.yml ├── Dockerfile ├── LICENSE ├── README.md └── entrypoint.sh /.github/workflows/docker_build.yml: -------------------------------------------------------------------------------- 1 | name: Publish Docker image 2 | on: 3 | workflow_dispatch: 4 | inputs: 5 | snell_server_version: 6 | description: 'snell server version, eg: 4.0.1' 7 | required: true 8 | push: 9 | tags: 10 | - "*" 11 | 12 | env: 13 | IMAGE_REPOSITORY: funnyzak/snell-server 14 | 15 | jobs: 16 | docker-release: 17 | name: Publish Docker images 18 | runs-on: ubuntu-latest 19 | timeout-minutes: 20 20 | steps: 21 | - name: Checkout 22 | uses: actions/checkout@v3 23 | - name: Get version from push tag 24 | if: github.event_name == 'push' 25 | run: | 26 | echo "VERSION=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV 27 | - name: Get version from workflow_dispatch 28 | if: github.event_name == 'workflow_dispatch' 29 | run: | 30 | echo "VERSION=${{ github.event.inputs.snell_server_version}}" >> $GITHUB_ENV 31 | - name: Set build date 32 | run: | 33 | echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV 34 | - name: Echo env 35 | run: | 36 | echo "VERSION=${{ env.VERSION }}" 37 | echo "BUILD_DATE=${{ env.BUILD_DATE }}" 38 | - name: Set up Docker Buildx 39 | uses: docker/setup-buildx-action@v3 40 | - name: Login to DockerHub 41 | uses: docker/login-action@v3 42 | with: 43 | username: ${{ secrets.DOCKER_USERNAME }} 44 | password: ${{ secrets.DOCKER_PASSWORD }} 45 | - name: Log in to ALIYUNCS 46 | uses: docker/login-action@v3 47 | with: 48 | registry: registry.cn-beijing.aliyuncs.com 49 | username: ${{ secrets.DOCKER_USERNAME }} 50 | password: ${{ secrets.DOCKER_ALIYUNCS_PASSWORD }} 51 | - name: Docker build and push 52 | uses: docker/build-push-action@v3 53 | with: 54 | context: . 55 | build-args: | 56 | BUILD_DATE=${{ env.BUILD_DATE }} 57 | SNELL_SERVER_VERSION=${{ env.VERSION }} 58 | push: true 59 | tags: | 60 | ${{ env.IMAGE_REPOSITORY }}:${{ env.VERSION }} 61 | ${{ env.IMAGE_REPOSITORY }}:latest 62 | registry.cn-beijing.aliyuncs.com/${{ env.IMAGE_REPOSITORY }}:${{ env.VERSION }} 63 | registry.cn-beijing.aliyuncs.com/${{ env.IMAGE_REPOSITORY }}:latest 64 | platforms: | 65 | linux/amd64 66 | linux/arm64 67 | linux/arm/v7 68 | linux/i386 69 | cache-from: type=gha 70 | cache-to: type=gha,mode=max 71 | 72 | push-message: 73 | name: Push message 74 | runs-on: ubuntu-latest 75 | needs: [docker-release] 76 | steps: 77 | - name: Push message 78 | uses: funnyzak/pushoo-action@main 79 | with: 80 | platforms: ifttt 81 | tokens: ${{ secrets.PUSH_TOKEN }} 82 | content: | 83 | # ${{ github.event.repository.name }} Docker Build Success 84 | ## trigger: ${{ github.event_name }} at ${{ github.event.head_commit.timestamp }} 85 | ## commit message: ${{ github.event.head_commit.message }} 86 | ## commit url: ${{ github.event.head_commit.url }} 87 | ## commit author: ${{ github.event.head_commit.author.name }} 88 | ## commit email: ${{ github.event.head_commit.author.email }} 89 | ## commit id: ${{ github.event.head_commit.id }} 90 | title: | 91 | ${{ github.repository }} ${{ github.event_name }} Message 92 | options: '{"bark": { "url": "https://github.com/${{github.repository}}" }}' 93 | debug: false 94 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM --platform=$BUILDPLATFORM debian:sid-slim 2 | 3 | ARG TARGETPLATFORM 4 | ARG BUILDPLATFORM 5 | ARG SNELL_SERVER_VERSION=4.0.1 6 | 7 | RUN apt-get update && \ 8 | apt-get install -y --no-install-recommends wget unzip && \ 9 | rm -rf /var/lib/apt/lists/* 10 | 11 | WORKDIR /app/ 12 | 13 | RUN case "${TARGETPLATFORM}" in \ 14 | "linux/amd64") wget --no-check-certificate -O snell.zip "https://dl.nssurge.com/snell/snell-server-v${SNELL_SERVER_VERSION}-linux-amd64.zip" ;; \ 15 | "linux/arm64") wget --no-check-certificate -O snell.zip "https://dl.nssurge.com/snell/snell-server-v${SNELL_SERVER_VERSION}-linux-aarch64.zip" ;; \ 16 | "linux/arm/v7") wget --no-check-certificate -O snell.zip "https://dl.nssurge.com/snell/snell-server-v${SNELL_SERVER_VERSION}-linux-armv7l.zip" ;; \ 17 | "linux/386") wget --no-check-certificate -O snell.zip "https://dl.nssurge.com/snell/snell-server-v${SNELL_SERVER_VERSION}-linux-i386.zip" ;; \ 18 | *) echo "unsupported platform: ${TARGETPLATFORM}"; exit 1 ;; \ 19 | esac 20 | 21 | COPY entrypoint.sh /app/ 22 | 23 | RUN if [ -f snell.zip ]; then unzip snell.zip && rm -f snell.zip; fi && \ 24 | chmod +x snell-server && \ 25 | chmod +x entrypoint.sh 26 | 27 | ENV LANG=C.UTF-8 28 | ENV TZ=Asia/Shanghai 29 | ENV PORT=6180 30 | ENV IPV6=false 31 | ENV PSK= 32 | 33 | LABEL version="${SNELL_SERVER_VERSION}" 34 | 35 | ENTRYPOINT ["/app/entrypoint.sh"] 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 [fullname] 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Snell Server 2 | 3 | > This repository is no longer maintained. The latest built images can be found in the [Docker Release](https://github.com/funnyzak/docker-release?tab=readme-ov-file#snell-server). You can [create a new issue](https://github.com/funnyzak/docker-release/issues) on the repository if you have any questions. 4 | 5 | [![Image Size](https://img.shields.io/docker/image-size/funnyzak/snell-server)](https://hub.docker.com/r/funnyzak/snell-server/) 6 | [![Docker Stars](https://img.shields.io/docker/stars/funnyzak/snell-server.svg?style=flat-square)](https://hub.docker.com/r/funnyzak/snell-server/) 7 | [![Docker Pulls](https://img.shields.io/docker/pulls/funnyzak/snell-server.svg?style=flat-square)](https://hub.docker.com/r/funnyzak/snell-server/) 8 | [![Docker Tags](https://img.shields.io/docker/v/funnyzak/snell-server?sort=semver&style=flat-square)](https://hub.docker.com/r/funnyzak/snell-server/) 9 | 10 | This image is built for [snell server](https://manual.nssurge.com/others/snell.html), which is a lean encrypted proxy protocol. If you want to use **Snell Client**, please download from [NSSurge](https://nssurge.com/). 11 | 12 | This image supports `linux/amd64`, `linux/arm64`, `linux/arm/v7` and `linux/386` architecture. The latest version is `v4.1.1`. 13 | 14 | > The latest surge-server version is v4, which is not compatible with the previous versions like before. Please upgrade both the client (Surge iOS & Surge Mac) and the server binary. 15 | 16 | ## Docker Pull 17 | 18 | ```bash 19 | docker pull funnyzak/snell-server 20 | # GHCR 21 | docker pull ghcr.io/funnyzak/snell-server 22 | # Aliyun 23 | docker pull registry.cn-beijing.aliyuncs.com/funnyzak/snell-server 24 | ``` 25 | 26 | ## Docker Run 27 | 28 | Your can run this image with the following command: 29 | 30 | ```bash 31 | # One line command 32 | docker run -d --name snell-server --restart always -p 12303:6180 -e PSK="5G0H4qdf32mEZx32t" funnyzak/snell-server 33 | 34 | # Or with environment variables 35 | docker run -d --name snell-server --restart always \ 36 | -e PSK="5G0H4qdf32mEZx32t" \ 37 | -e TZ="Asia/Shanghai" \ 38 | -e IPV6="false" \ 39 | -e PORT=6180 \ 40 | -p 12303:6180 funnyzak/snell-server:latest 41 | 42 | # Echo config file 43 | docker exec -it snell-server cat /etc/snell-server.conf 44 | ``` 45 | 46 | Or you can use docker-compose to run this image: 47 | 48 | ```yaml 49 | version: '3' 50 | services: 51 | snell: 52 | image: funnyzak/snell-server 53 | container_name: snell-server 54 | environment: 55 | PSK: 5G0H4qdf32mEZx32t 56 | TZ: Asia/Shanghai 57 | IPV6: false 58 | PORT: 6180 59 | restart: always 60 | ports: 61 | - 12303:6180 62 | ``` 63 | 64 | ## Reference 65 | 66 | - [Snell Server](https://manual.nssurge.com/others/snell.html) 67 | 68 | ## License 69 | 70 | [MIT](LICENSE) -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BIN="/app/snell-server" 4 | CONF="/app/snell-server.conf" 5 | 6 | run() { 7 | if [ ! -f ${CONF} ]; then 8 | PSK=${PSK:-$(tr -dc A-Za-z0-9 ${CONF} 18 | [snell-server] 19 | listen = 0.0.0.0:${PORT} 20 | psk = ${PSK} 21 | ipv6 = ${IPV6} 22 | EOF 23 | fi 24 | echo -e "Starting snell-server...\n" 25 | echo "Config:" 26 | cat ${CONF} 27 | echo "" 28 | ${BIN} -c ${CONF} 29 | } 30 | 31 | run 32 | --------------------------------------------------------------------------------