kalliope-project / kalliope

Kalliope is a framework that will help you to create your own personal assistant.
https://kalliope-project.github.io/
GNU General Public License v3.0
1.71k stars 229 forks source link

Added config option for rest API to bind to specific address only #677

Closed juergenpabel closed 11 months ago

juergenpabel commented 1 year ago

This PR adds a config option for the REST API to (optionally) bind to a spefic IP adress only (instead of on all interfaces).

The new config option is named "listen", so that an excert of the config might look like:

rest_api:
  active: True
  listen: 127.0.0.1
  port: 5000

I've also adapted the FlaskAPI instantiation in Tests/test_api/base.py, so if tests were to use this...it would work.

Sispheor commented 1 year ago

You should execute tests locally before pushing...

juergenpabel commented 1 year ago

You should execute tests locally before pushing...

Yeah...you just shoot yourself in the foot it you think "it worked fine in my private repo, I'll just copy this over to github and than create the PR". Sorry for that.

juergenpabel commented 1 year ago

By the way: how about changing the default listen address from any to localhost? I haven't done that in order to not introduce a breaking change (at least for those with restapi clients on their network) - but from a security perspective this would be reasonable.

Sispheor commented 1 year ago

I merged your first PR. This one got a conflict. Need to be rebased and fix. Thanks.

Sispheor commented 1 year ago

Still a conflict. And some comments not addressed. You should have rebased instead of merging. You'll not have a linear history.