diff --git a/edge/config/advanced/auth-ldap/index.html b/edge/config/advanced/auth-ldap/index.html index eeee3f16..ac0a71b5 100644 --- a/edge/config/advanced/auth-ldap/index.html +++ b/edge/config/advanced/auth-ldap/index.html @@ -287,7 +287,7 @@
  • - + Contributing
  • @@ -1430,6 +1430,20 @@ +
  • + + General Information + +
  • + + + + + + + + +
  • Issues and Pull Requests @@ -1439,48 +1453,6 @@ - - - - - -
  • - - Coding Style - -
  • - - - - - - - - - -
  • - - Tests - -
  • - - - - - - - - - -
  • - - Documentation - -
  • - - - - diff --git a/edge/config/advanced/dovecot-master-accounts/index.html b/edge/config/advanced/dovecot-master-accounts/index.html index ae1ed344..3f69988d 100644 --- a/edge/config/advanced/dovecot-master-accounts/index.html +++ b/edge/config/advanced/dovecot-master-accounts/index.html @@ -287,7 +287,7 @@
  • - + Contributing
  • @@ -1382,6 +1382,20 @@ +
  • + + General Information + +
  • + + + + + + + + +
  • Issues and Pull Requests @@ -1391,48 +1405,6 @@ - - - - - -
  • - - Coding Style - -
  • - - - - - - - - - -
  • - - Tests - -
  • - - - - - - - - - -
  • - - Documentation - -
  • - - - - diff --git a/edge/config/advanced/full-text-search/index.html b/edge/config/advanced/full-text-search/index.html index d5c67838..4b11c8d2 100644 --- a/edge/config/advanced/full-text-search/index.html +++ b/edge/config/advanced/full-text-search/index.html @@ -287,7 +287,7 @@
  • - + Contributing
  • @@ -1421,6 +1421,20 @@ +
  • + + General Information + +
  • + + + + + + + + +
  • Issues and Pull Requests @@ -1430,48 +1444,6 @@ - - - - - -
  • - - Coding Style - -
  • - - - - - - - - - -
  • - - Tests - -
  • - - - - - - - - - -
  • - - Documentation - -
  • - - - - diff --git a/edge/config/advanced/ipv6/index.html b/edge/config/advanced/ipv6/index.html index efdcd47f..827da7f9 100644 --- a/edge/config/advanced/ipv6/index.html +++ b/edge/config/advanced/ipv6/index.html @@ -287,7 +287,7 @@
  • - + Contributing
  • @@ -1382,6 +1382,20 @@ +
  • + + General Information + +
  • + + + + + + + + +
  • Issues and Pull Requests @@ -1391,48 +1405,6 @@ - - - - - -
  • - - Coding Style - -
  • - - - - - - - - - -
  • - - Tests - -
  • - - - - - - - - - -
  • - - Documentation - -
  • - - - - diff --git a/edge/config/advanced/kubernetes/index.html b/edge/config/advanced/kubernetes/index.html index 31528b54..96904cdd 100644 --- a/edge/config/advanced/kubernetes/index.html +++ b/edge/config/advanced/kubernetes/index.html @@ -287,7 +287,7 @@
  • - + Contributing
  • @@ -1484,6 +1484,20 @@ +
  • + + General Information + +
  • + + + + + + + + +
  • Issues and Pull Requests @@ -1493,48 +1507,6 @@ - - - - - -
  • - - Coding Style - -
  • - - - - - - - - - -
  • - - Tests - -
  • - - - - - - - - - -
  • - - Documentation - -
  • - - - - diff --git a/edge/config/advanced/mail-fetchmail/index.html b/edge/config/advanced/mail-fetchmail/index.html index 44df3b41..f542b7f8 100644 --- a/edge/config/advanced/mail-fetchmail/index.html +++ b/edge/config/advanced/mail-fetchmail/index.html @@ -287,7 +287,7 @@
  • - + Contributing
  • @@ -1402,6 +1402,20 @@ +
  • + + General Information + +
  • + + + + + + + + +
  • Issues and Pull Requests @@ -1411,48 +1425,6 @@ - - - - - -
  • - - Coding Style - -
  • - - - - - - - - - -
  • - - Tests - -
  • - - - - - - - - - -
  • - - Documentation - -
  • - - - - diff --git a/edge/config/advanced/mail-forwarding/aws-ses/index.html b/edge/config/advanced/mail-forwarding/aws-ses/index.html index e5f534e1..4d88d3f5 100644 --- a/edge/config/advanced/mail-forwarding/aws-ses/index.html +++ b/edge/config/advanced/mail-forwarding/aws-ses/index.html @@ -282,7 +282,7 @@
  • - + Contributing
  • @@ -1336,6 +1336,20 @@ +
  • + + General Information + +
  • + + + + + + + + +
  • Issues and Pull Requests @@ -1345,48 +1359,6 @@ - - - - - -
  • - - Coding Style - -
  • - - - - - - - - - -
  • - - Tests - -
  • - - - - - - - - - -
  • - - Documentation - -
  • - - - - diff --git a/edge/config/advanced/mail-forwarding/relay-hosts/index.html b/edge/config/advanced/mail-forwarding/relay-hosts/index.html index b1f1380a..1d3bac4d 100644 --- a/edge/config/advanced/mail-forwarding/relay-hosts/index.html +++ b/edge/config/advanced/mail-forwarding/relay-hosts/index.html @@ -287,7 +287,7 @@
  • - + Contributing
  • @@ -1411,6 +1411,20 @@ +
  • + + General Information + +
  • + + + + + + + + +
  • Issues and Pull Requests @@ -1420,48 +1434,6 @@ - - - - - -
  • - - Coding Style - -
  • - - - - - - - - - -
  • - - Tests - -
  • - - - - - - - - - -
  • - - Documentation - -
  • - - - - diff --git a/edge/config/advanced/mail-sieve/index.html b/edge/config/advanced/mail-sieve/index.html index 942736cf..6afc9564 100644 --- a/edge/config/advanced/mail-sieve/index.html +++ b/edge/config/advanced/mail-sieve/index.html @@ -287,7 +287,7 @@
  • - + Contributing
  • @@ -1382,6 +1382,20 @@ +
  • + + General Information + +
  • + + + + + + + + +
  • Issues and Pull Requests @@ -1391,48 +1405,6 @@ - - - - - -
  • - - Coding Style - -
  • - - - - - - - - - -
  • - - Tests - -
  • - - - - - - - - - -
  • - - Documentation - -
  • - - - - diff --git a/edge/config/advanced/maintenance/update-and-cleanup/index.html b/edge/config/advanced/maintenance/update-and-cleanup/index.html index a3da1d46..ed5eba96 100644 --- a/edge/config/advanced/maintenance/update-and-cleanup/index.html +++ b/edge/config/advanced/maintenance/update-and-cleanup/index.html @@ -287,7 +287,7 @@
  • - + Contributing
  • @@ -1377,6 +1377,20 @@ +
  • + + General Information + +
  • + + + + + + + + +
  • Issues and Pull Requests @@ -1386,48 +1400,6 @@ - - - - - -
  • - - Coding Style - -
  • - - - - - - - - - -
  • - - Tests - -
  • - - - - - - - - - -
  • - - Documentation - -
  • - - - - diff --git a/edge/config/advanced/optional-config/index.html b/edge/config/advanced/optional-config/index.html index 065239f1..f38ec1bc 100644 --- a/edge/config/advanced/optional-config/index.html +++ b/edge/config/advanced/optional-config/index.html @@ -287,7 +287,7 @@
  • - + Contributing
  • @@ -1377,6 +1377,20 @@ +
  • + + General Information + +
  • + + + + + + + + +
  • Issues and Pull Requests @@ -1386,48 +1400,6 @@ - - - - - -
  • - - Coding Style - -
  • - - - - - - - - - -
  • - - Tests - -
  • - - - - - - - - - -
  • - - Documentation - -
  • - - - - diff --git a/edge/config/advanced/override-defaults/dovecot/index.html b/edge/config/advanced/override-defaults/dovecot/index.html index 1f01ce72..a20710e8 100644 --- a/edge/config/advanced/override-defaults/dovecot/index.html +++ b/edge/config/advanced/override-defaults/dovecot/index.html @@ -287,7 +287,7 @@
  • - + Contributing
  • @@ -1384,6 +1384,20 @@ +
  • + + General Information + +
  • + + + + + + + + +
  • Issues and Pull Requests @@ -1393,48 +1407,6 @@ - - - - - -
  • - - Coding Style - -
  • - - - - - - - - - -
  • - - Tests - -
  • - - - - - - - - - -
  • - - Documentation - -
  • - - - - diff --git a/edge/config/advanced/override-defaults/postfix/index.html b/edge/config/advanced/override-defaults/postfix/index.html index 8091fa31..70bdf9ba 100644 --- a/edge/config/advanced/override-defaults/postfix/index.html +++ b/edge/config/advanced/override-defaults/postfix/index.html @@ -282,7 +282,7 @@
  • - + Contributing
  • @@ -1336,6 +1336,20 @@ +
  • + + General Information + +
  • + + + + + + + + +
  • Issues and Pull Requests @@ -1345,48 +1359,6 @@ - - - - - -
  • - - Coding Style - -
  • - - - - - - - - - -
  • - - Tests - -
  • - - - - - - - - - -
  • - - Documentation - -
  • - - - - diff --git a/edge/config/advanced/override-defaults/user-patches/index.html b/edge/config/advanced/override-defaults/user-patches/index.html index 9e7bca19..3af14172 100644 --- a/edge/config/advanced/override-defaults/user-patches/index.html +++ b/edge/config/advanced/override-defaults/user-patches/index.html @@ -282,7 +282,7 @@
  • - + Contributing
  • @@ -1336,6 +1336,20 @@ +
  • + + General Information + +
  • + + + + + + + + +
  • Issues and Pull Requests @@ -1345,48 +1359,6 @@ - - - - - -
  • - - Coding Style - -
  • - - - - - - - - - -
  • - - Tests - -
  • - - - - - - - - - -
  • - - Documentation - -
  • - - - - diff --git a/edge/config/advanced/podman/index.html b/edge/config/advanced/podman/index.html index 22117c06..cd9c8b5b 100644 --- a/edge/config/advanced/podman/index.html +++ b/edge/config/advanced/podman/index.html @@ -287,7 +287,7 @@
  • - + Contributing
  • @@ -1442,6 +1442,20 @@ +
  • + + General Information + +
  • + + + + + + + + +
  • Issues and Pull Requests @@ -1451,48 +1465,6 @@ - - - - - -
  • - - Coding Style - -
  • - - - - - - - - - -
  • - - Tests - -
  • - - - - - - - - - -
  • - - Documentation - -
  • - - - - diff --git a/edge/config/best-practices/autodiscover/index.html b/edge/config/best-practices/autodiscover/index.html index bf07ca72..57b31d2a 100644 --- a/edge/config/best-practices/autodiscover/index.html +++ b/edge/config/best-practices/autodiscover/index.html @@ -282,7 +282,7 @@
  • - + Contributing
  • @@ -1336,6 +1336,20 @@ +
  • + + General Information + +
  • + + + + + + + + +
  • Issues and Pull Requests @@ -1345,48 +1359,6 @@ - - - - - -
  • - - Coding Style - -
  • - - - - - - - - - -
  • - - Tests - -
  • - - - - - - - - - -
  • - - Documentation - -
  • - - - - diff --git a/edge/config/best-practices/dkim/index.html b/edge/config/best-practices/dkim/index.html index 7e81a90e..c3146ce9 100644 --- a/edge/config/best-practices/dkim/index.html +++ b/edge/config/best-practices/dkim/index.html @@ -287,7 +287,7 @@
  • - + Contributing
  • @@ -1396,6 +1396,20 @@ +
  • + + General Information + +
  • + + + + + + + + +
  • Issues and Pull Requests @@ -1405,48 +1419,6 @@ - - - - - -
  • - - Coding Style - -
  • - - - - - - - - - -
  • - - Tests - -
  • - - - - - - - - - -
  • - - Documentation - -
  • - - - - diff --git a/edge/config/best-practices/dmarc/index.html b/edge/config/best-practices/dmarc/index.html index d0bbb2aa..51e78a01 100644 --- a/edge/config/best-practices/dmarc/index.html +++ b/edge/config/best-practices/dmarc/index.html @@ -287,7 +287,7 @@
  • - + Contributing
  • @@ -1370,6 +1370,20 @@ +
  • + + General Information + +
  • + + + + + + + + +
  • Issues and Pull Requests @@ -1379,48 +1393,6 @@ - - - - - -
  • - - Coding Style - -
  • - - - - - - - - - -
  • - - Tests - -
  • - - - - - - - - - -
  • - - Documentation - -
  • - - - - diff --git a/edge/config/best-practices/spf/index.html b/edge/config/best-practices/spf/index.html index 571b4c8b..f9001eb8 100644 --- a/edge/config/best-practices/spf/index.html +++ b/edge/config/best-practices/spf/index.html @@ -287,7 +287,7 @@
  • - + Contributing
  • @@ -1377,6 +1377,20 @@ +
  • + + General Information + +
  • + + + + + + + + +
  • Issues and Pull Requests @@ -1386,48 +1400,6 @@ - - - - - -
  • - - Coding Style - -
  • - - - - - - - - - -
  • - - Tests - -
  • - - - - - - - - - -
  • - - Documentation - -
  • - - - - diff --git a/edge/config/environment/index.html b/edge/config/environment/index.html index 6ac3040c..94c84e22 100644 --- a/edge/config/environment/index.html +++ b/edge/config/environment/index.html @@ -287,7 +287,7 @@
  • - + Contributing
  • @@ -2279,6 +2279,20 @@ +
  • + + General Information + +
  • + + + + + + + + +
  • Issues and Pull Requests @@ -2288,48 +2302,6 @@ - - - - - -
  • - - Coding Style - -
  • - - - - - - - - - -
  • - - Tests - -
  • - - - - - - - - - -
  • - - Documentation - -
  • - - - - diff --git a/edge/config/pop3/index.html b/edge/config/pop3/index.html index eea4a224..6a45d322 100644 --- a/edge/config/pop3/index.html +++ b/edge/config/pop3/index.html @@ -282,7 +282,7 @@
  • - + Contributing
  • @@ -1334,6 +1334,20 @@ +
  • + + General Information + +
  • + + + + + + + + +
  • Issues and Pull Requests @@ -1343,48 +1357,6 @@ - - - - - -
  • - - Coding Style - -
  • - - - - - - - - - -
  • - - Tests - -
  • - - - - - - - - - -
  • - - Documentation - -
  • - - - - diff --git a/edge/config/security/fail2ban/index.html b/edge/config/security/fail2ban/index.html index 7264d3dc..c8806856 100644 --- a/edge/config/security/fail2ban/index.html +++ b/edge/config/security/fail2ban/index.html @@ -287,7 +287,7 @@
  • - + Contributing
  • @@ -1437,6 +1437,20 @@ +
  • + + General Information + +
  • + + + + + + + + +
  • Issues and Pull Requests @@ -1446,48 +1460,6 @@ - - - - - -
  • - - Coding Style - -
  • - - - - - - - - - -
  • - - Tests - -
  • - - - - - - - - - -
  • - - Documentation - -
  • - - - - diff --git a/edge/config/security/mail_crypt/index.html b/edge/config/security/mail_crypt/index.html index 0b45c90e..74c5aed4 100644 --- a/edge/config/security/mail_crypt/index.html +++ b/edge/config/security/mail_crypt/index.html @@ -287,7 +287,7 @@
  • - + Contributing
  • @@ -1368,6 +1368,20 @@ +
  • + + General Information + +
  • + + + + + + + + +
  • Issues and Pull Requests @@ -1377,48 +1391,6 @@ - - - - - -
  • - - Coding Style - -
  • - - - - - - - - - -
  • - - Tests - -
  • - - - - - - - - - -
  • - - Documentation - -
  • - - - - diff --git a/edge/config/security/ssl/index.html b/edge/config/security/ssl/index.html index 205676f1..b53ddebb 100644 --- a/edge/config/security/ssl/index.html +++ b/edge/config/security/ssl/index.html @@ -287,7 +287,7 @@
  • - + Contributing
  • @@ -1491,6 +1491,20 @@ +
  • + + General Information + +
  • + + + + + + + + +
  • Issues and Pull Requests @@ -1500,48 +1514,6 @@ - - - - - -
  • - - Coding Style - -
  • - - - - - - - - - -
  • - - Tests - -
  • - - - - - - - - - -
  • - - Documentation - -
  • - - - - diff --git a/edge/config/security/understanding-the-ports/index.html b/edge/config/security/understanding-the-ports/index.html index 04edb8fd..f5b197b8 100644 --- a/edge/config/security/understanding-the-ports/index.html +++ b/edge/config/security/understanding-the-ports/index.html @@ -287,7 +287,7 @@
  • - + Contributing
  • @@ -1455,6 +1455,20 @@ +
  • + + General Information + +
  • + + + + + + + + +
  • Issues and Pull Requests @@ -1464,48 +1478,6 @@ - - - - - -
  • - - Coding Style - -
  • - - - - - - - - - -
  • - - Tests - -
  • - - - - - - - - - -
  • - - Documentation - -
  • - - - - diff --git a/edge/config/setup.sh/index.html b/edge/config/setup.sh/index.html index d1796ddc..72888e8e 100644 --- a/edge/config/setup.sh/index.html +++ b/edge/config/setup.sh/index.html @@ -287,7 +287,7 @@
  • - + Contributing
  • @@ -1368,6 +1368,20 @@ +
  • + + General Information + +
  • + + + + + + + + +
  • Issues and Pull Requests @@ -1377,48 +1391,6 @@ - - - - - -
  • - - Coding Style - -
  • - - - - - - - - - -
  • - - Tests - -
  • - - - - - - - - - -
  • - - Documentation - -
  • - - - - diff --git a/edge/config/troubleshooting/debugging/index.html b/edge/config/troubleshooting/debugging/index.html index 8b7f4d18..fd215fbb 100644 --- a/edge/config/troubleshooting/debugging/index.html +++ b/edge/config/troubleshooting/debugging/index.html @@ -287,7 +287,7 @@
  • - + Contributing
  • @@ -1396,6 +1396,20 @@ +
  • + + General Information + +
  • + + + + + + + + +
  • Issues and Pull Requests @@ -1405,48 +1419,6 @@ - - - - - -
  • - - Coding Style - -
  • - - - - - - - - - -
  • - - Tests - -
  • - - - - - - - - - -
  • - - Documentation - -
  • - - - - diff --git a/edge/config/user-management/accounts/index.html b/edge/config/user-management/accounts/index.html index 4e52f275..84bf00ed 100644 --- a/edge/config/user-management/accounts/index.html +++ b/edge/config/user-management/accounts/index.html @@ -287,7 +287,7 @@
  • - + Contributing
  • @@ -1383,6 +1383,20 @@ +
  • + + General Information + +
  • + + + + + + + + +
  • Issues and Pull Requests @@ -1392,48 +1406,6 @@ - - - - - -
  • - - Coding Style - -
  • - - - - - - - - - -
  • - - Tests - -
  • - - - - - - - - - -
  • - - Documentation - -
  • - - - - diff --git a/edge/config/user-management/aliases/index.html b/edge/config/user-management/aliases/index.html index f0f95e74..3331b9e7 100644 --- a/edge/config/user-management/aliases/index.html +++ b/edge/config/user-management/aliases/index.html @@ -287,7 +287,7 @@
  • - + Contributing
  • @@ -1375,6 +1375,20 @@ +
  • + + General Information + +
  • + + + + + + + + +
  • Issues and Pull Requests @@ -1384,48 +1398,6 @@ - - - - - -
  • - - Coding Style - -
  • - - - - - - - - - -
  • - - Tests - -
  • - - - - - - - - - -
  • - - Documentation - -
  • - - - - diff --git a/edge/contributing/coding-style/index.html b/edge/contributing/coding-style/index.html deleted file mode 100644 index 30c18bb2..00000000 --- a/edge/contributing/coding-style/index.html +++ /dev/null @@ -1,1835 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - Contributing | Coding Style - Docker Mailserver - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - Skip to content - - -
    -
    - -
    - - - - - - -
    - - -
    - -
    - - - - - - - - - -
    -
    - - - -
    -
    -
    - - - - - - -
    -
    -
    - - - -
    -
    -
    - - - -
    -
    -
    - - -
    -
    - - - - - - - - -

    Coding Style

    - -

    Bash and Shell

    -

    When refactoring, writing or altering scripts, that is Shell and bash scripts, in any way, adhere to these rules:

    -
      -
    1. Adjust your style of coding to the style that is already present! Even if you do not like it, this is due to consistency. There was a lot of work involved in making all scripts consistent.
    2. -
    3. Use shellcheck to check your scripts! Your contributions are checked by GitHub Actions too, so you will need to do this. You can lint your work with make lint to check against all targets.
    4. -
    5. Use the provided .editorconfig file.
    6. -
    7. Use /bin/bash instead of /bin/sh. Adjust the style accordingly.
    8. -
    9. setup.sh provides a good starting point to look for.
    10. -
    11. When appropriate, use the set builtin. We recommend set -euEo pipefail or set -uE.
    12. -
    -

    Styling rules

    -

    If-Else-Statements

    -
    # when using braces, use double braces
    -# remember you do not need "" when using [[ ]]
    -if [[ <CONDITION1> ]] && [[ -f ${FILE} ]]
    -then
    -  <CODE TO RUN>
    -# when running commands, you don't need braces
    -elif <COMMAND TO RUN>
    -  <CODE TO TUN>
    -else
    -  <CODE TO TUN>
    -fi
    -
    -# equality checks with numbers are done
    -# with -eq/-ne/-lt/-ge, not != or ==
    -if [[ ${VAR} -ne 42 ]] || [[ ${SOME_VAR} -eq 6 ]]
    -then
    -  <CODE TO RUN>
    -fi
    -
    -

    Variables & Braces

    -
    -

    Attention

    -

    Variables are always uppercase. We always use braces.

    -
    -

    If you forgot this and want to change it later, you can use this link. The used regex is \$([^{("\\'\/])([a-zA-Z0-9_]*)([^}\/ \t'"\n.\]:(=\\-]*), where you should in practice be able to replace all variable occurrences without braces with occurrences with braces.

    -
    # good
    -local VAR="good"
    -local NEW="${VAR}"
    -
    -# bad -> CI will fail
    -var="bad"
    -new=$var
    -
    -

    Loops

    -

    Like if-else, loops look like this

    -
    for / while <LOOP CONDITION>
    -do
    -  <CODE TO RUN>
    -done
    -
    -

    Functions

    -

    It's always nice to see the use of functions as it also provides a clear structure. If scripts are small, this is unnecessary, but if they become larger, please consider using functions. When doing so, provide function _main.

    -
    function _<name_underscored_and_lowercase>
    -{
    -  <CODE TO RUN>
    -
    -  # variables that can be local should be local
    -  local <LOCAL_VARIABLE_NAME>
    -}
    -
    -

    Error Tracing

    -

    A construct to trace error in your scripts looks like this. Remember: Remove set -x in the end. This is for debugging purposes only.

    -
    set -xeuEo pipefail
    -trap '__err "${BASH_SOURCE}" "${FUNCNAME[0]:-?}" "${BASH_COMMAND:-?}" "${LINENO:-?}" "${?:-?}"' ERR
    -
    -function __err
    -{
    -  local RED="\e[31m\e[1m"
    -  local RESET="\e[0m"
    -  local ERR_MSG="\n--- ${RED}UNCHECKED ERROR${RESET}"
    -  ERR_MSG+="\n  - script    = ${1}"
    -  ERR_MSG+="\n  - function  = ${2}"
    -  ERR_MSG+="\n  - command   = ${3}"
    -  ERR_MSG+="\n  - line      = ${4}"
    -  ERR_MSG+="\n  - exit code = ${5}"
    -
    -  echo -e "${ERR_MSG}"
    -
    -  <CODE TO RUN AFTERWARDS>
    -}
    -
    -

    Comments, Descriptiveness & An Example

    -

    Comments should only describe non-obvious matters. Comments should start lowercase when they aren't sentences. Make the code self-descriptive by using meaningful names! Make comments not longer than approximately 80 columns, then wrap the line.

    -

    A positive example, which is taken from setup-stack.sh, would be

    -
    function _setup_postfix_aliases
    -{
    -  _log 'debug' 'Setting up Postfix aliases'
    -
    -  : >/etc/postfix/virtual
    -  : >/etc/postfix/regexp
    -
    -  if [[ -f /tmp/docker-mailserver/postfix-virtual.cf ]]
    -  then
    -    # fixing old virtual user file
    -    if grep -q ",$" /tmp/docker-mailserver/postfix-virtual.cf
    -    then
    -      sed -i -e "s/, /,/g" -e "s/,$//g" /tmp/docker-mailserver/postfix-virtual.cf
    -    fi
    -
    -    cp -f /tmp/docker-mailserver/postfix-virtual.cf /etc/postfix/virtual
    -
    -    while read -r FROM _
    -    do
    -      # Setting variables for better readability
    -      UNAME=$(echo "${FROM}" | cut -d @ -f1)
    -      DOMAIN=$(echo "${FROM}" | cut -d @ -f2)
    -
    -      # if they are equal it means the line looks like: "user1     other@example.com"
    -      [[ ${UNAME} != "${DOMAIN}" ]] && echo "${DOMAIN}" >>/tmp/vhost.tmp
    -    done < <(grep -v "^\s*$\|^\s*\#" /tmp/docker-mailserver/postfix-virtual.cf || true)
    -  else
    -    _log 'debug' "'/tmp/docker-mailserver/postfix-virtual.cf' not provided - no mail alias/forward created"
    -  fi
    -
    -  ...
    -}
    -
    -

    YAML

    -

    When formatting YAML files, use Prettier, an opinionated formatter. There are many plugins for IDEs around.

    - - -
    - -
    -
    - - - -
    - - - -
    -
    -
    -
    - - - - - - - - \ No newline at end of file diff --git a/edge/contributing/documentation/index.html b/edge/contributing/documentation/index.html deleted file mode 100644 index 5c37cbe9..00000000 --- a/edge/contributing/documentation/index.html +++ /dev/null @@ -1,1725 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - Contributing | Documentation - Docker Mailserver - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - Skip to content - - -
    -
    - -
    - - - - - - -
    - - -
    - -
    - - - - - - - - - -
    -
    - - - -
    -
    -
    - - - - - - -
    -
    -
    - - - -
    -
    -
    - - - -
    -
    -
    - - -
    -
    - - - - - - - - -

    Documentation

    - -

    Prerequisites

    -

    You will need have Python and Python pip installed. Or just docker.

    -

    Building and serving the documentation

    -

    This tutorial was written using Python 2.7.18 and Python pip 20.3.4. -And Docker 19.03.6.

    -

    Python way

    -

    Install the modules

    -

    The documentation builder

    -
    pip install mkdocs
    -
    -

    Now the theme

    -
    pip install mkdocs-material
    -
    -

    Serve

    -
    -

    Note: be sure to be in the docs folder (cd ./docs/)

    -
    -
    mkdocs serve
    -
    -

    Wait for it to build and open the URL in your browser. -Each change will be hot-reloaded onto the page you view, just edit, save and look at the result.

    -

    Docker way

    -

    Using the official image (squidfunk/mkdocs-material) for our documentation theme.

    -

    Serve

    -
    -

    Note: be sure to be in the docs folder (cd ./docs/)

    -
    -
    docker run --rm -it -p 8000:8000 -v "${PWD}:/docs" squidfunk/mkdocs-material
    -
    -

    Each change will be hot-reloaded onto the page you view, just edit, save and look at the result.

    - - -
    - -
    -
    - - - -
    - - - -
    -
    -
    -
    - - - - - - - - \ No newline at end of file diff --git a/edge/contributing/tests/index.html b/edge/contributing/general/index.html similarity index 90% rename from edge/contributing/tests/index.html rename to edge/contributing/general/index.html index fc212fd4..84440fa7 100644 --- a/edge/contributing/tests/index.html +++ b/edge/contributing/general/index.html @@ -12,14 +12,14 @@ - + - Contributing | Tests - Docker Mailserver + Contributing | General Information - Docker Mailserver @@ -71,6 +71,11 @@
    + + + Skip to content + +
    @@ -105,7 +110,7 @@
    - Contributing | Tests + Contributing | General Information
    @@ -282,7 +287,7 @@
  • - + Contributing
  • @@ -1323,34 +1328,6 @@ - -
  • - - Issues and Pull Requests - -
  • - - - - - - - - - -
  • - - Coding Style - -
  • - - - - - - - - @@ -1360,10 +1337,53 @@ + + - Tests + General Information + + + + @@ -1375,8 +1395,8 @@
  • - - Documentation + + Issues and Pull Requests
  • @@ -1437,6 +1457,35 @@ + + +
    @@ -1447,24 +1496,39 @@
    - + -

    Tests

    +

    General Information

    +

    Coding Style

    +

    When refactoring, writing or altering scripts or other files, adhere to these rules:

      -
    1. Install docker
    2. -
    3. Execute git submodule update --init --recursive
    4. -
    5. Install jq
    6. +
    7. Adjust your style of coding to the style that is already present! Even if you do not like it, this is due to consistency. There was a lot of work involved in making all scripts consistent.
    8. +
    9. Use shellcheck to check your scripts! Your contributions are checked by GitHub Actions too, so you will need to do this. You can lint your work with make lint to check against all targets.
    10. +
    11. Use the provided .editorconfig file.
    12. +
    13. Use /bin/bash instead of /bin/sh in scripts
    14. +
    +

    Tests

    +

    To run the test suite, you will need to

    +
      +
    1. Install Docker
    2. +
    3. Install jq (under Ubuntu, use sudo apt-get -y install jq)
    4. +
    5. Execute git submodule update --init --recursive if you haven't already initialized the git submodules
    6. Execute make clean all

    Can I use MacOS?

    We do not support running linting, tests, etc on macOS at this time. Please use a linux VM.

    +

    Documentation

    +

    You will need to have Docker installed. Navigate into the docs/ directory. Then run:

    +
    docker run --rm -it -p 8000:8000 -v "${PWD}:/docs" squidfunk/mkdocs-material
    +
    +

    This serves the documentation on your local machine on port 8000. Each change will be hot-reloaded onto the page you view, just edit, save and look at the result.

    @@ -1485,7 +1549,7 @@ @@ -1558,25 +1530,21 @@

    By raising issues, I agree to these terms and I understand, that the rules set for the issue tracker will help both maintainers as well as everyone to find a solution.

    Maintainers take the time to improve on this project and help by solving issues together. It is therefore expected from others to make an effort and comply with the rules.

    Pull Requests

    -

    Submit a Pull-Request

    Motivation

    You want to add a feature? Feel free to start creating an issue explaining what you want to do and how you're thinking doing it. Other users may have the same need and collaboration may lead to better results.

    +

    Submit a Pull-Request

    The development workflow is the following:

      -
    1. Fork the project and clone your fork
    2. -
    3. Create a new branch to work on
    4. -
    5. Run git submodule update --init --recursive
    6. +
    7. Fork the project and clone your fork with git clone --recurse-submodules ... or run git submodule update --init --recursive after you cloned your fork
    8. Write the code that is needed :D
    9. Add integration tests if necessary
    10. -
    11. Prepare your environment and run linting and tests
    12. -
    13. Document your improvements if necessary (e.g. if you introduced new environment variables, describe those in the ENV documentation)
    14. -
    15. Commit and sign your commit, push and create a pull-request to merge into master. Please use the pull-request template to provide a minimum of contextual information and make sure to meet the requirements of the checklist.
    16. -
    17. Pull requests are automatically tested against the CI and will be reviewed when tests pass
    18. -
    19. When your changes are validated, your branch is merged
    20. -
    21. CI builds the new :edge image immediately and your changes will be includes in the next version release.
    22. +
    23. Prepare your environment and run linting and tests
    24. +
    25. Document your improvements if necessary (e.g. if you introduced new environment variables, describe those in the ENV documentation) and add your changes the changelog under the "Unreleased" section
    26. +
    27. Commit (and sign your commit), push and create a pull-request to merge into master. Please use the pull-request template to provide a minimum of contextual information and make sure to meet the requirements of the checklist.
    +

    Pull requests are automatically tested against the CI and will be reviewed when tests pass. When your changes are validated, your branch is merged. CI builds the new :edge image immediately and your changes will be includes in the next version release.

    @@ -1597,7 +1565,7 @@