-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release-2.17.0' into stable
- Loading branch information
Showing
10 changed files
with
110 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
NAME = osixia/piwik | ||
VERSION = 2.16.5 | ||
VERSION = 2.17.0 | ||
|
||
all: build | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ FROM osixia/web-baseimage:0.1.11 | |
MAINTAINER Bertrand Gouny <[email protected]> | ||
|
||
# Piwik version | ||
ENV PIWIK_VERSION 2.16.5 | ||
ENV PIWIK_VERSION 2.17.0 | ||
|
||
# MariaDB version | ||
ENV MARIADB_MAJOR 10.1 | ||
|
@@ -27,6 +27,7 @@ RUN apt-get update \ | |
&& LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ | ||
ca-certificates \ | ||
curl \ | ||
mariadb-client-$MARIADB_MAJOR \ | ||
php5-cli \ | ||
php5-curl \ | ||
php5-gd \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash -e | ||
|
||
# get database name, user and password from configuration | ||
# /!\ configuration must use simple quote :) | ||
# and it's a bad idea to have " in your username, password and database name | ||
dbParams=$(sed -n '/\[database\]/,/\[/{/\[database\]/n;/\[/!{/#*\s*\s*=.*/p}}' /var/www/piwik/config/config.ini.php) | ||
host=$(echo $dbParams | sed -n "s/.*host\s*=\s*\"\(.*\)/\1/p" | sed "s/\".*//g") | ||
databaseUser=$(echo $dbParams | sed -n "s/.*username\s*=\s*\"\(.*\)/\1/p" | sed "s/\".*//g") | ||
databasePassword=$(echo $dbParams | sed -n "s/.*password\s*=\s*\"\(.*\)/\1/p" | sed "s/\".*//g") | ||
database=$(echo $dbParams | sed -n "s/.*dbname\s*=\s*\"\(.*\)/\1/p" | sed "s/\".*//g") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,34 @@ | ||
#!/bin/bash -e | ||
|
||
# Usage: /sbin/mail-restore file | ||
file=$1 | ||
# Usage: /sbin/piwik-restore file [file] ... | ||
backupPath="/data/backup" | ||
backupFileSuffix="-piwik.tar.gz" | ||
backupDbSuffix="-piwik-db.tar.gz" | ||
databaseFile="database.sql" | ||
|
||
tar -xzf $backupPath/$file -C / | ||
for file in "$@" | ||
do | ||
echo "Processing file $file" | ||
|
||
if $(echo "$file" | grep -q -e "$backupFileSuffix"); then | ||
echo "Restore piwik files" | ||
tar -xvzf $backupPath/$file -C / | ||
echo "done :)" | ||
elif $(echo "$file" | grep -q -e "$backupDbSuffix"); then | ||
echo "Restore piwik database" | ||
. /container/service/backup/assets/tool/piwik-get-db-params | ||
|
||
rm -rf $databaseFile || true | ||
tar -xvzf $backupPath/$file | ||
|
||
mysql -u $databaseUser -p$databasePassword --host $host $database < $databaseFile | ||
|
||
rm -rf $databaseFile | ||
|
||
echo "done :)" | ||
else | ||
echo "Error: Unknown file type" | ||
fi | ||
done | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Add your ldap client certificate, key and CA certificate here | ||
or during docker run mount a data volume with those files to /container/service/ldap-client/assets/certs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash -e | ||
|
||
# set -x (bash debug) if log level is trace | ||
# https://github.com/osixia/docker-light-baseimage/blob/stable/image/tool/log-helper | ||
log-helper level eq trace && set -x | ||
|
||
www_data_homedir=$( getent passwd "www-data" | cut -d: -f6 ) | ||
|
||
FIRST_START_DONE="${CONTAINER_STATE_DIR}/docker-ldap-client-first-start-done" | ||
# container first start | ||
if [ ! -e "$FIRST_START_DONE" ]; then | ||
|
||
if [ "${PIWIK_LDAP_CLIENT_TLS,,}" == "true" ]; then | ||
|
||
# generate a certificate and key if files don't exists | ||
# https://github.com/osixia/docker-light-baseimage/blob/stable/image/service-available/:ssl-tools/assets/tool/ssl-helper | ||
ssl-helper ${LDAP_CLIENT_SSL_HELPER_PREFIX} "${CONTAINER_SERVICE_DIR}/ldap-client/assets/certs/${PIWIK_LDAP_CLIENT_TLS_CRT_FILENAME}" "${CONTAINER_SERVICE_DIR}/ldap-client/assets/certs/${PIWIK_LDAP_CLIENT_TLS_KEY_FILENAME}" "${CONTAINER_SERVICE_DIR}/ldap-client/assets/certs/${PIWIK_LDAP_CLIENT_TLS_CA_CRT_FILENAME}" | ||
|
||
# ldap client config | ||
sed -i --follow-symlinks "s,TLS_CACERT.*,TLS_CACERT ${CONTAINER_SERVICE_DIR}/ldap-client/assets/certs/${PIWIK_LDAP_CLIENT_TLS_CA_CRT_FILENAME},g" /etc/ldap/ldap.conf | ||
echo "TLS_REQCERT $PIWIK_LDAP_CLIENT_TLS_REQCERT" >> /etc/ldap/ldap.conf | ||
cp -f /etc/ldap/ldap.conf ${CONTAINER_SERVICE_DIR}/ldap-client/assets/ldap.conf | ||
|
||
[[ -f "$www_data_homedir/.ldaprc" ]] && rm -f $www_data_homedir/.ldaprc | ||
echo "TLS_CERT ${CONTAINER_SERVICE_DIR}/ldap-client/assets/certs/${PIWIK_LDAP_CLIENT_TLS_CRT_FILENAME}" > $www_data_homedir/.ldaprc | ||
echo "TLS_KEY ${CONTAINER_SERVICE_DIR}/ldap-client/assets/certs/${PIWIK_LDAP_CLIENT_TLS_KEY_FILENAME}" >> $www_data_homedir/.ldaprc | ||
cp -f $www_data_homedir/.ldaprc ${CONTAINER_SERVICE_DIR}/ldap-client/assets/.ldaprc | ||
|
||
chown www-data:www-data -R ${CONTAINER_SERVICE_DIR}/ldap-client/assets/certs/ | ||
fi | ||
|
||
touch $FIRST_START_DONE | ||
fi | ||
|
||
ln -sf ${CONTAINER_SERVICE_DIR}/ldap-client/assets/.ldaprc $www_data_homedir/.ldaprc | ||
ln -sf ${CONTAINER_SERVICE_DIR}/ldap-client/assets/ldap.conf /etc/ldap/ldap.conf | ||
|
||
exit 0 |