yourWaifu / sleepy-discord

C++ library for the Discord chat client. Please use Rust for new bots
https://yourWaifu.github.io/sleepy-discord/
MIT License
707 stars 92 forks source link

connectivity issues from within docker container #180

Open Zeks opened 4 years ago

Zeks commented 4 years ago

bot didn't quite work from docker out of the box producing errors 5002 and 5003 so I had to do this:

RUN apt-get update && apt-get -y install curl libssl-dev \
 && echo 'openssl_conf = default_conf' > /etc/ssl/openssl.cnf \
   &&  echo '[ default_conf ]' >> /etc/ssl/openssl.cnf \
   &&  echo 'ssl_conf = ssl_sect' >> /etc/ssl/openssl.cnf \
   &&  echo '[ssl_sect]' >> /etc/ssl/openssl.cnf \
   &&  echo 'system_default = system_default_sect' >> /etc/ssl/openssl.cnf \
   &&  echo '[system_default_sect]' >> /etc/ssl/openssl.cnf \
   &&  echo 'MinProtocol = TLSv1.2' >> /etc/ssl/openssl.cnf \
   &&  echo 'CipherString = DEFAULT:@SECLEVEL=1' >> /etc/ssl/openssl.cnf 

I hope this helps someone

rogermiranda1000 commented 1 year ago

@Zeks do you have the full Docker command? the following doesn't work for me:

FROM ubuntu:20.04

# C++ compiler (cmake requirement)
RUN apt-get update -y
RUN apt-get install -y build-essential git

#install latest cmake
ADD https://cmake.org/files/v3.26/cmake-3.26.3-linux-x86_64.sh /cmake-3.26.3-Linux-x86_64.sh
RUN mkdir /opt/cmake
RUN sh /cmake-3.26.3-Linux-x86_64.sh --prefix=/opt/cmake --skip-license
RUN ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake
RUN cmake --version

# install other sleepy-discord dependencies
RUN apt-get install -y openssl libssl-dev
# fix ; @ref https://github.com/yourWaifu/sleepy-discord/issues/180
RUN echo 'openssl_conf = default_conf' > /etc/ssl/openssl.cnf \
   &&  echo '[ default_conf ]' >> /etc/ssl/openssl.cnf \
   &&  echo 'ssl_conf = ssl_sect' >> /etc/ssl/openssl.cnf \
   &&  echo '[ssl_sect]' >> /etc/ssl/openssl.cnf \
   &&  echo 'system_default = system_default_sect' >> /etc/ssl/openssl.cnf \
   &&  echo '[system_default_sect]' >> /etc/ssl/openssl.cnf \
   &&  echo 'MinProtocol = TLSv1.2' >> /etc/ssl/openssl.cnf \
   &&  echo 'CipherString = DEFAULT:@SECLEVEL=1' >> /etc/ssl/openssl.cnf    

# build app
COPY . /app
RUN mkdir /app/build
WORKDIR /app/build
RUN cmake ..
RUN make

CMD [ "./StatsDiscordBot" ]