Commit Graph

4 Commits

Author SHA1 Message Date
Casper a930aeb18a
Remove unusual space from shebang line (#2834) 2022-10-17 10:40:09 +02:00
Casper 1f137f3eca
Only calculate checksums, when there are files to monitor. (#2776) 2022-09-19 10:45:40 +02:00
Brennan Kinney c314c9c471
chore(`check-for-changes.sh`): Drop redundant guards (#2623)
* chore: Remove requirement for `postfix-accounts.cf`

This is an old requirement from when the change detector service was first introduced. It's no longer relevant.

* chore: Do not needlessly create `postfix-aliases.cf`

The config was created regardless to workaround early change detection support. No longer necessary to require the file to exist.

* chore: Drop guards requiring `/tmp/docker-mailserver` to exist

Legacy guards when this was the only location change detection location supported.

There does not appear to be any need for changing into this directory at the start of `check-for-changes.sh` as we use absolute filepaths (originally monitored files were checked with relative paths to this config dir).

* chore: Revise inline docs

* chore: Add change detection monitoring for extra configs

These are also handled at run-time in the current change detection support, so it makes sense to allows these config updates to also trigger change events.
2022-06-09 19:48:07 +12:00
Brennan Kinney c862e1451d
chore(housekeeping): Create `helpers/change-detection.sh` (#2610)
* chore: Extract change-detection method to it's own helper

This doesn't really belong in `helpers/ssl.sh`. Moving to it's own helper script.

* chore: Co-locate related change-detection method from container startup

It seems relevant to migrate the related support during startup for the change detection feature into this helper.

I opted to move the call from `start-mailserver.sh` into the `_setup` call at the end for a more explicit/visible location.

* chore: Move `CHKSUM_FILE` into `helpers/change-detection.sh`

It belongs there, not in `helpers/index.sh`.

* chore: Revise inline documentation

* tests(fix): Ensure correct functionality

Presently `test/test_helper.bats` is using it's own  `CHKSUM_FILE` instead of sourcing the var for the filepath.

`test_helper/common.bash` was calling a method to check for changes, but this helper may not correctly detect letsencrypt related changes as these are not ENV rely on, but global vars handled by `helpers/dns.sh`, so that should be run first like it is for `check-for-changes.sh`.

* tests(chore): Use `CHKSUM_FILE` var from helper

* chore: `addmailuser` should use `CHKSUM_FILE` var

* chore: Update `check-for-changes.sh` log message with correct path
2022-06-05 11:59:54 +12:00