Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@zephraph => [Node] Patch update to v10.19 for critical security fix #5022

Merged
merged 2 commits into from
Feb 7, 2020
Merged
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
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.13
10.19
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:10.13-alpine
FROM node:10.19-alpine

WORKDIR /app

Expand Down
6 changes: 5 additions & 1 deletion hokusai/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: KEEPALIVE_TIMEOUT_SECONDS
value: "95"
- name: HEADERS_TIMEOUT_SECONDS
value: "105"
envFrom:
- configMapRef:
name: force-environment
Expand Down Expand Up @@ -121,7 +125,7 @@ metadata:
service.beta.kubernetes.io/aws-load-balancer-access-log-emit-interval: "60"
service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-name: "artsy-elb-logs"
service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-prefix: "staging-force"
service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: "300"
service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: "90"
spec:
ports:
- port: 80
Expand Down
22 changes: 16 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ const {
CLIENT_SECRET,
NODE_ENV,
PORT,
KEEPALIVE_TIMEOUT,
KEEPALIVE_TIMEOUT_SECONDS,
HEADERS_TIMEOUT_SECONDS,
PROFILE_MEMORY,
} = process.env

Expand Down Expand Up @@ -67,18 +68,27 @@ const startServer = once(() => {

const server = withGracefulShutdown(http.createServer(app))

if (KEEPALIVE_TIMEOUT) {
console.log("Setting keepAliveTimeout to " + KEEPALIVE_TIMEOUT + " ms")
server.keepAliveTimeout = Number(KEEPALIVE_TIMEOUT)
}

const stopServer = once(() => {
server.shutdown(() => {
console.log("Closed existing connections.")
process.exit(0)
})
})

if (KEEPALIVE_TIMEOUT_SECONDS) {
console.log(
"Setting keepAliveTimeout to " + KEEPALIVE_TIMEOUT_SECONDS + " sec."
)
server.keepAliveTimeout = Number(KEEPALIVE_TIMEOUT_SECONDS) * 1000
}

if (HEADERS_TIMEOUT_SECONDS) {
console.log(
"Setting headersTimeout to " + HEADERS_TIMEOUT_SECONDS + " sec."
)
server.headersTimeout = Number(HEADERS_TIMEOUT_SECONDS) * 1000
}

server.listen(PORT, "0.0.0.0", () => console.log(message))

process.on("SIGTERM", stopServer)
Expand Down