Skip to content

HBOX_DATABASE_SSL_MODE=disable does not take affect on connection to PostgresDB #1336

@benchdoos

Description

@benchdoos

First Check

  • This is not a feature request
  • I added a very descriptive title to this issue.
  • I used the GitHub search to find a similar issue and didn't find it.
  • I searched the documentation, with the integrated search.
  • I already read the docs and didn't find an answer.
  • I can replicate the issue inside the Demo install.

Homebox Version

0.23.1

What is the issue you are experiencing?

Hello!
I'm booting up via docker-compose 2 services: postgres, homebox.
According to configuration description i've setted up env HBOX_DATABASE_SSL_MODE = disable.
But when homebox connecting to DB, it logs an error:

homebox     | 6:13PM ERR ../go/src/app/app/api/main.go:155 > failed to migrate database error="pq: SSL is not enabled on the server; pq: SSL is not enabled on the server"
homebox     | panic: pq: SSL is not enabled on the server; pq: SSL is not enabled on the server
homebox     | 
homebox     | goroutine 1 [running]:
homebox     | main.main()
homebox     | 	/go/src/app/app/api/main.go:96 +0x78
homebox exited with code 2

Is there any way to not to use ssl between homebox and postgres? Big thanks!

How can the maintainer reproduce the issue?

Use the given docker-compose.yml, replacing *** into valid values

Deployment

Docker (Linux)

Database Type

PostgreSQL

OS Architechture

ARM64

Deployment Details

My docker-compose.yml:

version: "3.9"

services:
  postgres:
    image: postgres:15.3
    container_name: homebox-postgres
    restart: unless-stopped
    environment:
      POSTGRES_DB: ***
      POSTGRES_USER: ***
      POSTGRES_PASSWORD: ***
    volumes:
      - ./postgres_data:/var/lib/postgresql/data
    networks:
      - homebox-network
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U homebox -d homebox"]
      interval: 10s
      timeout: 5s
      retries: 5

  homebox:
    image: ghcr.io/sysadminsmedia/homebox:0.23.1
    container_name: homebox
    restart: unless-stopped

    depends_on:
      postgres:
        condition: service_healthy

    environment:
      HBOX_DATABASE_DRIVER: postgres
      HBOX_DATABASE_HOST: postgres
      HBOX_DATABASE_PORT: "5432"
      HBOX_DATABASE_NAME: ***
      HBOX_DATABASE_USER: ***
      HBOX_DATABASE_PASSWORD: ***
      HBOX_DATABASE_SSL_MODE: disable

    ports:
      - "3100:7745"

    volumes:
      - ./homebox_data:/data

    networks:
      - homebox-network

volumes:
  postgres_data:
  homebox_data:

networks:
  homebox-network:
    driver: bridge

Metadata

Metadata

Assignees

No one assigned

    Labels

    🕷️ bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions