mirror of
https://github.com/tobychui/zoraxy.git
synced 2025-06-03 06:07:20 +02:00
Merge pull request #216 from Kirari04/main
fix: unable to edit proxy if ratelimit is not set or <= 0
This commit is contained in:
commit
764b1944be
@ -1,4 +1,4 @@
|
||||
FROM docker.io/golang:alpine
|
||||
FROM docker.io/golang:alpine AS build
|
||||
|
||||
RUN apk add --no-cache bash netcat-openbsd sudo
|
||||
|
||||
@ -8,8 +8,6 @@ RUN mkdir -p /opt/zoraxy/source/ &&\
|
||||
|
||||
RUN chmod -R 770 /opt/zoraxy/
|
||||
|
||||
VOLUME [ "/opt/zoraxy/config/" ]
|
||||
|
||||
# If you build it yourself, you will need to add the src directory into the docker directory.
|
||||
COPY ./src/ /opt/zoraxy/source/
|
||||
|
||||
@ -19,6 +17,20 @@ RUN go mod tidy &&\
|
||||
go build -o /usr/local/bin/zoraxy &&\
|
||||
rm -r /opt/zoraxy/source/
|
||||
|
||||
FROM docker.io/alpine:3.20
|
||||
|
||||
RUN apk add --no-cache bash netcat-openbsd sudo
|
||||
|
||||
RUN mkdir -p /opt/zoraxy/source/ &&\
|
||||
mkdir -p /opt/zoraxy/config/ &&\
|
||||
mkdir -p /usr/local/bin/
|
||||
|
||||
VOLUME [ "/opt/zoraxy/config/" ]
|
||||
|
||||
RUN chmod -R 770 /opt/zoraxy/
|
||||
|
||||
COPY --from=build /usr/local/bin/zoraxy /usr/local/bin/zoraxy
|
||||
|
||||
RUN chmod 755 /usr/local/bin/zoraxy &&\
|
||||
chmod +x /usr/local/bin/zoraxy
|
||||
|
||||
@ -40,5 +52,4 @@ ENV ZTPORT="9993"
|
||||
|
||||
ENTRYPOINT "zoraxy" "-docker=true" "-autorenew=${AUTORENEW}" "-fastgeoip=${FASTGEOIP}" "-log=${LOG}" "-mdns=${MDNS}" "-mdnsname=${MDNSNAME}" "-noauth=${NOAUTH}" "-port=:${PORT}" "-sshlb=${SSHLB}" "-version=${VERSION}" "-webfm=${WEBFM}" "-webroot=${WEBROOT}" "-ztauth=${ZTAUTH}" "-ztport=${ZTPORT}"
|
||||
|
||||
HEALTHCHECK --interval=15s --timeout=5s --start-period=10s --retries=3 CMD nc -vz 127.0.0.1 $PORT || exit 1
|
||||
|
||||
HEALTHCHECK --interval=15s --timeout=5s --start-period=10s --retries=3 CMD nc -vz 127.0.0.1 $PORT || exit 1
|
@ -475,9 +475,11 @@ func ReverseProxyHandleEditEndpoint(w http.ResponseWriter, r *http.Request) {
|
||||
utils.SendErrorResponse(w, "invalid rate limit number")
|
||||
return
|
||||
}
|
||||
if proxyRateLimit <= 0 {
|
||||
if requireRateLimit && proxyRateLimit <= 0 {
|
||||
utils.SendErrorResponse(w, "rate limit number must be greater than 0")
|
||||
return
|
||||
} else if proxyRateLimit < 0 {
|
||||
proxyRateLimit = 1000
|
||||
}
|
||||
|
||||
// Bypass WebSocket Origin Check
|
||||
|
Loading…
x
Reference in New Issue
Block a user