docker icon indicating copy to clipboard operation
docker copied to clipboard

Source password via variable

Open mkswebdev opened this issue 4 years ago • 4 comments

How hide password from manticore.conf? Can I use a variable?

docker-compose.yml:

version: "3.7"

networks:
    backend:
        driver: bridge

services:`
    manticore:
        image: manticoresearch/manticore
        restart: unless-stopped
        environment:
            - variable_sql_pass=${DB_ROOT_PASSWORD} <--- password from secret .env
        ports:
            - 127.0.0.1:9306:9306
        ulimits:
            ...
        depends_on:
            - db
        volumes:
            - ./docker/manticore:/etc/manticoresearch
        networks:
            - backend

./docker/manticore/manticore.conf:

source mysource
{
	type       = mysql
	sql_host   = db
	sql_user   = root
	sql_pass   = <---- password via variable possible?
	sql_db     = mydb
	sql_port   = 3306
}
...

mkswebdev avatar Apr 01 '21 06:04 mkswebdev

It's not possible with the default entrypoint, but it sounds like a good idea to extend the env vars functionality. Currently it supports updating searchd/common settings via env vars. Would you like to extend the functionality and make a pull request?

sanikolaev avatar Apr 01 '21 11:04 sanikolaev

Yes, please, extend the env vars functionality is a good solution.

I read the documentation and was surprised that only searchd/common settings is supported.

mkswebdev avatar Apr 02 '21 03:04 mkswebdev

Not sure when we'll have time for it, but we'll be glad to review and accept your pull request :)

sanikolaev avatar Apr 02 '21 04:04 sanikolaev