Skip to content

Commit

Permalink
fix(docker): Disable CSP upgrade insecure requests setting
Browse files Browse the repository at this point in the history
  • Loading branch information
evan10s committed Oct 25, 2023
1 parent b4073f8 commit d96d80c
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ ci(github): Add automatic release workflow
docs(readme): Add release instructions
refactor(server): Move video upload to separate module
build(docker): Add docker-compose file
fix(client): Fix bug when uploading videos
```

The exact format required is based on the Angular commit message format. See
Expand Down
11 changes: 11 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
services:
match_uploader_dev:
build:
dockerfile: Dockerfile
context: .
ports:
- 8080:8080
volumes:
- ./server/settings:/home/node/app/server/settings
- ./server/env:/home/node/app/server/env
- ./server/videos:/home/node/app/server/videos
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ services:
- 8080:8080
volumes:
- ./server/settings:/home/node/app/server/settings
- ./server/env:/home/node/app/server/env
- ./server/videos:/home/node/app/server/videos
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"fast-glob": "^3.3.1",
"fs-extra": "^11.1.0",
"google-auth-library": "^8.7.0",
"helmet": "^6.0.1",
"helmet": "^7.0.0",
"inserturlparams": "^1.0.1",
"jet-logger": "^1.3.1",
"module-alias": "^2.2.2",
Expand Down
8 changes: 7 additions & 1 deletion server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ if (EnvVars.NodeEnv === NodeEnvs.Dev) {

// Security
if (EnvVars.NodeEnv === NodeEnvs.Production) {
app.use(helmet());
app.use(helmet({
contentSecurityPolicy: {
directives: {
upgradeInsecureRequests: null,
},
},
}));
}

// Add APIs, must be after middleware
Expand Down
8 changes: 4 additions & 4 deletions server/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1725,10 +1725,10 @@ has@^1.0.3:
dependencies:
function-bind "^1.1.1"

helmet@^6.0.1:
version "6.2.0"
resolved "https://registry.yarnpkg.com/helmet/-/helmet-6.2.0.tgz#c29d62014be4c70b8ef092c9c5e54c8c26b8e16e"
integrity sha512-DWlwuXLLqbrIOltR6tFQXShj/+7Cyp0gLi6uAb8qMdFh/YBBFbKSgQ6nbXmScYd8emMctuthmgIa7tUfo9Rtyg==
helmet@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/helmet/-/helmet-7.0.0.tgz#ac3011ba82fa2467f58075afa58a49427ba6212d"
integrity sha512-MsIgYmdBh460ZZ8cJC81q4XJknjG567wzEmv46WOBblDb6TUd3z8/GhgmsM9pn8g2B80tAJ4m5/d3Bi1KrSUBQ==

hexoid@^1.0.0:
version "1.0.0"
Expand Down

0 comments on commit d96d80c

Please sign in to comment.