-
Notifications
You must be signed in to change notification settings - Fork 92
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
Zimbra 8.7 - Script doesn't work properly #3
Comments
Hi @virento. Thank you for that detailed report. My friend uses zimbra 8.6 and it works under root user well. Adding a read permission to others is generally bad idea (especially when you work with certs and keys). But changing ownership of the temp directory to zimbra user seems to be a good one. I will make a special branch for version 8.7 with PS: there is a |
Looking into this on 8.7, it seems the letsencypt-auto tools wants me to answer questions, only those questions are never shown on the tty. e.g. running the ps command shows: That was after I added the --staging and also --register-unsafely-without-email to avoid another dialog. So the zimbra-v8.7_dev branch does not seem to work on 8.7 Also I needed to : mkdir -p /opt/zimbra/ssl/zimbra/commercial/ @VojtechMyslivec So I am guessing this script needs some love, I can provide you with a test environment if you want. Barry |
Adding --staging --register-unsafely-without-email --non-interactive --agree-tos would get rid of the dialog.. then the script returns warning my dns is not correct, that is true, havent set that up for the dev server. |
So summary, the script needs to look for the .key file in a different place, and some more ignore switches should be added. |
Hi @barrydegraaff and thanks for the report. You have probably encounter similar issue like in #6.
To Do list:
|
To generate the csr and key file, we could run from the script as Zimbra user: I suggest to only run this command in case the required csr and key file for this script are not present on the server. @VojtechMyslivec I can test the dev branch, but to do so, I guess it needs to be merged here first, can you arrange that, I can than add the above zmcertmgr createcsr and we should get pretty close to a working solution then. Thanks |
So it does work with 8.7 now? |
I have just rebased To do this, generate a CSR in zimbra web administration - it will generate the desired key. Checkout Use |
Using it with 8.7 on Ubuntu 16.04 works after i changed how zimbra is started. But that is unrelated to this issue. (Use of |
Testing 8.7_dev branch I get
The section in question is
Only modifications i made after checking out was to edit the location of letsencrypt. I have it in /root rather than /opt |
Thanks! Script runs without error now and restarts services. But: Certificate being served in browser is still the old (soon expiring) letsencrypt certificate. Should the certificate paths in the script be modified ? When doing things manually I always saw the certs placed in /etc/letsencrypt/live/my.domain.com/ with a bunch of symlinks there linking to the actual revisions of certs. But in the script it asks for filenames without an absolute path so I did not modify it:
/var/log/letsencrypt/letsencrypt.org talks of certs being placed in some random folders in /tmp/:
|
Just tried again and it seems Letsencrypt is happy.
obtain-and-deploy-letsencrypt-cert.sh reports no errors. But zmcontrol throws some non-fatal warnings when restarting nginx:
Restart takes a few minutes and when it's all back up the certificate being served is still the old, soon expiring LetsEncrypt certificate. Checking Zimbra and nginx logs now to see if there is any clues but my assumption was that any errors in validating or installing the cert would have been reported obtain-and-deploy-letsencrypt-cert.sh when it does the zmcertmgr calls. Update: |
I am really not sure what is happening. If you need more verbose input, remove all redirection to If you need to test it, use Try to look in Zimbra web administration for the installed certificates. Maybe you will find some more info what is happening. |
What's happening is that there are some domain-certificates defined in Zimbra (multi tenancy) and the script is not aware of them. As long as one is aware of that it is all good. 💃 |
the default setting of the letsencrypt tools point to /opt while they usually are in /root |
@ba1020 it depends on sysadmin nature. I would avoid installing applications/scripts into the root home. Anyway, you can just change the variable in the script - or in the config file if you use the |
Line 328 of obtain-and-deploy-letsencrypt-cert.sh you forgot the su -c zimbra to execute the restart result in errors : |
ok, thanks |
Hello, it appears this script doesn't run properly due to 'zmcertmgr' being required to run as the zimbra user and not as root (it complains about this and the script exits), a change implemented with the release of Zimbra 8.7. I believe I was able to work around this problem by inserting 'sudo -u zimbra' at the front of the lines that run 'zmcertmgr' however I also learned during this process that since it runs as the zimbra user, you have to change the permissions for the temp directory the script creates to allow the zimbra user to read those files as well as read the 'commercial.key' file.
To combat this, I had the script chmod the temp directory and the commercial.key file to allow reads by other users other than the user/group (which is root).
Unfortunately, I hit the letsencrypt certificate request limit which apparently is 5 certs in 7 days so I wasn't able to confirm the script could fully execute with these modifications. :(
If you could resolve this issue, that would be fantastic!
The text was updated successfully, but these errors were encountered: