* Adds a new method for the server to push notifies to the client, which require administration privileges from the user. If there are messages in queue but user is not privileged, she is notified of pending messages
* Fix unit tests
* Increase timeouts on tests
* Add translations
* * Aggregate admin messages
* Send admin message on auth fail
* Sending messages over bus
* XSS filtering of objects sent over the REST API
* Warn users if their instance is world readable
* Fix adminnotifies init()
* Fix couple issues from Codacy
* Auth resolve now supports async/await
* Read only tokens can be used for authentication and the UI shows privileges for these accounts correctly
* Failed attempt at authenticating an API_SECRET or token delays subsequent auth attempt by 5000 ms
* Use the delta plugin data to show the delta in the clock views
* Update Node checks
* Fix disabling the BG alarms for simple alarms
* Load battery and other rare events up to two months back
* Possibly fixes compatibility with ios9 - needs testing
* Unified black and color clock layouts
* Update clock data every 20 seconds
* Update clock time every second
* Fix how CSP policy is set for Helmet, fixes#6260
* Authorization fix for misformatted URLs
* Added unit test for batch upload of CGM entries
* Improved / removed some logging
* Test if user is in read only mode when Nightscout starts and give an error if so
* Corrected db size config for virtual assistants
* Language fix, improvements, added dbsize to virtAsst config
* Using env
* Added logging
* Debug logging
* Different logging
* More troubleshooting
* Another try
* Reverted stuff, added dbsize to server defaults
* Fixed test
* Fixed another test
* APIv3: isolating documents from tests (not allowing clashes of calculated identifiers)
* removing unused async keyword
* fixing api v3 swagger and moving it to /api3-docs
Co-authored-by: Petr Ondrusek <petr.ondrusek@seznam.cz>
Co-authored-by: Petr Ondrůšek <petr.ondrusek@okin.eu>
* On periodic polls, only load delta for CGM data, treatments and device statuses
* Serve basic CGM data API queries from in-memory cache. Increases the Nightscout memory footprint but should significantly reduce the Mongo load
* Serve device status, CGM and treatment records from memory cache
* Support count parameter in /profile
* * Update packages giving npm audit errors
* Fix Mongo test that broke after update (now uses async/await on getting the connection)
* Restore original navigation bar button order
* Disable Node 10 tests
readENV() was hard coding the default value of DISPLAY_UNITS, and
ignoring the default value for no particular reason. Fixed that. Also, I
added a full test suite for DISPLAY_UNITS environment settings to make
sure that it works as intended. Finally, I've added the console log for
the DISPLAY_UNITS since there's no particular reason why we log that setting
and not others.
* Test profile settings
* NPM Version change
* Use console log
* Use console log for client
* Use console log for client.sbx
* Use console log for client.ddata
* Use console log for client again
* revert
* Added multi-profile reporting capabilities
Co-authored-by: VIS TFS Admin <liveid@visualsolution.co.uk>
* Database size plugin - pill that displays current mongoDB database size
* Enabled dbsize by default
* Fixed bug with dbsize not shownig when size is (rounded) 0% but real bytes > 0
* Cleanup & update to iconfont generation manual
* Changed how warning/urgent levels are configured - from absolute MiB to percentage of DBSIZE_MAX
* Send coverage reports to Codacy
* Action secrets may not be read from forks :(
* Let's see if this fixes the path & key passing
* Ok one more try for the Actions env
* Run tests and coverage separately
* Try increasing the admintools test runtime for Node 10
* Run tests only once
* Allow auth tokens to be passed in the api-secret header and used in the client in place of the API secret
* Fix unit test
* Fix admin test
* Reload page when token is used as a secret
* Added sanity check for the bridge interval value, setting minimum allowed value to 30 seconds and maximum to 5 minutes. This is to avoid input of very low values which might overload the dexcom servers.
* Added missin ';'
* Fixed typoe in comment
* Added test for default interval (not set in config)
* Set lower limit to 1 second
* Run tests using GitHub Actions
* Node 10
* Test CI fails
* Use npm to run tests
* Fix package json to run tests
* Enable v3 TEST api for both development env and CI
* Run CI on both Node 10 and 12
* Allow downgrading Mongo
* Fix continuous suspension of the timeago alerts
The default hearbeat-setting is 60 seconds, so the delta between two
timeago-checks will always be >15 seconds and the timeago-alarms will
always be suspended (that's what Papertrail also shows).
To fix this, make the delta-check heartbeat-setting-dependant and also simplify
the code by using just 1 variable.
* Add test that verifies the hibernation detection behaviour
The real-world test would be to actually wait for a couple of minutes (with 2 *
heartbeat of default settings) in the unit test, but this is not feasible, so
just modify the heartbeat-setting to a lower value.
I tested it by only running tests inside `tests/timeago.test.js` and by actually
deploying this code and testing the alarms with Pushover and reading the logs in
Papertrail.
Before this change, I saw a 'Hibernation detected' log every minute. After this
change, I didn't see it anymore, probably because the app wasn't actually
hibernated (yet).
* Take sulkaharo's feedback into account and differentiate
between client and server (by introducing it in sandbox.js).
On the client the behaviour is different from the server:
> On client, the issue is browsers stop the execution of JS if the window is not
> visible and the alarm is falsely triggered immediately when the execution is
> resumed, so we need to suspend the alarm for ~10 seconds after the execution has
> resumed to give the client time to update the data to prevent false alarms.
While on the server, the default heartbeat from 60s needs to be taken
into account to prevent the timeago alarm from falsely triggering.
So detect hibernation there if the last check was more than 2 heartbeats ago.
* Fix the tests by adding settings to the context,
which is now required by timeago.
Also, change the timeago test a bit so that it both succeeds
when testing in isolation as when testing it along with the other tests.
* Fix layouting and load data in one go. Bonus points if you can fix the rendering for this
* fix focus target lines and high and low lines
* Remove debug logging. Change profile functions to clear the cache on new data, instead of calculating heavy hashes
* Remove unused code
* Fix tests
* Have Travis run tests on Node 10 and 12, not 13
* * Fix reporting test to match the new output
* Fix number formatter to return the expected 0 when data is NaN
* Remove excessive logging during test runs from cob plugin
* Run all tests in one go
* Fixes D3 invocations for tests. Note this also removes transition timers (most of which seemed to be timed so fast they actually had no effect as the timer was faster than what it takes to draw a frame in Nightscout)
* Run tests independently
* Try not running tap-set-exit
* Remove tap-set-exit
* Copied work done by mdomox
* Updates and fixes to CONTRIBUTING.md
* Spacing unification
* One more fix for CONTRIBUTING.md
* Minor code formatting improvements
* One more time...
* Renamed Alexa stuff to virtAsst for generic-ness
* Corrected missed translate() text
* Updated googlehome plugin to mimic the alexa plugin
* Changed order of operations
* Fixed parameter referencing in googlehome
* Yet another CONTRIBUTING fix
* Removed extra google stuff
* Migrated standalone intents to MetricNow intent
* Simplified route handling
* Added logging
* Added forgotten path selector
* Separated instructions for adding virtual assistant support in a plugin
* A few typo fixes
* Improved logging
* Updated Google Home plugin instructions
* Attempt to trigger download of template file
* Small wording tweaks
* Updated Alexa plugin documentation
* Updated test files
* Re-added handler count tests so devs are prompted to write tests for new handlers
* Updated Alexa documentation
* Small typo fix
* Clarification
* Further clarifications and typos
* Added language info to Google Home plugin doc
* URL correction
* URL fix v2
* Wording clarification
* Ugh...
* Minor instruction fix
* Sub steps fix
* Fixed Alexa references in Google Home
* Added a couple steps for improved user experience
* One more forgotten step
* Updated pump reservoir handler to handle undefined values
* Updated titles and unknown-value responses
* Modified forecast responses to use translate()
* Updated tests
* Improved training phrases
* Wording improvements
* Google Home setup instruction corrections
* Corrected how metric selection is found