Move setup process via script into container (#2174)

Decoupling setup process from `setup.sh` script by introducing a setup script _inside_ the container that coordinates the setup process.

**This is not a breaking change**. This way, we do not have to keep track of versions of `setup.sh`.

This change brings the additional benefit for Kubernetes users to be able to make use of `setup` now, without the need for `setup.sh`.

---

* move setup process into container; setup.sh versioning not needed anymore

* add tilde functionality to docs

Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
Co-authored-by: Casper <casperklein@users.noreply.github.com>
This commit is contained in:
Georg Lauterbach 2021-09-12 01:29:02 +02:00 committed by GitHub
parent c267d8a990
commit c7e4981945
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 285 additions and 296 deletions

View file

@ -1,7 +1,7 @@
---
title: Your best friend setup.sh
hide:
- toc # Hide Table of Contents for this page
- toc
---
[`setup.sh`][github-file-setupsh] is an administration script that helps with the most common tasks, including initial configuration. It is intended to be used from the host machine, _not_ from within your running container.
@ -13,13 +13,9 @@ wget https://raw.githubusercontent.com/docker-mailserver/docker-mailserver/maste
chmod a+x ./setup.sh
```
!!! info
Make sure to get the `setup.sh` that comes with the release you're using. Look up the release and the git commit on which this release is based upon by selecting the appropriate tag on GitHub. This can done with the "Switch branches/tags" button on GitHub, choosing the right tag. This is done in order to rule out possible inconsistencies between versions.
## Usage
Run `./setup.sh help` and you'll get some usage information:
Run `./setup.sh help` and you'll get ~~all you have ever wanted~~ some usage information:
```TXT
SETUP(1)
@ -55,28 +51,6 @@ VERSION
following URL, where TAG looks like 'vX.X.X':
https://raw.githubusercontent.com/docker-mailserver/docker-mailserver/TAG/setup.sh
OPTIONS
Config path, container or image adjustments
-i IMAGE_NAME
Provides the name of the docker-mailserver image. The default value is
docker.io/mailserver/docker-mailserver:latest
-c CONTAINER_NAME
Provides the name of the running container.
-p PATH
Provides the config folder path. The default is
/home/maxwell/Dokumente/github/docker-mailserver/config/
SELinux
-z
Allows container access to the bind mount content that is shared among
multiple containers on a SELinux-enabled host.
-Z
Allows container access to the bind mount content that is private and
unshared with other containers on a SELinux-enabled host.
[SUB]COMMANDS
COMMAND email :=
./setup.sh email add <EMAIL ADDRESS> [<PASSWORD>]
@ -122,6 +96,28 @@ EXAMPLES
This will provide you with a detailed explanation on how to use the
config dkim command, showing what arguments can be passed and what they do.
OPTIONS
Config path, container or image adjustments
-i IMAGE_NAME
Provides the name of the docker-mailserver image. The default value is
docker.io/mailserver/docker-mailserver:latest
-c CONTAINER_NAME
Provides the name of the running container.
-p PATH
Provides the config folder path to the temporary container
(does not work if docker-mailserver container already exists).
SELinux
-z
Allows container access to the bind mount content that is shared among
multiple containers on a SELinux-enabled host.
-Z
Allows container access to the bind mount content that is private and
unshared with other containers on a SELinux-enabled host.
EXIT STATUS
Exit status is 0 if the command was successful. If there was an unexpected error, an error
message is shown describing the error. In case of an error, the script will exit with exit