Skip to content
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

SystemCheck Addon , check and fix htaccess #20771

Draft
wants to merge 2 commits into
base: 5.x-dev
Choose a base branch
from

Conversation

ayurmedia
Copy link

Description:

On the Page for SystemCheck Section FileIntegrity this change will show missing .htaccess files, and automatically repair the files like in Update 3.0.0.

As discussed in the Forum, randomly htaccess Files will be missing during Installation.
This Fix will repair the files automatically by removing the managed htaccess files and create them again like during the installation.

https://forum.matomo.org/t/how-to-harden-a-matomo-installation/49765/34?u=unterberger.media

Review

On SystemCheck Widget in Section FileIntegrity it will show missing .htaccess files, and automatically repair the files like in Update 3.0.0.
@sgiehl
Copy link
Member

sgiehl commented May 26, 2023

I don't have time right now to read the forum thread, but all htaccess files should be (re)created after setting up the first website during installation and whenever Matomo or a plugin has been updated.
So if such files are missing they might have been removed manually, or the webserver didn't have write permission to the directory.
I personally don't think we should start to do any sort of auto-repair while running file integrity check. It is unexpected that a "check" also performs an action.
Providing a command or an action that can be triggered in the UI would be something more suitable I think.

@github-actions
Copy link
Contributor

If you don't want this PR to be closed automatically in 28 days then you need to assign the label 'Do not close'.

@github-actions github-actions bot added the Stale The label used by the Close Stale Issues action label Jun 10, 2023
@michalkleiner
Copy link
Contributor

Following on from sgiehl's comment, would you be able to move the repair mechanism to a task that can be manually triggered? Not sure whether it should be within core, e.g. core:repairhtaccess or similar, but we can start there and then adjust it later on.
I agree with the sentiment that a check shouldn't magically repair the files. It's a check, it can report on the missing files, and suggest running the repair command.

@github-actions github-actions bot removed the Stale The label used by the Close Stale Issues action label Jun 11, 2023
@github-actions github-actions bot added the Stale The label used by the Close Stale Issues action label Jun 25, 2023
@sgiehl sgiehl added Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. and removed Stale The label used by the Close Stale Issues action labels Jul 10, 2023
@github-actions github-actions bot added the Stale The label used by the Close Stale Issues action label Jul 25, 2023
@matomo-org matomo-org deleted a comment from github-actions bot Jul 25, 2023
@matomo-org matomo-org deleted a comment from github-actions bot Jul 25, 2023
@sgiehl sgiehl removed the Stale The label used by the Close Stale Issues action label Jul 25, 2023
@sgiehl sgiehl marked this pull request as draft July 25, 2023 14:08
@github-actions
Copy link
Contributor

github-actions bot commented Aug 9, 2023

If you don't want this PR to be closed automatically in 28 days then you need to assign the label 'Do not close'.

@github-actions github-actions bot added the Stale The label used by the Close Stale Issues action label Aug 9, 2023
@github-actions
Copy link
Contributor

This PR was last updated more than one month ago, maybe it's time to close it. Please check if there is anything we still can do or close this PR. ping @matomo-org/core-reviewers

@github-actions github-actions bot added the Stale for long The label used by the Close Stale Issues action label Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. Stale for long The label used by the Close Stale Issues action Stale The label used by the Close Stale Issues action
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants