Skip to content
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
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM --platform=$BUILDPLATFORM debian:sid-slim

ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG SNELL_SERVER_VERSION=4.0.1
ARG SNELL_SERVER_VERSION=4.1.1

RUN apt-get update && \
apt-get install -y --no-install-recommends wget unzip && \
Expand All @@ -29,6 +29,10 @@ ENV TZ=Asia/Shanghai
ENV PORT=6180
ENV IPV6=false
ENV PSK=
ENV REUSE=
ENV OBFS=
ENV OBFSHOST=
ENV OBFSURI=

LABEL version="${SNELL_SERVER_VERSION}"

Expand Down
60 changes: 59 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,60 @@ services:
- 12303:6180
```

Or you can use kubernetes to run this image:

```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: dept-snell-server
labels:
app: snell-server
spec:
replicas: 1
selector:
matchLabels:
app: snell-server
template:
metadata:
labels:
app: snell-server
spec:
containers:
- name: snell-server
image: funnyzak/snell-server:4.1.1
ports:
- containerPort: 6180
resources:
requests:
cpu: "500m"
memory: "512Mi"
limits:
cpu: "1"
memory: "1Gi"
env:
- name: PSK
value: "5G0H4qdf32mEZx32t"
- name: TZ
value: "Asia/Shanghai"
- name: IPV6
value: "false"
- name: PORT
value: "6180"
---
apiVersion: v1
kind: Service
metadata:
name: svc-snell-server
spec:
selector:
app: snell-server
ports:
- protocol: TCP
port: 6180
targetPort: 6180
type: LoadBalancer
```

## Environment Variables

Expand All @@ -72,6 +126,10 @@ services:
| `PORT` | `6180` | Port number for the server to listen on |
| `IPV6` | `false` | Enable IPv6 support |
| `EGRESS_INTERFACE` | - | Network interface name for outbound connections (e.g., `eth0`, `wlan0`) |
| `REUSE` | - | Optional. Enable connection reuse. |
| `OBFS` | - | Optional. `http` is the only option supported by Snell V4. |
| `OBFSHOST` | - | Optional. |
| `OBFSURI` | - | Optional. |

## Surge Configuration

Expand All @@ -87,4 +145,4 @@ Proxy = snell, 1.2.3.4, 6333, psk=RANDOM_KEY_HERE, version=4

## License

[MIT](LICENSE)
[MIT](LICENSE)
4 changes: 4 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ run() {
listen = 0.0.0.0:${PORT}
psk = ${PSK}
ipv6 = ${IPV6}
${OBFS:+obfs = ${OBFS}}
${REUSE:+reuse = ${REUSE}}
${OBFSHOST:+obfs-host = ${OBFSHOST}}
${OBFSURI:+obfs-uri = ${OBFSURI}}
EOF
fi
echo -e "Starting snell-server...\n"
Expand Down