Skip to content

Commit 8f761ef

Browse files
author
alyssa
committed
pluralkit changes
1 parent 5fa606b commit 8f761ef

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

.github/workflows/docker-publish-tags.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name: Docker
77

88
on:
99
push:
10-
branches: [ main, dev ]
10+
branches: [ main, dev, sliding-window-ratelimiter ]
1111
# Publish semver tags as releases.
1212
tags: [ 'v*.*.*' ]
1313
pull_request:
@@ -65,5 +65,5 @@ jobs:
6565
context: .
6666
platforms: "linux/amd64,linux/arm64/v8"
6767
push: ${{ github.event_name != 'pull_request' }}
68-
tags: ${{ steps.meta.outputs.tags }}
68+
tags: ghcr.io/pluralkit/nirn-proxy:${{ github.sha }}
6969
labels: ${{ steps.meta.outputs.labels }}

Dockerfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,8 @@ ARG TARGETARCH
77

88
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags '-extldflags "-static"' -tags timetzdata -buildvcs=false
99

10-
FROM scratch
10+
FROM alpine:latest
1111
COPY --from=app-builder /go/src/app/nirn-proxy /nirn-proxy
12-
# the tls certificates:
13-
# NB: this pulls directly from the upstream image, which already has ca-certificates:
14-
COPY --from=alpine:latest /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
1512
EXPOSE 9000
1613
EXPOSE 8080
1714
ENTRYPOINT ["/nirn-proxy"]

lib/queue_manager.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,17 @@ func (m *QueueManager) fulfillRequest(resp *http.ResponseWriter, req *http.Reque
283283
routeToHeader := req.Header.Get("nirn-routed-to")
284284
req.Header.Del("nirn-routed-to")
285285

286+
// clean up fp headers
287+
for _, header := range []string{"x-forwarded-for", "x-forwarded-port", "x-forwarded-proto", "x-forwarded-ssl"} {
288+
req.Header.Del(header)
289+
}
290+
291+
for header, _ := range req.Header {
292+
if strings.HasPrefix(header, "fly") {
293+
req.Header.Del(header)
294+
}
295+
}
296+
286297
if routeToHeader != "" {
287298
RequestsRoutedRecv.Inc()
288299
}

0 commit comments

Comments
 (0)