finish heimdall integration

This commit is contained in:
t3chn0m4g3 2020-01-27 17:03:44 +00:00
parent 1167231560
commit 33222a92b6
9 changed files with 30 additions and 6 deletions

View file

@ -33,33 +33,40 @@ RUN sed -i 's/dl-cdn/dl-2/g' /etc/apk/repositories && \
cd /var/lib/nginx/html && \
cp .env.example .env && \
php artisan key:generate && \
#
## Add previously configured content
mkdir -p /var/lib/nginx/html/storage/app/public/backgrounds/ && \
cp /root/dist/app/bg1.jpg /var/lib/nginx/html/public/img/bg1.jpg && \
cp /root/dist/app/t-pot.png /var/lib/nginx/html/public/img/heimdall-icon-small.png && \
cp /root/dist/app/app.sqlite /var/lib/nginx/html/database/app.sqlite && \
cp /root/dist/app/cyberchef.png /var/lib/nginx/html/storage/app/public/icons/ZotKKZA2QKplZhdoF3WLx4UdKKhLFamf3lSMcLkr.png && \
cp /root/dist/app/eshead.png /var/lib/nginx/html/storage/app/public/icons/77KqFv4YIshXUDLDoOvZ1NUbsKDtsMAjJvg4sYqN.png && \
cp /root/dist/app/tsec.png /var/lib/nginx/html/storage/app/public/icons/RHwXCfCeGNDdhYgzlShL9o4NBFL2LHZWajgyeL0a.png && \
cp /root/dist/app/spiderfoot.png /var/lib/nginx/html/storage/app/public/icons/eIllmzavE52rNpg9CBoMg1tymHjEOgUnSTHuBwzc.png && \
cp /root/dist/app/spiderfoot.png /var/lib/nginx/html/storage/app/public/icons/s7uPe1frJqjv76oI6SNqNbWUsgU1GHYqRALMlwYb.png && \
cp /root/dist/html/*.html /var/lib/nginx/html/public/ && \
cp /root/dist/html/favicon.ico /var/lib/nginx/html/public/favicon-16x16.png && \
cp /root/dist/html/favicon.ico /var/lib/nginx/html/public/favicon-32x32.png && \
cp /root/dist/html/favicon.ico /var/lib/nginx/html/public/favicon-96x96.png && \
cp /root/dist/html/favicon.ico /var/lib/nginx/html/public/favicon.ico && \
#
## Change ownership, permissions
chown root:www-data -R /var/lib/nginx/html && \
chmod 775 -R /var/lib/nginx/html/storage && \
chmod 775 -R /var/lib/nginx/html/database && \
sed -i "s/user = nobody/user = nginx/g" /etc/php7/php-fpm.d/www.conf && \
sed -i "s/group = nobody/group = nginx/g" /etc/php7/php-fpm.d/www.conf && \
sed -i "s#;upload_tmp_dir =#upload_tmp_dir = /var/lib/nginx/tmp#g" /etc/php7/php.ini && \
sed -i "s/9000/64304/g" /etc/php7/php-fpm.d/www.conf && \
sed -i "s/APP_NAME=Heimdall/APP_NAME=T-Pot/g" /var/lib/nginx/html/.env && \
#mkdir -p /run/nginx && \
## Add Nginx / T-Pot specific configs
rm -rf /etc/nginx/conf.d/* /usr/share/nginx/html/* && \
cp /root/dist/conf/nginx.conf /etc/nginx/ && \
cp -R /root/dist/conf/ssl /etc/nginx/ && \
cp /root/dist/conf/tpotweb.conf /etc/nginx/conf.d/ && \
cp /root/dist/start.sh / && \
## Pack database for first time usage
cd /var/lib/nginx && \
tar cvfz first.tgz /var/lib/nginx/html/database /var/lib/nginx/html/storage && \
#
# Clean up
apk del --purge \
@ -68,4 +75,4 @@ RUN sed -i 's/dl-cdn/dl-2/g' /etc/apk/repositories && \
rm -rf /var/cache/apk/*
#
# Start nginx
CMD php-fpm7 && exec nginx -g 'daemon off;'
CMD /start.sh && php-fpm7 && exec nginx -g 'daemon off;'

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 606 KiB

After

Width:  |  Height:  |  Size: 510 KiB

BIN
docker/heimdall/dist/app/eshead.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5 KiB

10
docker/heimdall/dist/start.sh vendored Executable file
View file

@ -0,0 +1,10 @@
#!/bin/ash
if [ "$(ls /var/lib/nginx/html/database)" = "" ] && [ "$HEIMDALL_PERSIST" = "YES" ];
then
tar xvfz /var/lib/nginx/first.tgz -C /
fi
if [ "$HEIMDALL_PERSIST" = "YES" ];
then
chmod 770 -R /var/lib/nginx/html/database /var/lib/nginx/html/storage
chown root:www-data -R /var/lib/nginx/html/database /var/lib/nginx/html/storage
fi

View file

@ -7,6 +7,10 @@ services:
build: .
container_name: nginx
restart: always
environment:
### If set to YES all changes within Heimdall will remain for the next start
### Make sure to uncomment the corresponding volume statements below, or the setting will prevent a successful start of T-Pot.
- HEIMDALL_PERSIST=NO
tmpfs:
- /var/tmp/nginx/client_body
- /var/tmp/nginx/proxy
@ -15,7 +19,7 @@ services:
- /var/tmp/nginx/scgi
- /run
- /var/log/php7/
- /var/lib/nginx/tmp/:uid=100,gid=82
- /var/lib/nginx/tmp:uid=100,gid=82
- /var/lib/nginx/html/storage/logs:uid=100,gid=82
- /var/lib/nginx/html/storage/framework/views:uid=100,gid=82
network_mode: "host"
@ -28,3 +32,6 @@ services:
- /data/nginx/cert/:/etc/nginx/cert/:ro
- /data/nginx/conf/nginxpasswd:/etc/nginx/nginxpasswd:ro
- /data/nginx/log/:/var/log/nginx/
### Enable the following volumes if you set HEIMDALL_PERSIST=YES
# - /data/nginx/heimdall/database:/var/lib/nginx/html/database
# - /data/nginx/heimdall/storage:/var/lib/nginx/html/storage

View file

@ -791,7 +791,7 @@ mkdir -p /data/adbhoney/downloads /data/adbhoney/log \
/data/honeypy/log \
/data/mailoney/log \
/data/medpot/log \
/data/nginx/log \
/data/nginx/log /data/nginx/heimdall \
/data/emobility/log \
/data/ews/conf \
/data/rdpy/log \

View file

@ -226,7 +226,7 @@ mkdir -p /data/adbhoney/downloads /data/adbhoney/log \
/data/honeypy/log \
/data/mailoney/log \
/data/medpot/log \
/data/nginx/log \
/data/nginx/log /data/nginx/heimdall \
/data/emobility/log \
/data/ews/conf \
/data/rdpy/log \