diff --git a/bin/tped.sh b/bin/tped.sh new file mode 100755 index 00000000..184a5571 --- /dev/null +++ b/bin/tped.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# set backtitle, get filename +myBACKTITLE="T-Pot Edition Selection Tool" +myYMLS=$(cd /opt/tpot/etc/compose/ && ls -1 *.yml) +myLINK="/opt/tpot/etc/tpot.yml" + +# setup menu +for i in $myYMLS; + do + myITEMS+="$i $(echo $i | cut -d "." -f1 | tr [:lower:] [:upper:]) " +done +myEDITION=$(dialog --backtitle "$myBACKTITLE" --menu "Select T-Pot Edition" 13 50 6 $myITEMS 3>&1 1>&2 2>&3 3>&-) +if [ "$myEDITION" == "" ]; + then + echo "Have a nice day!" + exit +fi +dialog --backtitle "$myBACKTITLE" --title "[ Activate now? ]" --yesno "\n$myEDITION" 7 50 +myOK=$? +if [ "$myOK" == "0" ]; + then + echo "OK - Activating" + systemctl stop tpot + rm -f $myLINK + ln -s /opt/tpot/etc/compose/$myEDITION $myLINK + systemctl start tpot + echo "Done. Use \"dps.sh\" for monitoring" + else + echo "Have a nice day!" +fi diff --git a/docker/glastopf/Dockerfile b/docker/glastopf/Dockerfile index 632ea69c..1137ce04 100644 --- a/docker/glastopf/Dockerfile +++ b/docker/glastopf/Dockerfile @@ -85,6 +85,6 @@ RUN apk -U --no-cache add \ rm -rf /var/cache/apk/* # Set workdir and start glastopf -USER glastopf:glastopf +#USER glastopf:glastopf WORKDIR /tmp/glastopf/ CMD cp /etc/glastopf/glastopf.cfg /tmp/glastopf && exec glastopf-runner diff --git a/docker/glastopf/dist/requirements.txt b/docker/glastopf/dist/requirements.txt index 42fda573..d6788069 100644 --- a/docker/glastopf/dist/requirements.txt +++ b/docker/glastopf/dist/requirements.txt @@ -1,7 +1,7 @@ asn1crypto==0.24.0 BeautifulSoup==3.2.1 beautifulsoup4==4.6.1 -botocore==1.11.3 +botocore==1.11.6 certifi==2018.4.16 cffi==1.10.0 chardet==3.0.4 @@ -11,7 +11,6 @@ Cython==0.28.2 docutils==0.14 enum34==1.1.6 gevent==1.2.2 -Glastopf==3.1.3.dev0 greenlet==0.4.13 hpfeeds==1.0 idna==2.6 @@ -19,7 +18,7 @@ ipaddress==1.0.22 Jinja2==2.9.6 jmespath==0.9.3 libtaxii==1.1.111 -lxml==4.2.2 +lxml==4.2.4 MarkupSafe==1.0 MySQL-python==1.2.5 pyasn1==0.4.2 diff --git a/docker/glastopf/testing/Dockerfile.backup b/docker/glastopf/testing/Dockerfile.backup new file mode 100644 index 00000000..1137ce04 --- /dev/null +++ b/docker/glastopf/testing/Dockerfile.backup @@ -0,0 +1,90 @@ +FROM alpine + +# Include dist +ADD dist/ /root/dist/ + +# Install packages +RUN apk -U --no-cache add \ + autoconf \ + bind-tools \ + build-base \ + cython \ + git \ + libffi \ + libffi-dev \ + libcap \ + make \ + py-asn1 \ + py-cffi \ + py-chardet \ + py-cparser \ + py-cryptography \ + py-dateutil \ + py-enum34 \ + py-idna \ + py-ipaddress \ + py-jinja2 \ + py-lxml \ + py-mysqldb \ + py-openssl \ + py-pip \ + py-requests \ + py-setuptools \ + python \ + python-dev && \ + apk -U add --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ \ + py-beautifulsoup4 \ + php7 \ + php7-dev \ + py-cssselect \ + py-gevent \ + py-greenlet \ + py-mongo \ + py-sqlalchemy \ + py-webob && \ + pip install --no-cache-dir --upgrade pip && \ + +# Install php sandbox from git + git clone --depth=1 https://github.com/mushorg/BFR /opt/BFR && \ + cd /opt/BFR && \ + phpize7 && \ + ./configure \ + --with-php-config=/usr/bin/php-config7 \ + --enable-bfr && \ + make && \ + make install && \ + cd / && \ + rm -rf /opt/BFR /tmp/* /var/tmp/* && \ + echo "zend_extension = "$(find /usr -name bfr.so) >> /etc/php7/php.ini && \ + +# Install glastopf from git + git clone --depth=1 https://github.com/mushorg/glastopf.git /opt/glastopf && \ + cd /opt/glastopf && \ + pip install --no-cache-dir . && \ + cd / && \ + rm -rf /opt/glastopf /tmp/* /var/tmp/* && \ + setcap cap_net_bind_service=+ep /usr/bin/python2.7 && \ + +# Setup user, groups and configs + addgroup -g 2000 glastopf && \ + adduser -S -H -u 2000 -D -g 2000 glastopf && \ + mkdir -p /etc/glastopf && \ + mv /root/dist/glastopf.cfg /etc/glastopf/ && \ + +# Clean up + apk del --purge autoconf \ + build-base \ + file \ + git \ + libffi-dev \ + php7-dev \ + python-dev \ + py-pip \ + re2c && \ + rm -rf /root/* && \ + rm -rf /var/cache/apk/* + +# Set workdir and start glastopf +#USER glastopf:glastopf +WORKDIR /tmp/glastopf/ +CMD cp /etc/glastopf/glastopf.cfg /tmp/glastopf && exec glastopf-runner diff --git a/docker/glastopf/testing/Dockerfile.new b/docker/glastopf/testing/Dockerfile.new new file mode 100644 index 00000000..b9f4632b --- /dev/null +++ b/docker/glastopf/testing/Dockerfile.new @@ -0,0 +1,73 @@ +FROM alpine + +# Include dist +ADD dist/ /root/dist/ + +# Install packages +RUN apk -U --no-cache add \ + autoconf \ + bind-tools \ + build-base \ + cython \ + git \ + libcap \ + libffi \ + libffi-dev \ + libxslt-dev \ + make \ + py-mysqldb \ + py-openssl \ + py-pip \ + py-setuptools \ + python \ + python-dev \ + php7 \ + php7-dev \ + re2c && \ + pip install --no-cache-dir --upgrade pip && \ + +# Install php sandbox from git + git clone --depth=1 https://github.com/mushorg/BFR /opt/BFR && \ + cd /opt/BFR && \ + phpize7 && \ + ./configure \ + --with-php-config=/usr/bin/php-config7 \ + --enable-bfr && \ + make && \ + make install && \ + cd / && \ + rm -rf /opt/BFR /tmp/* /var/tmp/* && \ + echo "zend_extension = "$(find /usr -name bfr.so) >> /etc/php7/php.ini && \ + +# Install glastopf from git + git clone --depth=1 https://github.com/mushorg/glastopf.git /opt/glastopf && \ + cd /opt/glastopf && \ + cp /root/dist/requirements.txt . && \ + pip install --no-cache-dir . && \ + cd / && \ + rm -rf /opt/glastopf /tmp/* /var/tmp/* && \ + setcap cap_net_bind_service=+ep /usr/bin/python2.7 && \ + +# Setup user, groups and configs + addgroup -g 2000 glastopf && \ + adduser -S -H -u 2000 -D -g 2000 glastopf && \ + mkdir -p /etc/glastopf && \ + mv /root/dist/glastopf.cfg /etc/glastopf/ && \ + +# Clean up + apk del --purge autoconf \ + build-base \ + file \ + git \ + libffi-dev \ + libxslt-dev \ + php7-dev \ + python-dev \ + py-pip && \ + rm -rf /root/* && \ + rm -rf /var/cache/apk/* + +# Set workdir and start glastopf +USER glastopf:glastopf +WORKDIR /tmp/glastopf/ +CMD cp /etc/glastopf/glastopf.cfg /tmp/glastopf && exec glastopf-runner