diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..06c2d5eec66b4a3b186081c9fc27b237f1fb6c00 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,37 @@ +FROM debian:stable +ENV SERVERNAME=geti2p.net +ENV SERVERMAIL=example@geti2p.net + +ADD . /var/www/i2p.www + +WORKDIR /var/www/i2p.www + + ## Install the dependencies +RUN apt-get update && \ + apt-get -y install apache2 apache2-utils libapache2-mod-wsgi python2-dev python-pip patch python-virtualenv git && \ + ## Start setting up the site + virtualenv --distribute env && \ + . env/bin/activate && \ + pip install -r etc/reqs.txt && \ + patch -p0 -N -r - <etc/multi-domain.patch && \ + ./compile-messages.sh && \ + echo "Git revision: $(git log -n 1 | grep commit | sed 's/commit //' | sed 's/ .*$//')" | tee ./i2p2www/pages/include/mtnversion && \ + ## We've now updated the site + ## Next let's configure WSGI + ## Set ownership of site to server + cp etc/docker.i2p.wsgi i2p.wsgi && \ + chown -R www-data /var/www/i2p.www && \ + ## Make the WSGI script owned by the server + chown www-data:www-data /var/www/i2p.www/i2p.wsgi && \ + ## Make the WSGI script executable + chmod 755 /var/www/i2p.www/i2p.wsgi && \ + ## Copy the unmodified vhosts file to the apache2 confdir + cp etc/apache2.i2p.conf /etc/apache2/sites-available/i2p.conf && \ + a2enmod wsgi && \ + a2ensite i2p && \ + ls /etc/apache2 && \ + sed -i 's|IncludeOptional sites-enabled|# IncludeOptional sites-enabled|g' /etc/apache2/apache2.conf && \ + sed -i '1 i\IncludeOptional sites-enabled/i2p.conf' /etc/apache2/apache2.conf && \ + cat /etc/apache2/apache2.conf + +CMD service apache2 restart && tail -f /var/log/apache2/access.log diff --git a/README.md b/README.md index 82eb5b71d8cf0bcb3064a281f4eba99541b995df..d4b3271e98576056bced11debe1b59aac0aadd86 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ To run locally (for testing purposes): - Pull in the dependencies: ``` - $ proxychains ./setup_venv.sh + $ proxychains ./setup_venv.qsh ``` (you can also pull them non-anon by leaving out proxychains) diff --git a/etc/apache2.i2p.conf b/etc/apache2.i2p.conf new file mode 100644 index 0000000000000000000000000000000000000000..783da09a8c3622952289f78e5aeed5eb3e2765b4 --- /dev/null +++ b/etc/apache2.i2p.conf @@ -0,0 +1,18 @@ +<VirtualHost *:80> + #change ServerName and ServerAdmin to your own. + ServerName www.geti2p.net + ServerAdmin example@geti2p.net + DocumentRoot /var/www/i2p.www + WSGIDaemonProcess i2p2www user=www-data group=www-data threads=2 + WSGIScriptAlias / /var/www/i2p.www/i2p.wsgi + + <Directory /var/www/i2p.www/> + WSGIProcessGroup i2p2www + WSGIApplicationGroup %{GLOBAL} + WSGIScriptReloading On + </Directory> + + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + +</VirtualHost> diff --git a/site-updater-docker.sh b/site-updater-docker.sh new file mode 100755 index 0000000000000000000000000000000000000000..3e3c3d40ef016547c61be96a1299f774fe75af11 --- /dev/null +++ b/site-updater-docker.sh @@ -0,0 +1,7 @@ +#! /usr/bin/env sh + +git pull origin master +docker build -t i2p-mirror/i2p.www . +docker rm -f mirror.i2p.www +docker run -it --name mirror.i2p.www -p 0.0.0.0:8090:80 i2p-mirror/i2p.www +#docker run -td --name mirror.i2p.www --restart=always -p 0.0.0.0:5000:5000 i2p-mirror/i2p.www