...
 
Commits (6)
......@@ -6,6 +6,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.3.0] - 2018-06-26
### Added
- proxy_wstunnel enabled in Apache, so WebSocket has a chance to work
### Fixed
- Error in documentation
### Changed
- is-running is safer to use
- The stop command always tries to remove the container, whatever is-running says
## [1.2.0] - 2018-04-08
### Added
......
......@@ -96,23 +96,24 @@ In the *vhosts* directory, add a file containing:
# The line below is a directive for SLARP so http://my-great-website/ (port 80 of a local container) can be reached.
#:resolve-container:my-great-website
<VirtualHost *:443>
ServerName www.my-great-website.org
SSLEngine on
SSLCertificateKeyFile /etc/letsencrypt/live/www.my-great-website.org/privkey.pem
SSLCertificateFile /etc/letsencrypt/live/www.my-great-website.org/fullchain.pem
# Some backends need something like this, so they know that the original request was a HTTPS request.
RequestHeader set X-Forwarded-Proto "https"
ProxyPass / http://my-great-website/
ProxyPassReverse / http://my-great-website/
ProxyPreserveHost On
ErrorLog ${APACHE_LOG_DIR}/my-great-website.error.log
CustomLog ${APACHE_LOG_DIR}/my-great-website.access.log combined
</VirtualHost>
# For now the section below has to be commented, uncomment it only after LE certs are generated.
#<VirtualHost *:443>
# ServerName www.my-great-website.org
#
# SSLEngine on
# SSLCertificateKeyFile /etc/letsencrypt/live/www.my-great-website.org/privkey.pem
# SSLCertificateFile /etc/letsencrypt/live/www.my-great-website.org/fullchain.pem
#
# # Some backends need something like this, so they know that the original request was a HTTPS request.
# RequestHeader set X-Forwarded-Proto "https"
#
# ProxyPass / http://my-great-website/
# ProxyPassReverse / http://my-great-website/
# ProxyPreserveHost On
#
# ErrorLog ${APACHE_LOG_DIR}/my-great-website.error.log
# CustomLog ${APACHE_LOG_DIR}/my-great-website.access.log combined
#</VirtualHost>
```
Notes:
* The internal `${APACHE_LOG_DIR}` directory is bound to the external Apache logs directory you have probably customized via the external `APACHE_LOGS_DIR` variable; I recommend to use it.
......@@ -134,6 +135,8 @@ No other command required, you can [ctrl][d] the SLARP environment.
### 6- Apply your changes
You can now uncomment the VirtualHost bloc in your xxx-my-great-website.conf.
Once you have made changes in the *vhosts* directory, run
```
# ./reload
......
......@@ -4,7 +4,7 @@ FROM $BASE_IMAGE
LABEL maintainer="zareldyn" \
description="A simple HTTP(S) reverse proxy based on Apache and Let's Encrypt."
ENV SLARP_VERSION="1.2.0"
ENV SLARP_VERSION="1.3.0"
RUN ["/bin/bash", "-c", " \
apt-get update && \
......@@ -13,7 +13,7 @@ RUN ["/bin/bash", "-c", " \
cron && \
apt-get install -t stretch-backports -y \
python-certbot-apache && \
a2enmod headers rewrite ssl proxy proxy_http && \
a2enmod headers rewrite ssl proxy proxy_http proxy_wstunnel && \
a2dissite 000-default.conf && \
sed -i s/www-data/$MAIN_USER_LOGIN/ /etc/apache2/envvars && \
rm -rf /var/lib/apt/lists/* \
......
......@@ -9,7 +9,10 @@ function say_no {
service docker status &>/dev/null || say_no
docker ps | grep -q " $APP_NAME$"
[ $? -eq 0 ] || say_no
status=$(docker inspect -f='{{.State.Status}}' "$APP_NAME" 2>/dev/null)
[ "$status" == "running" ] && {
echo "yes"
exit
}
echo "yes"
say_no
......@@ -3,10 +3,18 @@ SELF_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
APP_NAME=$(basename "$SELF_DIR")
[ $(. "$SELF_DIR"/is-running) == "yes" ] || {
echo "$APP_NAME is already stopped"
exit
docker inspect -f='{{.State.Status}}' "$APP_NAME" &>/dev/null
[ $? -ne 0 ] && {
echo "$APP_NAME is already stopped"
exit
}
}
docker stop $APP_NAME >/dev/null && \
docker rm $APP_NAME >/dev/null && \
echo "$APP_NAME stopped"
docker stop $APP_NAME >/dev/null
docker rm -f $APP_NAME >/dev/null && {
echo "$APP_NAME stopped"
exit
}
echo "Error while trying to remove $APP_NAME container" >&2
exit 1