sipcapture / homer-app

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

Homer still tries to connect to Grafana even though it should be disabled #511

Closed inmula closed 1 year ago

inmula commented 1 year ago

I just upgraded homer from 1.4.37 to 1.4.50. When I try to access the web interface after updating I see the following error:

{"message":"remote http://127.0.0.1:3000 unreachable, could not forward: dial tcp 127.0.0.1:3000: connect: connection refused"}

My webapp_config.json contains the following configuration for Grafana:

  "grafana_config": {
    "enable": false,
    "help": "Settings for Grafana",
    "host": "http://127.0.0.1:3000",
    "path": "",
    "proxy_check": "simple",
    "proxy_control": false,
    "token": ""
  },

Since enable is set to false, it shouldn't try to connect to Grafana.

Downgrading homer-app to 1.4.37 fixes the issue.

github-actions[bot] commented 1 year ago

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

adubovikov commented 1 year ago

can you set host to = "" ? It will disable it completely.

adubovikov commented 1 year ago

also, please check if you have grafana hosts in your UI Settings. It should be removed.

inmula commented 1 year ago

Thanks for the quick reply, when I set the host to "" the error changes to:

{"message":"remote  unreachable, could not forward: unsupported protocol scheme \"\""}

In the 1.4.37 web UI I don't see any Grafana related settings in the web-interface. I can't access the UI in 1.4.50 though.

adubovikov commented 1 year ago

Let us check

adubovikov commented 1 year ago

@inmula sorry, do you have the grafana widget on main dashboard ? I couln't reproduce it

inmula commented 1 year ago

@adubovikov I don't have the grafana widget on my dashboard. I just removed all tables in the homer_config database and re-created them using ./homer-app -create-table-db-config and ./homer-app -populate-table-db-config and I still get the error when trying to access the web-interface (I don't even get to the login page).

Here's our full configuration file (with some passwords removed):

