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

Serve local client-config.json if it exists #1038

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ npm-debug.log*
!/.nginx/.gitkeep

/.eslintcache

/client-config.json
5 changes: 4 additions & 1 deletion main.nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ http {
}

location = /client-config.json {
include ./common-headers.nginx.conf;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't call add_header in this location, so I don't think we need to include this file. Locally, I can see that the expected headers are coming through.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this change be a separate PR? It seems to be unrelated to the aim of this PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would keep this line, as it doesn't do any harm, and keeps this file closer to central's files/nginx/odk.conf.template, and therefore easier to compare.

We could go further in mirroring central's files/nginx/odk.conf.template by adding:

add_header Cache-Control no-cache;

root .;
try_files $uri @empty_json;
}
location @empty_json {
return 200 "{}";
}

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"private": true,
"scripts": {
"dev": "nf start",
"dev:oidc": "VUE_APP_OIDC_ENABLED=true npm run dev",
"build": "vue-cli-service build",
"lint": "eslint --max-warnings 0 --cache --ext .js,.vue src/ bin/ test/ *.js",
"lint:fix": "eslint --max-warnings 0 --fix --cache --ext .js,.vue src/ bin/ test/ *.js",
Expand Down
4 changes: 1 addition & 3 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ export default {
title: null,
body: null
},
// VUE_APP_OIDC_ENABLED is not set in production. It can be set during local
// development to facilitate work on SSO.
oidcEnabled: process.env.VUE_APP_OIDC_ENABLED === 'true',
oidcEnabled: false,
showsFeedbackButton: false
};