forked from I2P_Developers/i2p.www
Enable the use of Docker+Apache2 to host the site, HTTP only. HTTPS sites should use a reverse proxy
This commit is contained in:
37
Dockerfile
Normal file
37
Dockerfile
Normal file
@ -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
|
@ -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)
|
||||
|
18
etc/apache2.i2p.conf
Normal file
18
etc/apache2.i2p.conf
Normal file
@ -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>
|
7
site-updater-docker.sh
Executable file
7
site-updater-docker.sh
Executable file
@ -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
|
Reference in New Issue
Block a user