{
  "api_settings": {
    "add_captid_to_resolve": false,
    "enable_token_access": false
  },
  "auth_settings": {
    "_comment": "The type param can be internal, ldap, http_auth",
    "_jwt_help": "Please generate own jwt secret using uuid or the flag generate-jwt-secret",
    "auth_token_header": "Auth-Token",
    "gravatar": false,
    "gravatar_url": "https://www.gravatar.com/avatar/%s.jpg",
    "jwt_secret": "2b913565-aac4-42a5-883a-bc76cfb22ab8",
    "token_expire": 1200,
    "type": "ldap",
    "user_groups": [
      "admin",
      "user",
      "support"
    ]
  },
  "dashboard_settings": {
    "_comment": "Here you can define a customs dashboards home",
    "dashboard_home": "/usr/local/homer/etc/dashboard_home.json"
  },
  "database_config": {
    "help": "Settings for PGSQL Database (settings)",
    "host": "localhost",
    "keepalive": true,
    "name": "homer_config",
    "node": "LocalConfig",
    "pass": "xxxx",
    "user": "homer"
  },
  "database_data": {
    "localnode": {
      "help": "Settings for PGSQL Database (data)",
      "host": "127.0.0.1",
      "keepalive": true,
      "name": "homer_data",
      "node": "LocalNode",
      "pass": "xxxx",
      "user": "homer"
    }
  },
  "decoder_shark": {
    "_comment": "Here you can do packet decoding using tshark application. Please define uid, gid if you run the app under root",
    "active": false,
    "bin": "/usr/bin/tshark",
    "protocols": [
      "1_call",
      "1_registration",
      "1_default"
    ]
  },
  "grafana_config": {
    "enable": false,
    "help": "Settings for Grafana",
    "host": "http://127.0.0.1:3000",
    "path": "",
    "proxy_check": "simple",
    "proxy_control": false,
    "token": ""
  },
  "hep_relay": {
    "help": "UDP socket to send HEP data on",
    "host": "127.0.0.1",
    "port": 9060
  },
  "http_auth": {
    "skipverify": true,
    "url": "http://localhost:1323"
  },
  "http_settings": {
    "debug": false,
    "gzip": true,
    "gzip_static": true,
    "help": "Settings for the HOMER Webapp Server. If you have gzip_static = false, please be sure that your dist directory has uncompressed .js files",
    "host": "0.0.0.0",
    "path": "/",
    "port": 9080,
    "root": "/usr/local/homer/dist"
  },
  "https_settings": {
    "cert": "/usr/local/homer/tls/cert.pem",
    "enable": false,
    "help": "SSL settings for homer-app",
    "host": "0.0.0.0",
    "key": "/usr/local/homer/tls/key.pem",
    "port": 443
  },
  "influxdb_config": {
    "database": "homer",
    "enable": false,
    "help": "Settings for InfluxDB Database (optional)",
    "host": "http://127.0.0.1:8086",
    "name": "homer_config",
    "pass": "influx_password",
    "policy": "autogen",
    "user": "influx_user"
  },
  "ldap_config": {
    "admingroup": "CN=xxxx,OU=xxxx,DC=xxxx,DC=xxxx,DC=xxxx",
    "adminmode": false,
    "anonymous": false,
    "attributes": [
      "dn",
      "givenName",
      "sn",
      "mail",
      "sAMAccountName"
    ],
    "base": "OU=xxxx,DC=xxxx,DC=xxxx,DC=xxxx",
    "binddn": "CN=xxxx,OU=xxxx,DC=xxxx,DC=xxxx,DC=xxxx",
    "bindpassword": "xxxx",
    "group_attributes": [
      "cn",
      "memberOf",
      "GroupAttribute",
      "distinguishedName",
      "dn",
      "member"
    ],
    "groupfilter": "(member=%s)",
    "host": "hosthere",
    "port": 636,
    "skiptls": true,
    "skipverify": false,
    "userdn": "CN=%s,OU=xxxx,DC=xxxx,DC=xxxx,DC=xxxx",
    "userfilter": "(sAMAccountName=%s)",
    "usergroup": "CN=xxxx,OU=xxxx,DC=xxxx,DC=xxxx,DC=xxxx",
    "usermode": false,
    "usessl": true
  },
  "loki_config": {
    "api": "loki/api/v1",
    "enable": false,
    "help": "Settings for LOKI Database (optional)",
    "host": "http://127.0.0.1:3100",
    "param_query": "query_range",
    "pass": "admin",
    "user": "admin"
  },
  "oauth2": {
    "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
    "auth_style": 1,
    "auth_uri": "https://accounts.google.com/o/oauth2/auth",
    "client_id": "1234565",
    "client_secret": "FAKE",
    "enable": false,
    "grant_type": "authorization_code",
    "gravatar": false,
    "gravatar_url": "https://www.gravatar.com/avatar/%s.jpg",
    "profile_url": "https://www.googleapis.com/oauth2/v1/userinfo",
    "project_id": "Homer OAuth",
    "provider_image": "",
    "provider_name": "google",
    "redirect_uri": "http://localhost:80/api/v3/oauth2/auth",
    "response_type": "code",
    "scope": [
      "email",
      "openid",
      "profile"
    ],
    "service_redirect": "/api/v3/oauth2/redirect",
    "token_uri": "https://oauth2.googleapis.com/token",
    "user_token": "RandomURLSafeStringWithAMinimumLengthOf43Characters"
  },
  "prometheus_config": {
    "api": "api/v1",
    "enable": false,
    "help": "Settings for Prometheus Database (optional)",
    "host": "http://127.0.0.1:9090",
    "pass": "admin",
    "user": "admin"
  },
  "swagger": {
    "api_host": "127.0.0.1:9080",
    "api_json": "/usr/local/homer/etc/swagger.json",
    "enable": false
  },
  "system_settings": {
    "_loglevels": "can be: fatal, error, warn, info, debug, trace",
    "help": "Settings for HOMER logs",
    "hostname": "homer-dev",
    "loglevel": "error",
    "logname": "homer-app.log",
    "logpath": "/usr/local/homer/log",
    "logstdout": false,
    "uuid": "74d70c98-ac88-412a-939b-62a4c596d5c0"
  },
  "transaction_settings": {
    "deduplicate": {
      "global": false
    }
  }
}
inmula commented 1 year ago

I just tried version 1.4.51 and I still run into the same error.

rlaager commented 1 year ago

https://github.com/sipcapture/homer/issues/583

adubovikov commented 1 year ago

@rlaager it was fixed in homer-app_1.4.52

inmula commented 1 year ago

Hello, I tried version 1.4.53 and it seems to have resolved the issue with Grafana too. Thanks for your help!