tomer8007 / kik-bot-api-unofficial

Python API for writing unoffical Kik bots that act like humans
MIT License
128 stars 77 forks source link

Environment / Settings Configuration Standardization & Docker Tweaks #257

Open sokkit-io opened 7 months ago

sokkit-io commented 7 months ago

After updating my fork with the current state of the new branch, I realized the docker composition I added about a year ago no longer ran properly when following the instructions from the Docker section of the readme. Reason being, it appears the dotenv credentials loader I originally added to the echo_bot example has been replaced with a different yaml based loader pointed at examples/creds.yaml.

Notes:

I'm opening this issue just to gauge interest / opinions / preferences around standardizing the configuration of environment variables and settings such as client credentials for this project going forward. I personally don't have a strong preference as either approach seems to work, but certainly the readme will need to be updated and we should encourage consumers of the API to create a non-VCS tracked (.gitignore'd) copy of examples/creds.yaml if it's decided to stick with yaml based configuration.

I don't mind opening a PR containing suggested changes if yaml based configuration is chosen as the standard. If you'd like to tinker with this yourself using the echo_bot example or if you're just here trying to get your docker composition working again:

  1. Add your creds to examples/creds.yaml (DO NOT COMMIT THESE CHANGES)
  2. Make the following changes to the Dockerfile:
    
    FROM python:3.8

LABEL name="kik-bot-api-unofficial"

WORKDIR /app

-COPY setup* /app/ +COPY . /app

RUN pip install /app

-COPY . /app COPY examples/echo_bot.py /app/bot.py

CMD python bot.py


3. Run `docker compose up --build` from the root of the repository
tomer8007 commented 7 months ago

Thank you for noting this. The YAML stuff are due to @karlebot 's changes (#228).

I don't mind opening a PR containing suggested changes if yaml based configuration is chosen as the standard

I'm fine with this. Perhaps @karlebot wil have something to say,