Code Monkey home page Code Monkey logo

Comments (7)

comassky avatar comassky commented on July 17, 2024 1

@danimart1991

MY BAD

I forgot to add the $ symbol before the variables!

Sorry again, there was no bug!

Solution :

telegram:
     image: danimart1991/jackett2telegram
     container_name: Jackett-Telegram
     environment:
       - DELAY=60
       - TOKEN=${telegram_bot_token}
       - CHATID=${telegram_bot_chatid}
       - LOG_LEVEL=debug

from jackett2telegram.

danimart1991 avatar danimart1991 commented on July 17, 2024

Hi @comassky.

I think your docker-compose.yml file is not ok. You must use env_file to use the .env and not declare the enviroment variables in the compose file. Something like this:

version: "2"

services:
  telegram:
    image: danimart1991/jackett2telegram
    container_name: Jackett-Telegram
    hostname: jackett2telegram
    env_file:
      - ./.env

from jackett2telegram.

comassky avatar comassky commented on July 17, 2024

Thanks @danimart1991

Docker-compose uses by default the .env file or docker-compose.ini if it is present.

I have added the option, the error is still present.

telegram:
     image: danimart1991/jackett2telegram
     container_name: Jackett-Telegram
     environment:
       - DELAY=60
       - TOKEN={telegram_bot_token}
       - CHATID={telegram_bot_chatid}
       - LOG_LEVEL=debug
     env_file:
       - ./.env

Same .env file

Traceback (most recent call last):
  File "jackett2telegram.py", line 539, in <module>
    main()
  File "jackett2telegram.py", line 500, in main
    updater = Updater(token=token, use_context=True)
  File "/usr/local/lib/python3.7/site-packages/telegram/ext/updater.py", line 290, in __init__
    else arbitrary_callback_data
  File "/usr/local/lib/python3.7/site-packages/telegram/ext/extbot.py", line 103, in __init__
    private_key_password=private_key_password,
  File "/usr/local/lib/python3.7/site-packages/telegram/bot.py", line 191, in __init__
    self.token = self._validate_token(token)
  File "/usr/local/lib/python3.7/site-packages/telegram/bot.py", line 351, in _validate_token
    raise InvalidToken()
telegram.error.InvalidToken: Invalid token

from jackett2telegram.

danimart1991 avatar danimart1991 commented on July 17, 2024

Hi again.

You are right. The env_file is not necessary. Indeed, the enviroment property and all its content must be removed from compose file and moved to .env.

from jackett2telegram.

comassky avatar comassky commented on July 17, 2024

@danimart1991

I don't really understand.

The .env file contains the key=value variables that can be used in the docker-compose.

The .env does not replace the environments tag, it completes it.

I use this mechanism for all my other containers (about 30)

from jackett2telegram.

danimart1991 avatar danimart1991 commented on July 17, 2024

Yes @comassky.

But the environment field rules against the .env. So if you declare TOKEN={telegram_bot_token} in the compose file and TOKEN=1234 in the .env file. TOKEN goes to have {telegram_bot_token} as value.

Edit: I see your last message.

My bad here maybe is use {telegram_bot_token} in the documentation instead maybe something like <YourTelegramBotToken> 🤔

from jackett2telegram.

comassky avatar comassky commented on July 17, 2024

@danimart1991

I think your documentation is OK.

It's my conversion from docker-run/start to docker-compose that is messed up, with the environment variables forgotten.

By the way, maybe can you add an example of docker-compose in the readme (i can give you mine) ?

from jackett2telegram.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.