sipcapture / homer-app

HOMER 7.x Front-End and API Server
http://sipcapture.io
GNU Affero General Public License v3.0
207 stars 85 forks source link

Authentication to Grafana in widget #534

Closed fabiantorress closed 1 year ago

fabiantorress commented 1 year ago

Hi, I have both the user, pass and key set under Advanced for Grafana search, but these do not appear to be used when defining a grafana widget. This is the error that I get when I try to define a new widget: image

This is my configuration: image

This is the log in grafana.log: logger=context userId=0 orgId=0 uname= t=2023-07-19T18:05:21.485763481-04:00 level=info msg="Request Completed" method=GET path=/api/org status=401

Thanks

github-actions[bot] commented 1 year ago

Your report is appreciated. Please star this repository to motivate its developers! :star:

hamidrhashmi commented 1 year ago

Try adding the following lines in grafana.ini

[server]
domain = localhost
root_url = %(protocol)s://%(domain)s:%(http_port)s/
serve_from_sub_path = true

[security]
allow_embedding = true

and after restarting grafana, try adding grafana dashboard again in homer.

fabiantorress commented 1 year ago

I solved the issue by adding in the webapp_config.json the grafana token. But now I am facing another issue, when I try to display the widget I am seeing the following error on the screen: image

I don't know if I mess up something in my configuration files. I have grafana and my homer-app running in the same server.

This are some errors that I see in the developer tools in my browser: image

I try to add the following lines in grafana.ini but I does not work:

[server]
domain = localhost
root_url = %(protocol)s://%(domain)s:%(http_port)s/
serve_from_sub_path = true

[security]
allow_embedding = true

This is my grafana config in webapp_config.json:

  "grafana_config": {
    "enable": true,
    "help": "Settings for Grafana",
    "host": "http://127.0.0.1:3000",
    "path": "grafana",
    "proxy_check": "simple",
    "proxy_control": false,
    "token": "XXXXXXXXXXXXXXXXXXXXX"
  },
lmangani commented 1 year ago

@fabiantorress follow step 2 of the provided Grafana suggestions

fabiantorress commented 1 year ago

where are the provided Grafana suggestions?

lmangani commented 1 year ago

@fabiantorress in the screenshot you included with your update

fabiantorress commented 1 year ago

Thanks! It works, I am closing this issue