Skip to content

Commit

Permalink
Merge branch 'release-1.2.3' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
BertrandGouny committed Jan 21, 2019
2 parents 43cd3c5 + 51f5fce commit f81b07e
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 11 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project follows [osixia/openldap](https://github.com/osixia/docker-openldap-backup) versioning.

## [1.2.3] - 2019-01-21
### Added
- Option to upload backups to S3 #7

### Changed
- Upgrade baseimage to openldap:1.2.3

## [1.2.2] - 2018-09-04
### Changed
- Upgrade baseimage to openldap:1.2.2
Expand Down Expand Up @@ -95,6 +102,8 @@ and this project follows [osixia/openldap](https://github.com/osixia/docker-open
## 0.1.0 - 2015-07-24
Initial release

[1.2.3]: https://github.com/osixia/docker-openldap-backup/compare/v1.2.2...v1.2.3
[1.2.2]: https://github.com/osixia/docker-openldap-backup/compare/v1.2.1...v1.2.2
[1.2.1]: https://github.com/osixia/docker-openldap-backup/compare/v1.2.0...v1.2.1
[1.2.0]: https://github.com/osixia/docker-openldap-backup/compare/v1.1.11...v1.2.0
[1.1.11]: https://github.com/osixia/docker-openldap-backup/compare/v1.1.10...v1.1.11
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/openldap-backup
VERSION = 1.2.2
VERSION = 1.2.3

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

Expand Down
18 changes: 9 additions & 9 deletions 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/openldap-backup/

Latest release: 1.2.2 - [Changelog](CHANGELOG.md) | [Docker Hub](https://hub.docker.com/r/osixia/openldap-backup/) 
Latest release: 1.2.3 - [Changelog](CHANGELOG.md) | [Docker Hub](https://hub.docker.com/r/osixia/openldap-backup/) 

**A docker image to run OpenLDAP, and make periodic backups.**

Expand All @@ -20,7 +20,7 @@ Latest release: 1.2.2 - [Changelog](CHANGELOG.md) | [Docker Hub](https://hub.do
- [Link environment file](#link-environment-file)
- [Make your own image or extend this image](#make-your-own image-or-extend-this-image)
- [Advanced User Guide](#advanced-user-guide)
- [Extend osixia/openldap-backup:1.2.2 image](#extend-osixiaopenldap-backup122-image)
- [Extend osixia/openldap-backup:1.2.3 image](#extend-osixiaopenldap-backup123-image)
- [Make your own phpLDAPadmin image](#make-your-own-phpldapadmin-image)
- [Tests](#tests)
- [Kubernetes](#kubernetes)
Expand Down Expand Up @@ -49,7 +49,7 @@ Backups are created in the directory `/data/backup` that should be mapped has vo

docker run --env LDAP_BACKUP_CONFIG_CRON_EXP="0 5 * * *" \
--volume /data/openldap/backup:/data/backup \
--detach osixia/openldap-backup:1.2.2
--detach osixia/openldap-backup:1.2.3


For more information about docker data volume, please refer to :
Expand All @@ -63,11 +63,11 @@ Available levels are: `none`, `error`, `warning`, `info`, `debug` and `trace`.

Example command to run the container in `debug` mode:

docker run --detach osixia/openldap-backup:1.2.2 --loglevel debug
docker run --detach osixia/openldap-backup:1.2.3 --loglevel debug

See all command line options:

docker run osixia/openldap-backup:1.2.2 --help
docker run osixia/openldap-backup:1.2.3 --help


## Environment Variables
Expand All @@ -89,15 +89,15 @@ See how to [set your own environment variables](#set-your-own-environment-variab
Environment variables can be set by adding the --env argument in the command line, for example:

docker run --env LDAP_BACKUP_CONFIG_CRON_EXP="0 5 * * *" \
--detach osixia/openldap-backup:1.2.2
--detach osixia/openldap-backup:1.2.3


#### Link environment file

For example if your environment file is in : /data/ldap/environment/my-env.yaml

docker run --volume /data/ldap/environment/my-env.yaml:/container/environment/01-custom/env.yaml \
--detach osixia/openldap-backup:1.2.2
--detach osixia/openldap-backup:1.2.3

Take care to link your environment file to `/container/environment/XX-somedir` (with XX < 99 so they will be processed before default environment files) and not directly to `/container/environment` because this directory contains predefined baseimage environment files to fix container environment (INITRD, LANG, LANGUAGE and LC_CTYPE).

Expand All @@ -107,13 +107,13 @@ This is the best solution if you have a private registry. Please refer to the [A

## Advanced User Guide

### Extend osixia/openldap-backup:1.2.2 image
### Extend osixia/openldap-backup:1.2.3 image

If you need to add your custom environment files you can extends this image.

Dockerfile example:

FROM osixia/openldap-backup:1.2.2
FROM osixia/openldap-backup:1.2.3
MAINTAINER Your Name <[email protected]>

ADD environment /container/environment/01-custom
Expand Down
3 changes: 2 additions & 1 deletion image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
FROM osixia/openldap:1.2.2
FROM osixia/openldap:1.2.3

# Install cron from baseimage and remove .cfss and slapd services inherited from openldap image
# remove also previous default environment files, they are not needed.
# sources: https://github.com/osixia/docker-light-baseimage/blob/stable/image/tool/add-service-available
#  https://github.com/osixia/docker-light-baseimage/blob/stable/image/service-available/:cron/download.sh
RUN apt-get -y update \
&& /container/tool/add-multiple-process-stack \
&& apt-get install -y awscli \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

Expand Down
4 changes: 4 additions & 0 deletions image/environment/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ LDAP_BACKUP_DATA_CRON_EXP: 0 4 * * *

# Delete backups that are over 15 days
LDAP_BACKUP_TTL: 15

# Upload backups to S3
UPLOAD_TO_S3: false
S3_PATH: bucket/key-folder
6 changes: 6 additions & 0 deletions image/service/slapd-backup/assets/tool/slapd-backup
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,10 @@ backupFilePath="$backupPath/$(date "$dateFileFormat")-$filename.gz"
/usr/sbin/slapcat -F /etc/ldap/slapd.d -n $dbnum | gzip > $backupFilePath
chmod 600 $backupFilePath

if [[ "$UPLOAD_TO_S3" == "true" ]]; then
# Upload backup to S3. The backupFilePath is the config backup file path
aws s3 cp $backupFilePath s3://${S3_PATH}/
echo "Upload successful"
fi

exit 0

0 comments on commit f81b07e

Please sign in to comment.