Issue Feature Needs Feedback

#99585Add Upgrade Wizard for Apache htaccess files

Oliver Hader 01/17/23, 20:10 updated 11/19/26, 11:09

Description

  • (for instance)
  • check state of fileadmin/.htaccess and compare with current version provided in TYPO3
  • offer diff view and/or possibility to override or deny (for CLI)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

Fix this issue

Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch

Commit message
[FEATURE] Add Upgrade Wizard for Apache htaccess files Resolves: #99585 Releases: main

Files 1

History 12

  1. Christian Kuhn commented and changed status New Needs Feedback <span data-processor="relativetime" data-value="2023-01-23T18:06:40+00:00" > 01/23/23, 18:06 </span>

    The “Directory Status” module in the install tool was / is designed to deal with stuff like this.

  2. Oliver Hader commented and changed attached 99585.png <span data-processor="relativetime" data-value="2023-01-23T18:21:31+00:00" > 01/23/23, 18:21 </span>

    That’s how it the install tool current “deals with it” in TYPO3 v12…

    99585.png

  3. Oliver Hader commented and changed removed the assignee <span data-processor="relativetime" data-value="2023-04-05T14:33:44+00:00" > 04/05/23, 14:33 </span>

    Would be a nice enhancement, but I don’t have time for working on this…

  4. Stephan Jorek commented <span data-processor="relativetime" data-value="2023-08-06T12:21:29+00:00" > 08/06/23, 12:21 </span>

    Hey folks,

    after discussing a little bit with some core-devs (during the T3DD2023 coding-night), a wanted to sum up what we’ve analysed so far.

    1. Mark (.htaccess) file candidates that could be handled by this feature in TYPO3\CMS\Install\FolderStructure\DefaultFactory::getDefaultStructureDefinition()
    2. Update the implementation used in TYPO3\CMS\Install\Controller\EnvironmentController::folderStructureGetStatusAction() to show a green badge, if the marked files from (1.) are either unchanged or only contain (line-based) additions (but no changes).
      • This ensures that custom rules don’t lead to false positives (ie. where rules have been added to public/.htaccess)
      • This should be implemented in TYPO3\CMS\Install\FolderStructure\FileNode, probably utilising sebastian/diff
    3. Update TYPO3\CMS\Install\FolderStructure\FileNode::fixSelf() adding a additional section which deals with changed files, propably by creating backup files and restoring the desired file contents
    4. Implement unit-tests to ensure the above changes are working
    5. Implement an update-wizard which utilises TYPO3\CMS\Install\FolderStructure\DefaultFactory to reset the changed files as described above. Of course after the user has given confirmation, probably after presenting a unified diff to the user first.
    6. Take care about the following implementations, which are using TYPO3\CMS\Install\FolderStructure\DefaultFactory
      • TYPO3\CMS\Install\Command\SetupCommand
      • TYPO3\CMS\Install\Controller\InstallerController
      • TYPO3\CMS\Install\Service\CoreUpdateService
  5. Benni Mack commented and changed status Accepted Needs Feedback <span data-processor="relativetime" data-value="2026-11-19T11:09:15+00:00" > 11/19/26, 11:09 </span>

    We’d also need to detect if we deal with a modified htaccess file. Other systems (ansible, etc) add markers to know which parts/lines were autogenerated but at the same time, we could also check for checksums, and see if we could update them like this?

    We could even have a version number in the first line? “TYPO3 htaccess v1” so we know what to update from and to.

    Looking at this feature, this is really tricky, and we really need to be careful to do the changes, and it feels like a custom project / library to do so.