AIO Update to Nextcloud AIO v13.1.0 downgrades Let's Encrypt certificates to one week

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • Nextcloud Hub 26 Winter (33.0.3)
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • None
  • Is this the first time you’ve seen this error? (Yes / No):
    • No
  • When did this problem seem to first start?
    • Today
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Nextcloud AIO v13.1.0
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

After updating Nextcloud AIO containers, the cert is only 7 days valid.

Active Containers:

Is it possible to get the old Let’s encrypt certificate runtime back?
I know that they will reduce the runtime later. But cert troubles every week is bad.

Thanks

Thomas

Works as designed:

You automatically should renew the certificate weekly.

But six day certs are optional for now.

Can i change the request somewhere?

If automatic renewal is working properly, there shouldn’t be any issues with the certificate every week, right? Is this just a concern of yours, or are you actually having problems with automatic renewal? If the latter is the case, wouldn’t it be better trying to fix the root cause?

It’s set here: all-in-one/Containers/apache/Caddyfile at 32a0b97ce395bfae87a4778fe9e44e7a3fdd49f9 · nextcloud/all-in-one · GitHub

However, if you change this in the container, it will most likely be overwritten during the next update, so it would be better to use your own reverse proxy in front of AIO and manage the certificates with that. all-in-one/reverse-proxy.md at main · nextcloud/all-in-one · GitHub

But again, the best solution is to ensure that automatic renewal works properly, because then it won’t matter how long or short the validity period of the certificates actually is. :wink:

I never read all all possible solutions on Letsencrypt-site. It surely might be possible to retrieve a certificate with a longer renewal range.

As @bb77 mentioned above, you might get into trouble, if you do manual settings, which might be overwritten at next upgrade.

The background is, that Letsencrypt changes the period of validity step by step due to more security generally. So, we should follow that guideline.

I somewhere read at the beginning of this year, that Google will force to decrase the validity range of SSL certificates down to one week in the future.

Yes, but not because of Let’s Encrypt or Caddy. Both still have a default validity period of 90 days and an automatic renewal period of 60 days. This has been explicitly configured this way in AIO. However, if you remove the relevant line from the Caddyfile, it will be re-added when you recreate the container.

I guess in theory, @szaimen could add a variable for this, which could then be passed to the container as an environment variable when it is started. However, I don’t think that it would be worth the effort, because if automatic renewal works properly, short lived certs aren’t an issue, and i you need different settings for whatever reason, or different challenge methods, or want to use a different certificate authority to Let’s Encrypt etc, you would need to use your own reverse proxy anyway.

Yes, absolutely. Automation will be inevitable sooner or later, because manual renewal, regardless of the CA, will no longer be feasible. So it’s better to make sure now that you have proper automation in place. :wink:

But somehow i don’t understand that such a change is not even mentioned in the release notes … at least i could not find anything to it …

It’s mentioned here: Release v13.0.3 · nextcloud/all-in-one · GitHub
(second bullet point under “New features and other improvements”

But what I’m curious about is why this is even an issue in the first place?

Well, if for example one has GeoIP blocking activated or does not want to keep open port 80 all the time … Opening the port and GeoIP once every 2-3 months is not the same as opening them every 6 days. With 6 days one is “forced” to deactivate such firewall rules.

The “fix” for another problem is interfering with the Let’s Encrypt policy.
Some very small Nextcloud installations are under permanent attack. The simple solution is a geo-filter in the firewall.
If we disable the filter, the attacks will start again soon. Nextcloud is just busy delivering the login page ten times per second. We use scheduled firewall rules to allow cert update after nextcloud backup. But timing is difficult and it works not very well.

Sure, lets wrap another virtual machine around the nextcloud, waste another gigabyte of ram.
Or just add some script lines like “if folder contains pfx file, use this, and skip Let’s encrypt”.
But i am just a user. Don’t know if this is possible at all.

Letsencrypt allows renewal without usage of port 80 but by using a txt-entry in DNS of your provider/DynDNS-provider. You will find more information about that in the Letsencrypt documentation.

That means you serve the login page on port 80? I guess one simple way would be to just allow /.well-known/acme-challenge/ and block anything else?

There’s also (again) one for TLS on 443 and one permanent dns one.

If i change the challenge in nextcloud AIO, it will overwrite my change at next update?

DNS-PERSIST-01 sounds like a cool solution. Is it possible to use this in AIO?