Force https #247
Labels
No labels
Component: User interface
Component: Wymeditor
Help wanted
Level: Difficult
Level: Easy
Level: Moderate
Pagetype: Festival
Pagetype: Mailinglist
Pagetype: Peer reviewed article
Pagetype: Text
Privacy GDPR AVG
status: has conflicts
Status: Needs changes
Status: Needs discussion
Status: Needs review
Status: Ready to merge
Status: Waiting for response
Type: Bug
Type: Enhancement
Type: Question
Usecase: De Stadsbron
Usecase: Koppelting
Usecase: MeetjeStad
Value: Coders
Value: Security
Value: Users
Value: Visitors
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
harmen/hypha#247
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Using .htaccess:
https://serverguy.com/servers/redirect-http-to-https/
Both on live and test, so we test using the same parameters for this aspect...
This should be optional (not all installations have https enabled). Since .htaccess is currently in git, this might not be the best place to handle this (and IIRC .htaccess does not support including a secondary ".htaccess.local" or similar). We could handle this in PHP instead with a checkbox in the settings.
It should probably only be possible to enable such a feature through a HTTPS request, to prevent locking out yourself by enabling the force HTTPS when HTTPS is not working yet. There is still the possibility of lockout when HTTPS breaks after enabling this. Perhaps the relevant settings page can be excluded from this, or people should just modify hypha.xml to recover (this requires documentation in both cases).
Logging in should also be possible in the situation that you describe.
And logging in should be really secure? Catch 22?
Good point, so excluding the settings is not a good approach. Then it would be manually editing hypha.xml to recover (or, better, fix HTTPS again).
One other approach would be to configure this using a special file. E.g. create a file called
system/force-httpsor something like that, and check for that in .htaccess:This is untested, not sure if the relative path like this will always work. Also, not sure if this file should live inside system, or maybe in the root for extra visibility (or maybe be called FORCE-HTTPS, or .FORCE-HTTPS to hide it, or...).
One related thought is that in addition to forcing HTTPS, you might also want to force a specific domain when multiple aliases are available (e.g. always redirect example.com to www.example.com, or example.org to example.com). This is very similar to forcing HTTPS (including the same caveats about locking yourself out), so it would be good to implement this in the same way (possible using a single file, e.g.
system/force-urlthat would containhttps://www.example.com(but could maybe also contain//www.example.comto only force the domain orhttps://to only force the protocol?).Forcing a specific host (without hardcoding it in the .htaccess) probably requires handling this from PHP, but that can still be configured using a file (rather than an entry in the hypha.xml) to allow easy recovery in case of lockout.