Skip to content

Commit

Permalink
Merge pull request #5 from nightscout/master
Browse files Browse the repository at this point in the history
ronnieg
  • Loading branch information
ronnieg123 authored Apr 2, 2019
2 parents 7b5fee4 + dc7ea1b commit 548ac92
Show file tree
Hide file tree
Showing 92 changed files with 8,541 additions and 7,200 deletions.
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/--bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: "\U0001F41BBug report"
about: Create a report to help us improve things
label: bug

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Your setup information**
- What version of Nightscout (e.g. 0.10.3)
- What type of CGM, and how do you get your data there? (e.g. G4 and ShareBridge, or wired receiver, etc.)
- Is your issue specific to a browser (Firefox/Safari/Chrome?) or a device (Android phone, etc.)?

**Additional context**
Add any other context about the problem here.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/--feature-request--.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: "\U0001F4A1Feature request\U0001F4A1"
about: Suggest an idea for this project

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/--individual-troubleshooting-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: "\U0001F198Individual troubleshooting help"
about: Getting help with your own individual setup of Nightscout

---

Having issues getting Nightscout up and running? Instead of creating an issue here, please use one of the existing support channels for Nightscout.

The main support channel is on Facebook: please join the CGM In The Cloud Facebook group (https://www.facebook.com/groups/cgminthecloud) and start a post there.

**Suggestions to include in your post when you are asking for help:**
1. Include what you are trying to do: ("*I am trying to set up Nightscout for the first time.*")
2. Include which step you are on and what the problem is: ("*I deployed on Heroku, but I'm not seeing any BG data.*")
3. If possible, include a link to the version of documentation you are following ("*I'm following the OpenAPS Nightscout setup docs (https://openaps.readthedocs.io/en/latest/docs/While%20You%20Wait%20For%20Gear/nightscout-setup.html#nightscout-setup-with-heroku)*")

Other places you can find support and assistance for Nightscout include Gitter's [nightscout/public](https://gitter.im/nightscout/public) channel.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.11.x
8.x
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
language: node_js
os: osx
node_js:
- "10"
- "8"
os:
- osx
before_install:
- if [[ `npm --version` != "5.8.0" ]]; then npm install -g npm@latest; npm --version; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
# https://github.com/Homebrew/homebrew-core/issues/26358
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew unlink python; fi
Expand Down
228 changes: 197 additions & 31 deletions CONTRIBUTING.md

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ MOCHA=./node_modules/mocha/bin/_mocha
# Pinned from dependency list.
ISTANBUL=./node_modules/.bin/istanbul
ANALYZED=./coverage/lcov.info
export CODACY_REPO_TOKEN=e29ae5cf671f4f918912d9864316207c
# Following token deprecated
# export CODACY_REPO_TOKEN=e29ae5cf671f4f918912d9864316207c

DOCKER_IMAGE=nightscout/cgm-remote-monitor-travis

Expand Down
99 changes: 65 additions & 34 deletions README.md

Large diffs are not rendered by default.

42 changes: 37 additions & 5 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,39 @@ function create(env, ctx) {
var appInfo = env.name + ' ' + env.version;
app.set('title', appInfo);
app.enable('trust proxy'); // Allows req.secure test on heroku https connections.
var insecureUseHttp = env.insecureUseHttp;
var secureHstsHeader = env.secureHstsHeader;
console.info('Security settings: INSECURE_USE_HTTP=',insecureUseHttp,', SECURE_HSTS_HEADER=',secureHstsHeader);
if (!insecureUseHttp) {
app.use((req, res, next) => {
if (req.header('x-forwarded-proto') !== 'https')
res.redirect(`https://${req.header('host')}${req.url}`);
else
next()
})
if (secureHstsHeader) { // Add HSTS (HTTP Strict Transport Security) header
const helmet = require('helmet');
var includeSubDomainsValue = env.secureHstsHeaderIncludeSubdomains;
var preloadValue = env.secureHstsHeaderPreload;
app.use(helmet({
hsts: {
maxAge: 31536000,
includeSubDomains: includeSubDomainsValue,
preload: preloadValue
}
}))
if (env.secureCsp) {
app.use(helmet.contentSecurityPolicy({ //TODO make NS work without 'unsafe-inline'
directives: {
defaultSrc: ["'self'"],
styleSrc: ["'self'", 'https://fonts.googleapis.com/',"'unsafe-inline'"],
scriptSrc: ["'self'", "'unsafe-inline'"],
fontSrc: [ "'self'", 'https://fonts.gstatic.com/']
}
}));
}
}
}

app.set('view engine', 'ejs');
// this allows you to render .html files as templates in addition to .ejs
Expand Down Expand Up @@ -84,7 +117,7 @@ function create(env, ctx) {
});
});

app.get("/nightscout.appcache", (req, res) => {
app.get("/appcache/*", (req, res) => {
res.render("nightscout.appcache", {
locals: app.locals
});
Expand Down Expand Up @@ -141,7 +174,8 @@ function create(env, ctx) {
// serve the static content
app.use(staticFiles);

var swaggerFiles = express.static(env.swagger_files, {
const swaggerUiAssetPath = require("swagger-ui-dist").getAbsoluteFSPath();
var swaggerFiles = express.static(swaggerUiAssetPath, {
maxAge: maxAge
});

Expand All @@ -160,7 +194,6 @@ function create(env, ctx) {
console.log('Production environment detected, enabling Minify');

var minify = require('express-minify');
var myUglifyJS = require('uglify-js');
var myCssmin = require('cssmin');

app.use(minify({
Expand All @@ -171,7 +204,6 @@ function create(env, ctx) {
stylus_match: /stylus/,
coffee_match: /coffeescript/,
json_match: /json/,
uglifyJS: myUglifyJS,
cssmin: myCssmin,
cache: __dirname + '/tmp',
onerror: undefined,
Expand Down Expand Up @@ -208,4 +240,4 @@ function create(env, ctx) {
//}
return app;
}
module.exports = create;
module.exports = create;
Loading

0 comments on commit 548ac92

Please sign in to comment.