Skip to content

Outsourcing Environment Variables to the Documentation#1948

Merged
wernerfred merged 27 commits intomasterfrom
environment
May 11, 2021
Merged

Outsourcing Environment Variables to the Documentation#1948
wernerfred merged 27 commits intomasterfrom
environment

Conversation

@georglauterbach
Copy link
Copy Markdown
Member

@georglauterbach georglauterbach commented May 7, 2021

Description

Environment variables are now found in the documentation and README links to this documentation. As a consequence, ENVIRONMENT.md has been deleted.

Furthermore, I reworked the whole system for variables. In the past, users we're confused by two different .env files which serve two different purposes. Therefore, the README was adjusted and compose.env becomes history. This should make it more straight-forward and the setup easier.

Type of change

  • Improvement (non-breaking change that does improve existing functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (README.md or ENVIRONMENT.md or the documentation)
  • If necessary I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@georglauterbach georglauterbach added meta/needs triage This issue / PR needs checks and verification from maintainers meta/help wanted The OP requests help from others - chime in! :D priority/medium meta/wip kind/improvement Improve an existing feature, configuration file or the documentation area/documentation labels May 7, 2021
@georglauterbach georglauterbach self-assigned this May 7, 2021
@georglauterbach
Copy link
Copy Markdown
Member Author

@docker-mailserver/maintainers Contributions and discussions are welcome :D

@georglauterbach georglauterbach marked this pull request as draft May 7, 2021 09:07
@georglauterbach georglauterbach changed the title started outsourcing env variables to the documentation Outsourcing Environment Variables to the Documentation May 7, 2021
@wernerfred
Copy link
Copy Markdown
Member

Like stated multiple times from my side (e.g. here) I really appreciate this change. I'm super busy right now but I am looking forward to contribute/review this weekend on this topic 👍🏻
Thanks for starting this PR.

@casperklein
Copy link
Copy Markdown
Member

Now that compose.env --> .env is going to be removed, I noticed, that at some point env_file: .env was removed from docker-compose.yml.

That leads to, that $DOMAINNAME is now no longer available in the container.

I did a quick grep. Some scripts do something like DOMAINNAME=$(hostname -d), but others seem to depend on $DOMAINNAME already set?

IMO this can never be true:

elif [[ -n ${DOMAINNAME} ]]

Or do I overlook something?

Comment thread README.md Outdated
@georglauterbach
Copy link
Copy Markdown
Member Author

georglauterbach commented May 7, 2021

Now that compose.env --> .env is going to be removed, I noticed, that at some point env_file: .env was removed from docker-compose.yml.

That leads to, that $DOMAINNAME is now no longer available in the container.

I did a quick grep. Some scripts do something like DOMAINNAME=$(hostname -d), but others seem to depend on $DOMAINNAME already set?

IMO this can never be true:

elif [[ -n ${DOMAINNAME} ]]

Or do I overlook something?

No, you're quite correct. But according to blame, I think I removed this a rather long while back, but no complaints were raised. But we should definitely do something about this behavior.

I propose to just parse it from the hostname command or from the OVERRIDE_HOSTNAME variable or something like this.

Comment thread README.md Outdated
Comment thread README.md Outdated
@casperklein casperklein mentioned this pull request May 7, 2021
11 tasks
Copy link
Copy Markdown
Member

@polarathene polarathene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for kickstarting this! 😃

Here's my feedback so far. Some of it's outdated now, was half way through it last night but got interrupted 😬

Comment thread docker-compose.yml Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread docs/content/config/environment.md Outdated
Comment thread docs/content/config/environment.md
Comment thread docs/content/config/setup.sh.md Outdated
Comment thread docs/content/contributing/coding-style.md
Comment thread docs/mkdocs.yml
@georglauterbach
Copy link
Copy Markdown
Member Author

georglauterbach commented May 8, 2021

OPEN TASKS

  • Check that all links are correct
  • Refactor $DOMAINNAME

georglauterbach and others added 3 commits May 10, 2021 19:31
Co-authored-by: Brennan Kinney <[email protected]>
Co-authored-by: Brennan Kinney <[email protected]>
@georglauterbach georglauterbach enabled auto-merge (squash) May 10, 2021 18:01
@georglauterbach georglauterbach disabled auto-merge May 10, 2021 18:02
@georglauterbach
Copy link
Copy Markdown
Member Author

This should now be ready for merging.

wernerfred
wernerfred previously approved these changes May 11, 2021
Copy link
Copy Markdown
Member

@wernerfred wernerfred left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏻
Thanks

Copy link
Copy Markdown
Member

@polarathene polarathene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Absolute URLs should not be used to reference internal docs, those should be relative file paths for error detection.
  • 1 typo to correct.
  • Optional: Punctuation consistency. The . at end of lines for environment.md (I didn't review the whole document, just noticed inconsistent usage through highlighted diff).

Comment thread docs/content/config/advanced/auth-ldap.md Outdated
Comment thread docs/content/config/troubleshooting/debugging.md Outdated
Comment thread docs/content/contributing/issues-and-pull-requests.md Outdated
Comment thread docs/content/examples/tutorials/basic-installation.md Outdated
Comment thread docs/content/index.md Outdated
Comment thread docs/content/config/environment.md Outdated
Comment thread docs/content/config/environment.md Outdated
Comment thread docs/content/config/environment.md Outdated
Comment thread docs/content/config/environment.md Outdated
Comment thread docs/content/config/environment.md Outdated
@georglauterbach
Copy link
Copy Markdown
Member Author

  • Absolute URLs should not be used to reference internal docs, those should be relative file paths for error detection.

  • 1 typo to correct.

  • Optional: Punctuation consistency. The . at end of lines for environment.md (I didn't review the whole document, just noticed inconsistent usage through highlighted diff).

You're right, but I'm low on time. Can you commit the Last changes you proposed on the environment branch?:)

@wernerfred
Copy link
Copy Markdown
Member

There is a new feature now to commit suggestions directly:
image

(or am i seeing a preview feature that is not public right now)

@georglauterbach
Copy link
Copy Markdown
Member Author

There is a new feature now to commit suggestions directly:
image

(or am i seeing a preview feature that is not public right now)

No, you're right. I already used this for the last suggestions. But this would mean 11 new commits. Okay, they are squashed, but I think it's cleaner with one or two commits. But go ahead @wernerfred and merge them :D I have no objections.

@wernerfred wernerfred enabled auto-merge (squash) May 11, 2021 09:27
@wernerfred
Copy link
Copy Markdown
Member

@polarathene I added your changes and enabled auto-merge. If the changes are fine with you hit the approve button ✅

@wernerfred wernerfred merged commit 5449efd into master May 11, 2021
@wernerfred wernerfred deleted the environment branch May 11, 2021 10:15
@wernerfred wernerfred added this to the v10.0.0 milestone May 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/documentation kind/improvement Improve an existing feature, configuration file or the documentation priority/medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants