[SOLVED] Nextcloud TrueCharts in SCALE: how to enable HSTS header to at least "155520000"

sos_nz

Explorer
Joined
Mar 17, 2023
Messages
58
So, I've got Nextcloud Truecharts 25.0.2_19.0.51 up and running in SCALE 22.12.2. All working 100%, behind HAProxy.

But, on the Administration page security setting check, it shows:
  • The "Strict-Transport-Security" HTTP header is not set to at least "15552000" seconds. For enhanced security, it is recommended to enable HSTS as described in the security tips ↗.
Question: how do I adjust those settings? I've tried editing the .htaccess file in the Nextcloud and nginx pod using the shell access provided, inserting the following:

<ifModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
</ifModule>

But on restarting the Nextcloud app, the security note remains.

I'm aware there's a similar thread, with the same question here:

But an answer wasn't forthcoming. If TrueCharts is setting that header in their app, it's not effectively being picked up by Nexcloud.
 

Sepol

Dabbler
Joined
Apr 15, 2022
Messages
12
TrueCharts has not updated Nextcloud for 2 months. Since the change on build channels, the creation of Nextcloud charts just stoped. I still run it, but thinking on drop it.
 
Last edited:

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
TrueCharts has not updated Nextcloud for 2 months.
TrueCharts hasn't updated anything for two months due to the change in their common chart (which required almost all users to reinstall almost all apps, resulting in much weeping and gnashing of teeth). Now that that's settled, they're resuming software updates. See:
 

Sepol

Dabbler
Joined
Apr 15, 2022
Messages
12
@danb35, I see, thank you for the heads-up. I will wait for the updates !
 

LarsR

Guru
Joined
Oct 23, 2020
Messages
719
If i remember correctly they also Plan a bigger overhaul of nextcloud and then move it from the stable to Enterprise train. I would wait with reinstalling/updating until that is done since you'd have to reinstall it again when the train is moved
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
I hope they implement a better host path data storage plan. Currently only the user data can be mounted outside, which isn’t the best when doing a redeploying of the app.

The official one allows you to delete the app, redeploy and point it back at your data without having to do anything else.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I hope they implement a better host path data storage plan.
I know they have reasons for preferring PVCs over host paths for most purposes. I don't think I understand the underlying technology well enough to understand those reasons, though.
 

sos_nz

Explorer
Joined
Mar 17, 2023
Messages
58
SOLVED: You can workaround this using OPNsense's HAProxy settings.

In HAProxy, open/edit your Public service. Under "SSL Offloading" enable Advanced Settings.

From the further options which appear, check "Enable HSTS", "HSTS IncludeSubDomains" and "HSTS preload". Finally, set "HSTS max age" to something larger than "155520000". Save & Apply.

Reload your nextcloud page, check administration, and enjoy the green tick of happyness!
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
...and if you were behind HAProxy all along, that shows that the configuration of the TrueCharts apps was and is irrelevant. But keep in mind that HSTS can lock you out of your Nextcloud (or other app) installation if there's a problem with your SSL cert. There's good reason to not enable it, at least early on.
 

sos_nz

Explorer
Joined
Mar 17, 2023
Messages
58
No - I wasn't behind HA Proxy - until yesterday I'd only read about it, but yesterday learnt all about its awesomeness for self-hosted services :)

It's very nice that it's so well included / implemented on OPNsense.

And yes, I've been running HSTS on my webserver for a few years, along with LE certs. It's all gravy!

Anyway, v. pleased to have solved this one.
 
Top