Skip to content

Commit

Permalink
Merge branch 'release-3.1.1' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
BertrandGouny committed Oct 12, 2017
2 parents 3007987 + be4a76f commit d958f88
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 3.1.1
- Piwik 3.1.1
- Add PIWIK_FORCE_UPDATE environment variable

## 3.1.0
- Piwik 3.1.0
- Add opcache config
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NAME = osixia/piwik
VERSION = 3.1.0
VERSION = 3.1.1

.PHONY: build build-nocache test tag-latest push push-latest release git-tag-version

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

[hub]: https://hub.docker.com/r/osixia/piwik/

Latest release: 3.1.0 - Piwik 3.1.0 - [Changelog](CHANGELOG.md) | [Docker Hub](https://hub.docker.com/r/osixia/piwik/) 
Latest release: 3.1.1 - Piwik 3.1.1 - [Changelog](CHANGELOG.md) | [Docker Hub](https://hub.docker.com/r/osixia/piwik/) 

**A docker image to run Piwik.**
> [piwik.org](https://piwik.org)
Expand Down
5 changes: 3 additions & 2 deletions image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM osixia/web-baseimage:1.1.0
MAINTAINER Bertrand Gouny <[email protected]>

# Piwik version
ARG PIWIK_VERSION=3.1.0
ARG PIWIK_VERSION=3.1.1

# MariaDB version
ARG MARIADB_MAJOR=10.2
Expand Down Expand Up @@ -41,9 +41,10 @@ RUN apt-get update \
&& curl -o piwik.tar.gz -SL https://builds.piwik.org/piwik-${PIWIK_VERSION}.tar.gz \
&& mkdir -p /var/www/piwik_bootstrap /var/www/piwik \
&& tar -xzf piwik.tar.gz --strip 1 -C /var/www/piwik_bootstrap \
&& echo "${PIWIK_VERSION}" > /var/www/piwik_bootstrap/VERSION \
&& curl -fsSL -o /var/www/piwik_bootstrap/misc/GeoIPCity.dat.gz https://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz \
&& gunzip /var/www/piwik_bootstrap/misc/GeoIPCity.dat.gz \
&& apt-get remove -y --purge --auto-remove curl ca-certificates \
&& apt-get remove -y --purge --auto-remove curl \
&& rm piwik.tar.gz \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Expand Down
2 changes: 2 additions & 0 deletions image/environment/default.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
PIWIK_FORCE_UPDATE: false # if piwik image version is > current version the image version will be installed

PIWIK_BACKUP_CRON_EXP: 30 4 * * * #every day at 4:30am
PIWIK_BACKUP_TTL: 15 # Delete backups that are over 15 days

Expand Down
34 changes: 27 additions & 7 deletions image/service/piwik/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,16 @@ if [ "${PIWIK_HTTPS,,}" == "true" ]; then
sed -i "s/#SSLCACertificateFile/SSLCACertificateFile/g" ${CONTAINER_SERVICE_DIR}/piwik/assets/apache2/https.conf
fi

ln -sf ${CONTAINER_SERVICE_DIR}/piwik/assets/apache2/https.conf /etc/apache2/sites-available/piwik-ssl.conf
a2ensite piwik-ssl | log-helper debug

ln -sf ${CONTAINER_SERVICE_DIR}/piwik/assets/apache2/https.conf /etc/apache2/sites-available/piwik.conf
#
# HTTP config
#
else
log-helper info "Set apache2 http config..."
ln -sf ${CONTAINER_SERVICE_DIR}/piwik/assets/apache2/http.conf /etc/apache2/sites-available/piwik.conf
fi
# unable http no matter what :)
ln -sf ${CONTAINER_SERVICE_DIR}/piwik/assets/apache2/http.conf /etc/apache2/sites-available/piwik.conf

a2ensite piwik | log-helper debug

#
# Reverse proxy config
Expand All @@ -41,8 +40,6 @@ if [ "${PIWIK_TRUST_PROXY_SSL,,}" == "true" ]; then
echo 'SetEnvIf X-Forwarded-Proto "^https$" HTTPS=on' > /etc/apache2/mods-enabled/remoteip_ssl.conf
fi

a2ensite piwik | log-helper debug

#
# Piwik directory is empty, we use the bootstrap
#
Expand All @@ -54,6 +51,29 @@ if [ ! "$(ls -A -I lost+found /var/www/piwik)" ]; then
rm -rf /var/www/piwik_bootstrap
fi

#
#
#
if [ "${PIWIK_FORCE_UPDATE,,}" == "true" ]; then
CURRENT_VERSION=""

# test if new version need to be installed
IMAGE_VERSION=$(cat /var/www/piwik_bootstrap/VERSION)
[ -e "/var/www/piwik/VERSION" ] && CURRENT_VERSION=$(cat /var/www/piwik/VERSION)

log-helper info "Check Piwik versions..."
log-helper info "Docker image version: ${IMAGE_VERSION}"
log-helper info "Current version: ${CURRENT_VERSION}"

if [ "${IMAGE_VERSION}" != "${CURRENT_VERSION}" ]; then
log-helper info "Remove current files (except config.ini.php and plugins)..."
find /var/www/piwik -mindepth 1 -maxdepth 1 \( -path /var/www/piwik/config -o -path /var/www/piwik/plugins \) -prune -o -exec rm -rf {} + || true
find /var/www/piwik/config -mindepth 1 -maxdepth 1 \( -path /var/www/piwik/config/config.ini.php \) -prune -o -exec rm -rf {} + || true

log-helper info "Add image files..."
cp -Rf /var/www/piwik_bootstrap/. /var/www/piwik
fi
fi

# if there is no config
if [ ! -e "/var/www/piwik/config/config.ini.php" ] && [ -e "${CONTAINER_SERVICE_DIR}/piwik/assets/config/config.ini.php" ]; then
Expand Down

0 comments on commit d958f88

Please sign in to comment.