From 768a3417ff0e79bf940938c1a13ef54e25b28388 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 May 2016 15:42:47 +0100 Subject: [PATCH] New certmgr method, ugly. --- DockerFile | 21 +-------------------- init/30_certificates.sh | 6 ++++++ init/30_clean.sh | 1 - init/40_configuration.sh | 16 ++++++++++++++++ init/50_nadekoinstall.sh | 9 +++++++++ 5 files changed, 32 insertions(+), 21 deletions(-) create mode 100644 init/30_certificates.sh delete mode 100644 init/30_clean.sh create mode 100644 init/40_configuration.sh create mode 100644 init/50_nadekoinstall.sh diff --git a/DockerFile b/DockerFile index c997791..e3469f9 100644 --- a/DockerFile +++ b/DockerFile @@ -11,25 +11,6 @@ RUN add-apt-repository ppa:mc3man/trusty-media -y RUN apt-get -q update && \ apt-get install -qy wget libopus0 opus-tools libopus-dev mono-devel unzip ffmpeg -# Get NadekoBot Latest -RUN curl -s https://api.github.com/repos/Kwoth/NadekoBot/releases | grep browser_download_url | head -n 1 | cut -d '"' -f 4|wget -i - -O /root/NadekoBot.latest.zip &&\ -unzip /root/NadekoBot.latest.zip -d /root/NadekoBot - -##Setup Certificates -#RUN mozroots --import --ask-remove --machine &&\ -#certmgr --ssl https://gateway.discord.gg - -#Test config files present -RUN cred="/config/credentials.json" &&\ -if [ -f "$cred" ] ; then echo "Credentials exist" ; else cp /root/NadekoBot/credentials_example.json /config/credentials.json ; fi - -RUN sql="/config/nadekobot.sqlite" &&\ -if [ -f "$sql" ] ; then echo "SQLite DB exists" ; else echo "" > /config/nadekobot.sqlite ;fi - -#Adding Config file sym links -RUN ln /config/credentials.json /root/NadekoBot/credentials.json &&\ -ln /config/nadekobot.sqlite /root/NadekoBot/data/nadekobot.sqlite - #Mappings and ports VOLUME ["/config"] @@ -41,4 +22,4 @@ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* #Adding Custom files ADD init/ /etc/my_init.d/ ADD services/ /etc/service/ -RUN chmod -v +x /etc/service/*/run /etc/my_init.d/*.sh +RUN chmod -v +x /etc/service/*/run /etc/my_init.d/*.sh \ No newline at end of file diff --git a/init/30_certificates.sh b/init/30_certificates.sh new file mode 100644 index 0000000..65111e0 --- /dev/null +++ b/init/30_certificates.sh @@ -0,0 +1,6 @@ +#!/bin/bash +#Import Certificates +mozroots --import --ask-remove --machine +echo Y |certmgr --ssl https://gateway.discord.gg /all +echo Y |certmgr --ssl https://gateway.discord.gg /all +echo Y |certmgr --ssl https://gateway.discord.gg /all \ No newline at end of file diff --git a/init/30_clean.sh b/init/30_clean.sh deleted file mode 100644 index cc1f786..0000000 --- a/init/30_clean.sh +++ /dev/null @@ -1 +0,0 @@ -#!/bin/bash \ No newline at end of file diff --git a/init/40_configuration.sh b/init/40_configuration.sh new file mode 100644 index 0000000..7dc657c --- /dev/null +++ b/init/40_configuration.sh @@ -0,0 +1,16 @@ +#!/bin/bash +#Test Configuration + +cred="/config/credentials.json" +if [ -f "$cred" ] ; then echo "Credentials exist" ; else cp /root/NadekoBot/credentials_example.json /config/credentials.json ; fi + +sql="/config/nadekobot.sqlite" +if [ -f "$sql" ] ; then echo "SQLite DB exists" ; else echo "" > /config/nadekobot.sqlite ;fi + +#Remove Built in +rm /root/NadekoBot/credentials.json +rm /root/NadekoBot/data/nadekobot.sqlite + +#Adding Config file sym links +ln -s /config/credentials.json /root/NadekoBot/credentials.json +ln -s /config/nadekobot.sqlite /root/NadekoBot/data/nadekobot.sqlite diff --git a/init/50_nadekoinstall.sh b/init/50_nadekoinstall.sh new file mode 100644 index 0000000..645213c --- /dev/null +++ b/init/50_nadekoinstall.sh @@ -0,0 +1,9 @@ +#!/bin/bash +##Install NadekoBot + +#Backup Existing NadekoBot +rsync /root/NadekoBot /root/NadekoBot.bak + +#Get NadekoBot Latest +curl -s https://api.github.com/repos/Kwoth/NadekoBot/releases | grep browser_download_url | head -n 1 | cut -d '"' -f 4|wget -i - -O /root/NadekoBot.latest.zip &&\ +unzip /root/NadekoBot.latest.zip -d /root/NadekoBot \ No newline at end of file