sipcapture / homer

HOMER - 100% Open-Source SIP, VoIP, RTC Packet Capture & Monitoring
https://sipcapture.org
GNU Affero General Public License v3.0
1.58k stars 239 forks source link

How to connect HOMER 7 to external DB #643

Closed Meleheora closed 2 weeks ago

Meleheora commented 1 month ago

Hello. I have a some trouble. I can't to change external port to connect to external DB in homer-webapp. I tried adding the port to DB_HOST via : I tried adding DB_PORT. In any case, it connects on the standard PGSQL port - 5432

My docker-compose.yml for example:

  homer-webapp:
    container_name: homer-webapp
    image: sipcapture/webapp
    environment:
      #      - "LOKI_HOST=loki"
      #      - "PROM_HOST=prometheus"
      - "DB_HOST=HOST"
      - "DB_PORT=54432"
      - "DB_USER=homer"
      - "DB_PASS=HOMERPASS"
    restart: unless-stopped
    ports:
      - "9080:80"
      - "9043:443"
    volumes:
      - ./bootstrap:/app/bootstrap
    logging:
      options:
        max-size: "50m"
github-actions[bot] commented 1 month ago

Please star this repository to motivate the developers and to get higher priority! :star:

Meleheora commented 1 month ago

Also i cant change a DB_NAME for homer-webapp. In particular, if i change DB_NAME in heplify-server.

My example for heplify-server:

  heplify-server:
    image: sipcapture/heplify-server
    container_name: heplify-server
    ports:
      - "9060:9060"
      - "9060:9060/udp"
      - "9061:9061/tcp"
    command:
      - './heplify-server'
    environment:
      - "HEPLIFYSERVER_HEPADDR=0.0.0.0:9060"
      - "HEPLIFYSERVER_HEPTCPADDR=0.0.0.0:9061"
      - "HEPLIFYSERVER_DBSHEMA=MY_CUSTOM_DB_NAME"
      - "HEPLIFYSERVER_DBDRIVER=postgres"
      - "HEPLIFYSERVER_DBADDR=MY_PGSQL_HOST:6432"
      - "HEPLIFYSERVER_DBUSER=homer"
      - "HEPLIFYSERVER_DBPASS=HOMER_PASS"
      - "HEPLIFYSERVER_DBDATATABLE=homer_data"
      - "HEPLIFYSERVER_DBCONFTABLE=homer_config"
      - "HEPLIFYSERVER_DBROTATE=true"
      - "HEPLIFYSERVER_DBDROPDAYS=5"
#     - "HEPLIFYSERVER_LOGLVL=info"
#      - "HEPLIFYSERVER_LOGSTD=true"
#      - "HEPLIFYSERVER_PROMADDR=0.0.0.0:9096"
#      - "HEPLIFYSERVER_PROMTARGETIP=127.0.0.1"
#      - "HEPLIFYSERVER_PROMTARGETNAME=local"
#      - "HEPLIFYSERVER_DEDUP=false"
        #      - "HEPLIFYSERVER_LOKIURL=http://loki:3100/api/prom/push"
        #      - "HEPLIFYSERVER_LOKITIMER=2"
    restart: unless-stopped
      #    depends_on:
      #      - loki
      #      - db
    expose:
      - 9090
      - 9096
    labels:
      org.label-schema.group: "monitoring"
    logging:
      options:
        max-size: "50m"
lmangani commented 1 month ago

@Meleheora a safe way is to use the homer-app configuration to change the host/port settings and/or change the container command to include the database-port parameter to set a different port.

Meleheora commented 1 month ago

Thanks for answer. Can you explain please what kind of command i need to include? Earlier I wrote that setting a variable in environment does not help to change the connection port

Meleheora commented 2 weeks ago

@Meleheora a safe way is to use the homer-app configuration to change the host/port settings and/or change the container command to include the database-port parameter to set a different port.