Clear up env format and hostname value (#1076)

* Describe format for .env in README
* Display used domain and hostname even when they are not acceptable
This should be clearer for the user when the hostname was set incorrectly.
This commit is contained in:
Daniel Panteleit 2018-11-11 20:46:53 +01:00 committed by Johan Smits
parent cc56b4f89e
commit 0fb4a6d082
2 changed files with 6 additions and 2 deletions

View File

@ -63,6 +63,9 @@ Download the docker-compose.yml, the .env and the setup.sh files:
#### Create a docker-compose environment
- Edit the `.env` to your liking. Adapt this file with your FQDN.
- This file supports only simple `VAR=VAL` lines (see [Documentation](https://docs.docker.com/compose/env-file/)).
- Don't quote your values.
- Variable substitution is *not* supported (e.g. `OVERRIDE_HOSTNAME=$HOSTNAME.$DOMAINNAME`).
- Install [docker-compose](https://docs.docker.com/compose/) in the version `1.6` or higher.
#### Start Container

View File

@ -387,12 +387,13 @@ function _check_hostname() {
export DOMAINNAME=$(echo $HOSTNAME | sed s/[^.]*.//)
fi
notify 'inf' "Domain has been set to $DOMAINNAME"
notify 'inf' "Hostname has been set to $HOSTNAME"
if ( ! echo $HOSTNAME | grep -E '^(\S+[.]\S+)$' > /dev/null ); then
notify 'err' "Setting hostname/domainname is required"
kill `cat /var/run/supervisord.pid` && return 1
else
notify 'inf' "Domain has been set to $DOMAINNAME"
notify 'inf' "Hostname has been set to $HOSTNAME"
return 0
fi
}