-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sed wrapper #2158
sed wrapper #2158
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍🏼
@egavrilov Your addition from #554 broke some time ago. Do you know, if it's still needed nowadays? |
@casperklein hi there. It's not really a hard requirement to have idle time set from default to whatever value, but just a recomendation to have it higher than default because of battery drain on non-optimised client. I guess it is even possible to remove it because the problem is on the client actually. |
It is already removed (unintentionally) since ~1.5 years. My question just was, if it's worth to re-add it. Now, I don't think so. |
f6dae10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Although the sed lines look a bit difficult to read some times, especially that dovecot one with all the path escaping \/
mixed in with the /
sed delimiter. In other scripts we switched to a consistent |
sed delimiter instead.
Not required for this PR but probably a worthwhile change :)
* sed wrapper 'sedfile' added * formatting * sed --> sedfile * typo * fix lint * debug * fixme * mkcert fix * style adjusted * Update Dockerfile
* sed wrapper 'sedfile' added * formatting * sed --> sedfile * typo * fix lint * debug * fixme * mkcert fix * style adjusted * Update Dockerfile
Description
This introduces
sedfile
, a wrapper forsed -i
commands.Problem: When
sed -i
is used to manipulate files, sed exit with error code 0, even when the file was not altered:sedfile
compares the file hash before and after the sed operation and fails, if the file was not altered (hashes do match).This helps to prevent issues caused by failed file modifications, e.g. a package is upgraded and the config file structure changes.
Identified issues
imap_idle_notify_interval
Error: sed -i s/#imap_idle_notify_interval = 2 mins/imap_idle_notify_interval = 29 mins/ /etc/dovecot/conf.d/20-imap.conf
https://github.com/docker-mailserver/docker-mailserver/pull/2158/checks?check_run_id=3455478612#step:6:2236
Reason:
imap_idle_notify_interval
is not present in/etc/dovecot/conf.d/20-imap.conf
.Action: Line deleted
Edit: #554
Edit2: Broken since commit: added dovecot quota feature
adapt mkcert for Dovecot community repo (old leftover)
Error: sed -i s/CERTDIR=.*/CERTDIR=\/etc\/dovecot\/ssl/g /usr/share/dovecot/mkcert.sh
Error: sed -i s/KEYDIR=.*/KEYDIR=\/etc\/dovecot\/ssl/g /usr/share/dovecot/mkcert.sh
Error: sed -i 's/KEYFILE=.*/KEYFILE=\$KEYDIR\/dovecot.key/g' /usr/share/dovecot/mkcert.sh
https://github.com/docker-mailserver/docker-mailserver/runs/3455521780?check_suite_focus=true#step:6:2225
Reason:
CERTDIR
,KEYDIR
,KEYFILE
already have the correct values in/usr/share/dovecot/mkcert.sh
.Fix: Affected lines removed from Dockerfile
Future to-do
Replace existing
sed -i
withsedfile -i
in scripts and tests.Type of change
Checklist:
docs/
)