A possibly working release?
continuous-integration/drone/push Build was killed
Details
continuous-integration/drone/push Build was killed
Details
This commit is contained in:
parent
5541be0b5a
commit
31f5854686
|
@ -1,7 +1,5 @@
|
||||||
FROM debian:latest
|
FROM debian:latest
|
||||||
|
|
||||||
COPY resources /build
|
|
||||||
|
|
||||||
## Upgrade packages on system
|
## Upgrade packages on system
|
||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
|
|
||||||
|
@ -34,6 +32,9 @@ RUN apt-get install -y \
|
||||||
## Install GONK specific dependencies
|
## Install GONK specific dependencies
|
||||||
RUN apt-get install -y fail2ban iptables net-tools
|
RUN apt-get install -y fail2ban iptables net-tools
|
||||||
|
|
||||||
|
## Copy over source and other scripts
|
||||||
|
COPY resources /build
|
||||||
|
|
||||||
## Move and unpack source to /build
|
## Move and unpack source to /build
|
||||||
RUN mkdir /build/asterisk-current
|
RUN mkdir /build/asterisk-current
|
||||||
RUN tar -xzf /build/asterisk-current.tar.gz --strip-components 1 -C /build/asterisk-current
|
RUN tar -xzf /build/asterisk-current.tar.gz --strip-components 1 -C /build/asterisk-current
|
||||||
|
@ -53,5 +54,6 @@ RUN cp /build/gonk.sh /usr/bin/gonk
|
||||||
RUN chmod +x /usr/bin/gonk
|
RUN chmod +x /usr/bin/gonk
|
||||||
RUN rm -rf /build
|
RUN rm -rf /build
|
||||||
RUN apt-get remove -y --purge g++ gcc make patch
|
RUN apt-get remove -y --purge g++ gcc make patch
|
||||||
|
RUN apt-get autoremove -y && apt-get clean -y && apt-get autoclean -y
|
||||||
|
|
||||||
ENTRYPOINT [ "gonk" ]
|
ENTRYPOINT [ "gonk" ]
|
|
@ -13,6 +13,8 @@ echo " ______
|
||||||
|
|
||||||
if [ -f /var/gonk ]; then
|
if [ -f /var/gonk ]; then
|
||||||
echo "Gonk has already been provisioned"
|
echo "Gonk has already been provisioned"
|
||||||
|
service fail2ban start
|
||||||
|
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "Running first time provisioning..."
|
echo "Running first time provisioning..."
|
||||||
|
@ -24,20 +26,41 @@ else
|
||||||
chown -R gonk:gonk /var/spool/asterisk
|
chown -R gonk:gonk /var/spool/asterisk
|
||||||
|
|
||||||
echo " Pulling config files for the first time..."
|
echo " Pulling config files for the first time..."
|
||||||
curl -o /etc/asterisk/asterisk.conf https://api.gonk.nicolor.tech/asterisk/$HOSTNAME/$GONK_KEY
|
curl -o /etc/asterisk/asterisk.conf https://ap5.gonknet.org/asterisk/$HOSTNAME/$GONK_KEY
|
||||||
curl -o /etc/asterisk/pjsip.conf https://api.gonk.nicolor.tech/pjsip/$HOSTNAME/$GONK_KEY
|
curl -o /etc/asterisk/pjsip.conf https://ap5.gonknet.org/pjsip/$HOSTNAME/$GONK_KEY
|
||||||
curl -o /etc/asterisk/modules.conf https://api.gonk.nicolor.tech/modules/$HOSTNAME/$GONK_KEY
|
curl -o /etc/asterisk/modules.conf https://ap5.gonknet.org/modules/$HOSTNAME/$GONK_KEY
|
||||||
|
curl -o /etc/asterisk/logger.conf https://ap5.gonknet.org/logger/$HOSTNAME/$GONK_KEY
|
||||||
|
|
||||||
|
|
||||||
echo " Setting up VOIPBL..."
|
echo " Setting up VOIPBL..."
|
||||||
curl -o /usr/bin/voipbl.sh https://voipbl.org/voipbl.sh
|
echo " Downloading script..."
|
||||||
|
curl -o /usr/bin/voipbl.sh https://gonknet.org/static/voipbl.sh
|
||||||
chmod 700 /usr/bin/voipbl.sh
|
chmod 700 /usr/bin/voipbl.sh
|
||||||
|
chmod +x /usr/bin/voipbl.sh
|
||||||
|
echo " Setting up cron..."
|
||||||
|
echo "13 */4 * * * /usr/bin/voipbl.sh" >> /etc/cron.d/voipbl
|
||||||
|
|
||||||
|
echo " Setting up fail2ban"
|
||||||
|
curl -o /etc/fail2ban/jail.d/asterisk.conf https://ap5.gonknet.org/f2b/asterisk/$HOSTNAME/$GONK_KEY
|
||||||
|
curl -o /etc/fail2ban/action.d/voipbl.conf https://ap5.gonknet.org/f2b/voipbl/$HOSTNAME/$GONK_KEY
|
||||||
|
rm /etc/fail2ban/jail.d/defaults-debian.conf
|
||||||
|
|
||||||
|
asterisk -U gonk -G gonk
|
||||||
|
|
||||||
|
sleep 2
|
||||||
|
|
||||||
|
kill -9 -- $(cat /var/run/asterisk/asterisk.pid)
|
||||||
|
|
||||||
|
service fail2ban start
|
||||||
|
|
||||||
|
echo " Running voipbl for the first time"
|
||||||
|
/usr/bin/voipbl.sh
|
||||||
|
|
||||||
touch /var/gonk
|
touch /var/gonk
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo "Starting Asterisk..."
|
echo "Starting Asterisk..."
|
||||||
asterisk -U gonk -G gonk -f
|
asterisk -U gonk -G gonk -f
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue