matterbridge icon indicating copy to clipboard operation
matterbridge copied to clipboard

Unable to use .env to set passwords etc.

Open lindhe opened this issue 3 years ago • 2 comments

Describe the bug

When I deploy Matterbridge using docker-compose, I expect to be able to use .env to populate sensitive passwords etc. as described in the Wiki, but I simply cannot get it to work. I've tried many different variants without success. I suspect that it's broken or maybe the documentation is misleading.

To Reproduce

Steps to reproduce the behavior: https://github.com/42wim/matterbridge/wiki/Gateway-config-%28basic%29#environment-variables

Expected behavior

When I deploy Matterbridge using docker-compose, I expect to be able to use .env to populate sensitive passwords etc. as described in the Wiki.

Environment (please complete the following information):

  • OS: Ubuntu 22.04 LTS
  • Matterbridge version: 1.25.2

Additional context

Related to #50.

My matterbridge.toml:

[irc.tgbot]
Server="irc.example.com:6697"
RemoteNickFormat="<tg-{NICK}> "
UseTLS=true
SkipTLSVerify=true
Nick="telegrambot"
#Password="notmyrealpassword"
Charset="utf-8"

[telegram.myirc]
#Token="123456789:NOT_MY_REAL_TOKEN_NOT_MY_REAL_TOKEN"
RemoteNickFormat="&lt;{NICK}&gt; "
MessageFormat="HTMLNick"

[[gateway]]
name="tg_my_gw"
enable=true

    [[gateway.inout]]
    account="irc.tgbot"
    channel="#debug"

    [[gateway.inout]]
    account="telegram.myirc"
    channel="-1234567890123"

My .env:

MATTERBRIDGE_IRC_TGBOT_PASSWORD='notmyrealpassword'
MATTERBRIDGE_TELEGRAM_MYIRC_TOKEN=123456789:NOT_MY_REAL_TOKEN_NOT_MY_REAL_TOKEN

A partially related question, which is basically just a documentation issue, is whether or not it works for gateway configurations too or only accounts?

lindhe avatar Jul 29 '22 15:07 lindhe

@lindhe Have you declared the envvars that your .env file would populate in your docker-compose.yaml? That would typically look something like:

version: '3.7'
services:
  matterbridge:
    image: 42wim/matterbridge:stable
    restart: unless-stopped
    environment:
    - MATTERBRIDGE_IRC_TGBOT_PASSWORD
    - MATTERBRIDGE_TELEGRAM_MYIRC_TOKEN
    volumes:
    - ./matterbridge.toml:/etc/matterbridge/matterbridge.toml:ro

bd808 avatar Mar 15 '23 22:03 bd808

No, since that's not documented in the wiki. 😅

lindhe avatar Mar 17 '23 08:03 lindhe