doganm95 / ewelink-rest-api-server Goto Github PK
View Code? Open in Web Editor NEWServer-code accepting http requests to control ewelink devices
License: MIT License
Server-code accepting http requests to control ewelink devices
License: MIT License
Let chatgpt optimize the readme
When posting to the Docker container using a body such as:
{
"params": {
"switch": "on"
},
"deviceid": "xxxxxxx"
}
The server crashes and logs the following:
file:///usr/src/app/server/server.js:31
const requestedActionOnDevice = req.body.params.switch != undefined && req.body.params.switch != "" ? String(req.body.params.switch) : undefined;
^
TypeError: Cannot read property 'switch' of undefined
at file:///usr/src/app/server/server.js:31:53
at Layer.handle [as handle_request] (/usr/src/app/server/node_modules/express/lib/router/layer.js:95:5)
at next (/usr/src/app/server/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/usr/src/app/server/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/usr/src/app/server/node_modules/express/lib/router/layer.js:95:5)
at /usr/src/app/server/node_modules/express/lib/router/index.js:281:22
at Function.process_params (/usr/src/app/server/node_modules/express/lib/router/index.js:335:12)
at next (/usr/src/app/server/node_modules/express/lib/router/index.js:275:10)
at jsonParser (/usr/src/app/server/node_modules/body-parser/lib/types/json.js:119:7)
at Layer.handle [as handle_request] (/usr/src/app/server/node_modules/express/lib/router/layer.js:95:5)```
Thank you very much for this work!
I am having a hard time to get the authentication right.
I am using the same username (my mailadres) and password as I am using to log in to the ewelink app.
I am in the Netherlands, and have set the region to "eu"
When starting, I see an error in the docker log:
Authentication failed. The application will continue and respond with the error message, to make sure you are informed.
I am in doubt of the right region, so i also tried "nl". In that case I get a docker log error:
FetchError: request to https://nl-api.coolkit.cc:8080/api/user/login failed, reason: getaddrinfo ENOTFOUND nl-api.coolkit.cc
Which makes me think my eu region is correct.
Should I use the same credentials as using in the ewelink app?
Kind regards
Code should be secured against exploits/injections etc, so it can be exposed to the internet for external access by port forwarding.
every login try should be logged into a db, and successful logins should give a notification, possibly over tasker on android.
Move docker images to ghcr
Container should detect file changes in any mounted volume and auto-restart on change detection.
comparison options:
This would enable changing certs in the ssl directory and having the container restart automatically.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.