Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using this image and importing ENV for TTL and CRON it puts and "=" at the end thus setting the ENV improperly #16

Open
scrummie02 opened this issue May 10, 2023 · 1 comment

Comments

@scrummie02
Copy link

scrummie02 commented May 10, 2023

When setting the following in an ENV file and using compose like so:

openldap:
    image: osixia/openldap-backup:1.5.0
    hostname: ldap1.example.com
    volumes:
      - /path/to/ldap_db:/var/lib/ldap
      - /path/to/ldap_config:/etc/ldap/slapd.d
      - /path/to/data/backup:/data/backup
    environment:
      - LDAP_ORGANISATION=example-com
      - LDAP_DOMAIN=example.com
      - LDAP_ADMIN_PASSWORD=verysecretadminpassword
      - LDAP_CONFIG_PASSWORD=verysecretconfigpassword
      - LDAP_RFC2307BIS_SCHEMA=true
      - LDAP_REMOVE_CONFIG_AFTER_SETUP=true
      - LDAP_TLS_VERIFY_CLIENT=never
      - LDAP_BACKEND=mdb
      #- LDAP_REPLICATION=true
    env_file:
      - .env
    ports:
      - "389:389"
      - "636:636"
    networks:
      - openldap

And using this in the .env file

# Backup config and data every day at 4:00am
LDAP_BACKUP_CONFIG_CRON_EXP: 0 4 * * *
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

It sets up an file called /container/run/environment.sh

After looking at the file because the backup jobs don't run I see this
export LDAP_BACKUP_TTL=15=
export LDAP_BACKUP_DATA_CRON_EXP='0 4 * * *='
...
export S3_PATH=bucket/key-folder=
export LDAP_BACKUP_CONFIG_CRON_EXP='0 4 * * *='

I had to update apt and install nano/vi whatever and edit envrionment.sh and run again. It seems like the parsing throws in an "=" at the end of those variables...but just those ones, the other ones are fine. So if I had an S3 backups for example the folder wouldn't be reachable because of the "=" being parsed.

@koelle25
Copy link

Thats because in an env-file you have to use the VARIABLE=VALUE syntax, not VARIABLE: VALUE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants