Skip to content

Commit

Permalink
2.4.0 add Sentry, fix potential crash and update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
Apollon77 committed Apr 11, 2020
1 parent 4b2e502 commit da35e14
Show file tree
Hide file tree
Showing 10 changed files with 5,020 additions and 95 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ tmp
admin/i18n/flat.txt
admin/i18n/*/flat.txt
iob_npm.done
package-lock.json
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ appveyor.yml
admin/i18n
iob_npm.done
package-lock.json
.idea
.idea
.github
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ os:
- windows
language: node_js
node_js:
- '8'
- '10'
- '12'
- 'node'
before_script:
- export NPMVERSION=$(echo "$($(which npm) -v)"|cut -c1)
- 'if [[ $NPMVERSION == 5 ]]; then npm install -g npm@5; fi'
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015-2019 bluefox <dogafox@gmail.com>
Copyright (c) 2015-2020 bluefox <dogafox@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

This is RESTFul interface to read the objects and states from ioBroker and to write/control the states over HTTP Get/Post requests.

**This adapter uses Sentry libraries to automatically report exceptions and code errors to me as the developer.** More details see below!

## Usage
Call in browser ```http://ipaddress:8087/help``` to get the help about API. The result is:

Expand Down Expand Up @@ -546,8 +548,17 @@ If no data source was specified or the noHistory parameter is passed, then only
]
</pre>

## What is Sentry and what is reported to the servers?
Sentry.io is a way for developers to get an overview about errors from their applications. And exactly this is implemented in this adapter.

When the adapter crashes or an other Code error happens, this error message that also appears in the ioBroker log is submitted to our own Sentry server hosted in germany. When you allowed iobroker GmbH to collect diagnostic data then also your installation ID (this is just a unique ID **without** any additional infos about you, email, name or such) is included. This allows Sentry to group errors and show how many unique users are affected by such an error. All of this helps me to provide error free adapters that basically never crashs.

## Changelog

### 2.4.0 (2020-04-12)
* (Apollon77) Add Sentry support with js-controller 3.0
* (Apollon77)

### 2.3.3 (2019-11-16)
* (bluefox) Added response code for unknown commands

Expand Down Expand Up @@ -645,7 +656,7 @@ If no data source was specified or the noHistory parameter is passed, then only
## License
The MIT License (MIT)

Copyright (c) 2015-2019 bluefox <dogafox@gmail.com>
Copyright (c) 2015-2020 bluefox <dogafox@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
1 change: 0 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
version: 'test-{build}'
environment:
matrix:
- nodejs_version: '8'
- nodejs_version: '10'
- nodejs_version: '12'
platform:
Expand Down
102 changes: 57 additions & 45 deletions io-package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"common": {
"name": "simple-api",
"version": "2.3.3",
"version": "2.4.0",
"news": {
"2.3.3": {
"en": "Added response code for unknown commands",
"de": "Antwortcode für unbekannte Befehle hinzugefügt",
"ru": "Добавлен код ответа для неизвестных команд",
"pt": "Adicionado código de resposta para comandos desconhecidos",
"nl": "Reactiecode toegevoegd voor onbekende opdrachten",
"fr": "Ajout du code de réponse pour les commandes inconnues",
"it": "Aggiunto codice di risposta per comandi sconosciuti",
"es": "Código de respuesta agregado para comandos desconocidos",
"pl": "Dodano kod odpowiedzi dla nieznanych poleceń",
"zh-cn": "添加了未知命令的响应代码"
"en": "Added response code for unknown commands",
"de": "Antwortcode für unbekannte Befehle hinzugefügt",
"ru": "Добавлен код ответа для неизвестных команд",
"pt": "Adicionado código de resposta para comandos desconhecidos",
"nl": "Reactiecode toegevoegd voor onbekende opdrachten",
"fr": "Ajout du code de réponse pour les commandes inconnues",
"it": "Aggiunto codice di risposta per comandi sconosciuti",
"es": "Código de respuesta agregado para comandos desconocidos",
"pl": "Dodano kod odpowiedzi dla nieznanych poleceń",
"zh-cn": "添加了未知命令的响应代码"
},
"2.3.2": {
"en": "Admin 3 is now supported\nNPM packages were updated",
Expand Down Expand Up @@ -120,8 +120,8 @@
"pl": "Zwróć używane kodowanie znaków (UTF-8)"
}
},
"title": "Simple RESTful API",
"desc": {
"title": "Simple RESTful API",
"desc": {
"en": "This adapter allows to read and write ioBroker objects and state with web RESTful API",
"de": "Dieser Adapter ermöglicht das Lesen und Schreiben von ioBroker-Objekten und den Status mit der Web-RESTful-API",
"ru": "Этот адаптер позволяет читать и записывать объекты и состояния ioBroker с помощью веб-RESTful API",
Expand All @@ -138,40 +138,52 @@
"Apollon77 <ingo@fischer-ka.de>",
"Marco.K <marco@kaminski-net.de>"
],
"license": "MIT",
"platform": "Javascript/Node.js",
"mode": "daemon",
"loglevel": "info",
"icon": "simple-api.png",
"webExtension": "lib/simpleapi.js",
"materialize": true,
"readme": "https://github.com/ioBroker/ioBroker.simple-api/blob/master/README.md",
"keywords": ["web", "simpleAPI", "RESTful", "communication"],
"enabled": true,
"compact": true,
"extIcon": "https://raw.githubusercontent.com/ioBroker/ioBroker.simple-api/master/admin/simple-api.png",
"type": "communication",
"stopBeforeUpdate": true,
"localLink": "%protocol%://%ip%:%port%/get/system.adapter.simple-api.%instance%.uptime?prettyPrint",
"dependencies": [{"js-controller": ">=0.15.0"}]
"license": "MIT",
"platform": "Javascript/Node.js",
"mode": "daemon",
"loglevel": "info",
"icon": "simple-api.png",
"webExtension": "lib/simpleapi.js",
"materialize": true,
"readme": "https://github.com/ioBroker/ioBroker.simple-api/blob/master/README.md",
"keywords": [
"web",
"simpleAPI",
"RESTful",
"communication"
],
"enabled": true,
"compact": true,
"extIcon": "https://raw.githubusercontent.com/ioBroker/ioBroker.simple-api/master/admin/simple-api.png",
"type": "communication",
"stopBeforeUpdate": true,
"localLink": "%protocol%://%ip%:%port%/get/system.adapter.simple-api.%instance%.uptime?prettyPrint",
"dependencies": [
{
"js-controller": ">=0.15.0"
}
],
"plugins": {
"sentry": {
"dsn": "https://1ad1b116fa644ec29e6f5d724b39f999@sentry.iobroker.net/12"
}
}
},
"native": {
"port": 8087,
"auth": false,
"secure": false,
"bind": "0.0.0.0",
"certPublic": "",
"certPrivate": "",
"certChained": "",
"defaultUser": "admin",
"port": 8087,
"auth": false,
"secure": false,
"bind": "0.0.0.0",
"certPublic": "",
"certPrivate": "",
"certChained": "",
"defaultUser": "admin",
"onlyAllowWhenUserIsOwner": false,
"webInstance": "",

"leEnabled": false,
"leUpdate": false,
"leCheckPort": 80,

"dataSource": "",
"allDatapoints": false
"webInstance": "",
"leEnabled": false,
"leUpdate": false,
"leCheckPort": 80,
"dataSource": "",
"allDatapoints": false
}
}
14 changes: 12 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,18 @@ function initWebServer(settings) {
process.exit(1);
}
}
server.server.listen(port);
adapter.log.info('http' + (settings.secure ? 's' : '') + ' server listening on port ' + port);
if (server.server) {
server.server.listen(port);
adapter.log.info('http' + (settings.secure ? 's' : '') + ' server listening on port ' + port);
}
else {
adapter.log.error('server initialization failed');
if (adapter.terminate) {
adapter.terminate(1);
} else {
process.exit(1);
}
}
});
}

Expand Down
Loading

1 comment on commit da35e14

@GermanBluefox
Copy link
Contributor

Choose a reason for hiding this comment

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

No news found for 2.4.0

Please sign in to comment.