84729[FEATURE] Add setting for backend lock file location, drop typo3conf
Commit message
Review
-
Code review CR +2 Done
- Garvin Hicking +2
- Markus Klein +1
- Helmut Hummel +1
-
Verified V +2 Done
- Garvin Hicking +2
- Markus Klein +1
- Helmut Hummel +1
- core-ci +1 CI
Issues 3
Files 10
- typo3/sysext/backend/Classes/Authentication/BackendLocker.php4new+79 −0
- typo3/sysext/backend/Classes/Command/LockBackendCommand.php3+14 −21
- typo3/sysext/backend/Classes/Command/UnlockBackendCommand.php+10 −15
- typo3/sysext/backend/Classes/Controller/AjaxLoginController.php2+4 −3
- typo3/sysext/backend/Classes/Middleware/LockedBackendGuard.php6+15 −11
- typo3/sysext/core/Configuration/DefaultConfiguration.php3+1 −0
- typo3/sysext/core/Configuration/DefaultConfigurationDescription.yaml4+3 −0
- typo3/sysext/core/Documentation/Changelog/13.3/Feature-104126-AddConfigurationSettingToDefineBackendLockingFile.rst3new+51 −0
- typo3/sysext/core/Documentation/Changelog/13.3/Important-104126-DropTypo3confDirectoryFromSystemStatusAndBackendLocking.rstnew+34 −0
- typo3/sysext/install/Classes/Service/EnableFileService.php5+14 −4
Review log 4559
Show 2534 earlier messages
-
Garvin Hicking uploaded patch set 1 06/17/24, 09:31
-
core-ci voted on patch set 1 V -1 06/17/24, 09:36 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59717
-
Mathias Brodala commented on patch set 1 06/17/24, 09:37
WIP, I know, but still. ;-)Environment.php:290How about "getTransientStatePath" instead? At least the current usage is not related to "configuration" but "state" instead. Also I'd question if this is really transient. The backend can be locked for a long time and ENABLE_INSTALL_TOOL can be persistent if it contains the correct content. So maybe reduce this to getStatePath() and consider using a dedicated directory? -
Garvin Hicking uploaded patch set 2
V -106/17/24, 10:52 -
Garvin Hicking commented on patch set 2 06/17/24, 10:56
Environment.php:290ReplyThank you. I will leave this open up for discussion, I'm unsure to introduce such a directory myself. I think you are right though, it would probably be put into the `config/` path then, that resembles the old `typo3conf` directory more? -
core-ci voted on patch set 2 V -1 06/17/24, 10:57 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59720
-
Garvin Hicking uploaded patch set 3
V -106/17/24, 10:57 -
Mathias Brodala commented on patch set 2 06/17/24, 10:58
Important-104126-ReferenceIndexRebuildRequired.rst:14IMO: > Composer Mode Thus "a thing" (capitalized) and no quotes since it's not something alien by now.Important-104126-ReferenceIndexRebuildRequired.rst:23> Composer ModeImportant-104126-ReferenceIndexRebuildRequired.rst:24There was nothing "unproper" before, so I'd drop this.Important-104126-ReferenceIndexRebuildRequired.rst:26Both paths should be written explicitly and clearly, e.g. using bullets.Important-104126-ReferenceIndexRebuildRequired.rst:30This actually suggests that there is a command to enable the install tool. ;-) -
Mathias Brodala commented on patch set 3 06/17/24, 10:59
Environment.php:290ReplyYup, that's not where these files belong. The "config" path may not even be writable after deployment. -
core-ci voted on patch set 3 V +1 06/17/24, 11:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59721
-
Garvin Hicking uploaded patch set 4
V +106/17/24, 11:18Docs -
Garvin Hicking commented on patch set 4 06/17/24, 11:18
Important-104126-ReferenceIndexRebuildRequired.rst:14ReplyDoneImportant-104126-ReferenceIndexRebuildRequired.rst:23ReplyDoneImportant-104126-ReferenceIndexRebuildRequired.rst:24ReplyBut it was "typo3conf" previously, even in Composer Mode. I do see this as "unproper"? I'll resolve this, but "proper" directory storage for this is also left up for discussion, so needs adjustment anyways.Important-104126-ReferenceIndexRebuildRequired.rst:30ReplyDone -
core-ci voted on patch set 4 V +1 06/17/24, 11:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59723
-
Garvin Hicking updated the commit message in patch set 5
V +106/17/24, 12:31restrict to main -
core-ci voted on patch set 5 V +1 06/17/24, 12:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59729
-
Garvin Hicking uploaded patch set 6
V +106/17/24, 13:17rephrasing -
core-ci voted on patch set 6 V +1 06/17/24, 13:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59730
-
Helmut Hummel commented on patch set 6 06/17/24, 14:00
Environment.php:290ReplyWhat about var/lock ? -
Helmut Hummel commented on patch set 6 06/17/24, 14:00
AjaxLoginController.php:117why has this path a trailing slash? -
Garvin Hicking uploaded patch set 7
V +106/18/24, 06:48Change to var lock -
Garvin Hicking commented on patch set 7 06/18/24, 06:49
AjaxLoginController.php:117ReplyTrue, it's not in line with the other paths. Changed now to remove trailing slash from the getTransientPath/getLockPath return.Environment.php:290ReplyI think that's the best option, changed this path to use it.Important-104126-ReferenceIndexRebuildRequired.rst:24ReplyDoneImportant-104126-ReferenceIndexRebuildRequired.rst:26ReplyDone -
core-ci voted on patch set 7 V +1 06/18/24, 06:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59779
-
Mathias Brodala commented on patch set 7 CR -1 06/18/24, 07:06
LockedBackendGuard.php:43The new path should be mentioned first, the legacy path afterwards. However, "LOCK_BACKEND" by itself without path would be enough.LockedBackendGuard.php:75See above. Also "lock", not "transient" if kept.LockedBackendGuard.php:96See above; if kept, mention Composer first, then legacy. Also how about inserting the actual path (sans web path prefix) instead here? Then people will know right away which one to check. Also we should explicitly mention the CLI command instead of "CLI-scripts"Important-104126-DropTypo3confDirectoryFromSystemStatusAndBackendLocking.rst:27No mention of ENABLE_INSTALL_TOOL anymore? Also "... is now ... (unchanged)" reads odd. Please only state the new paths here or the old one in parentheses.Important-104126-DropTypo3confDirectoryFromSystemStatusAndBackendLocking.rst:33Edge case but it should be mentioned that upgrading from an instance with files in typo3conf will "lose" its state (backend unlocked, install tool disabled) since these files are ignored after the switch to the new release.EnableFileService.php:168The legacy one must stay "typo3conf/", or am I wrong? -
Garvin Hicking uploaded patch set 8
CR -1V +106/18/24, 09:00Address code review -
Garvin Hicking commented on patch set 8 06/18/24, 09:01
Thank you so much @mbrodala@pagemachine.de for the detailed comments and review, this means a lot to me. I've tried to address your feedback, with one remaining question. :-)LockedBackendGuard.php:43ReplyShuffled them. I'd like to leave the full path here, then one can search for "typo3conf/LOCK_BACKEND". I've also addressed that the file may actually reside in three places (typo3conf, config, var/lock). (To make fulltext search work I decided to spell out all three places and not do something like `(typo3conf|config)/LOCK_BACKEND`.)LockedBackendGuard.php:75ReplyDoneLockedBackendGuard.php:96ReplyThank you, I missed this one. I believe the lookup for the actual path might prove a bit to finicky, I'd rather have this resolving beyond the scope of this PR.Important-104126-DropTypo3confDirectoryFromSystemStatusAndBackendLocking.rst:27ReplyYes I removed this because no longer a central function is used to resolve the directory for ENABLE_INSTALL_TOOL and BACKEND_LOCK because they are now put into distinct directories. Nothing for ENABLE_INSTALL_TOOL changes, so I removed the mention here. Also rephrased the list so that I try to point out when it's typo3conf/ and when it's config/ instead (changing this would also be outside the scope of this PR)Important-104126-DropTypo3confDirectoryFromSystemStatusAndBackendLocking.rst:33ReplyThat's a good idea. I also added a note about persisting LOCK_BACKEND for deployments.EnableFileService.php:168ReplyOK so this one needs a bit discussion, I hope you bear with me: typo3conf/ is used when project path = public path config/ is used in all else NON-COMPOSER installs The latter would IMO be the more preferrable to have. This method actually is only used to display a path, it's not used for the actual directory retrieval. So I wanted to enforce people "recognizing" the "new" config/ directory here, that's why I changed the display output. I could leave it at `typo3conf/` of course, but that might not apply to a larger user base anymore. I did not want to change this too much by for example evaluating the "real" path used with string replacement and introducing a chance of accidentally disclosing directory information. I could place "config/ or typo3conf/" as a string in here, though. Thoughts? -
core-ci voted on patch set 8 V +1 06/18/24, 09:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59786
-
Helmut Hummel commented on patch set 8 06/18/24, 15:04
EnableFileService.php:168Reply@gh@faktor-e.de Consider the following to be true in all non composer installs: project path = public path In non composer installs, you can only achieve something different, when you really know what you are doing and change env vars accordingly -
Garvin Hicking commented on patch set 8 06/18/24, 15:20
EnableFileService.php:168Reply@typo3@helhum.io OK, but since it's technically possible people have this in config/ or typo3conf/ it might then be best to describe all three paths? As for the output then, revealing "config/" as the target directory (for public=project) of LOCK_BACKEND would be better than "typo3conf/", do I understand you right? So for the casual user, they only see "config/" here, and can place the file for their legacy installs there. And the people who re-configured their setup in a way that typo3conf/ might be used, they'll know where to look, right? -
Benni Mack commented on patch set 8 CR -1 06/20/24, 10:41
Sorry, but the Environment API was built in a way that you can override / initialize the paths. You now introduce two new "paths" without having the option to override parts. getLockPath() seems to be VERY specific IMHO, and shouldn't belong in a class which always exists from the first microsecond of every TYPO3 Request. Or maybe it should? Just putting this aside. getLockPath() actually reminds me about the actual "locking" in our Locking API. So I'm not a huge fan of the name per sé. -
Garvin Hicking commented on patch set 8 06/20/24, 10:57
Reply
I understand, and agree this is a very specific utility method. I wonder though were else we could implement it, because the paths need to be accessed in two different commands, plus controller plus middleware. Adding a new class for these two directories feels odd. Would you have a suggestion on where you would see this? -
Mathias Brodala commented on patch set 8 06/20/24, 11:03
Reply
Also I'd then question getLabelsPath() which also derives from the var-path without being configurable. Adding more accessors deriving from var-path seem valid then. -
Markus Klein commented on patch set 8 CR -1 07/16/24, 11:23
Please do not use var/lock for anything else but files related to locking-mechanisms. IMO /var/transient is a better place -
Benni Mack uploaded patch set 9
CR -1V +107/16/24, 18:32 -
core-ci voted on patch set 9 V +1 07/16/24, 18:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61648
-
Mathias Brodala commented on patch set 9 07/17/24, 13:24
BackendLocker.php:52Since this is used at exactly one location, maybe rename to "getRedirectUri"? This gives this arbitrary string juggling a bit more semantic. -
Garvin Hicking uploaded patch set 10
V +107/17/24, 13:28Make lock location configurable -
core-ci voted on patch set 10 V +1 07/17/24, 13:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61688
-
Garvin Hicking uploaded patch set 11
V +107/17/24, 13:35Rename variables and methods for clearer intent -
Garvin Hicking commented on patch set 11 07/17/24, 13:36
Reply
This has now been addressed by Bennis Patchset with a distinct BackendLocker service, which no longer needs to "interfer" with the Environment API.Thanks for the group effort here, much appreciated. Current iteration should hopefully address all needs and adjusted documentation for it.Reply
We discussed this internally, there were several possibilities and none fit perfectly. So now this location is configurable for custom needs and depending on lock/filesystem setup, and only the default is set to var/lock and can be overriden.BackendLocker.php:52ReplyI agree and made a proposal in Patchset 11.EnableFileService.php:168ReplyI'm resolving this, summary: * The returned path here is only for display reasons * TYPO3v12+ location will be config/ and not typo3conf/ -
core-ci voted on patch set 11 V +1 07/17/24, 13:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61689
-
Garvin Hicking uploaded patch set 12
V +107/17/24, 14:00Tag as feature instead of task -
core-ci voted on patch set 12 V +1 07/17/24, 14:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61693
-
Markus Klein commented on patch set 12 07/17/24, 16:24
DefaultConfiguration.php:1312I still have to think about the naming. Maybe go with "backendlockFilePath" or "backendlockFileLocation" -
Garvin Hicking commented on patch set 12 07/17/24, 17:38
DefaultConfiguration.php:1312ReplyI had like 5 iterations of this - I would like to keep the "lock" prefix here, because the other settings that are kind of related use it too. Generally I don't mind changing it, but hope for consent. "location" feels like you might be able to enter a URL here. i think we'll need the terms "lock", "backend" and "file" (because its not a path, but the full name) for it? -
Mathias Brodala commented on patch set 12 07/18/24, 10:25
BackendLocker.php:39Sorry, noticed too late: this should also say $redirectUri and also all consumers of this method should use suitable variable names. Again, this makes it clearer what this content is meant for. (And yes, for type safety this should actually be UriInterface everywhere but that's likely too much for now.) -
Garvin Hicking uploaded patch set 13
V +107/18/24, 22:08Rename internal variable for clarity -
Garvin Hicking commented on patch set 13 07/18/24, 22:10
BackendLocker.php:39ReplyThanks for spotting this! I tried to unify that with a clear variable name $redirectUriFromLockFileContent now. I would like to keep it as a string for now, to keep the complexity of this patch at bay, if that's ok with you. -
core-ci voted on patch set 13 V +1 07/18/24, 22:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61765
-
Markus Klein commented on patch set 13 07/19/24, 17:39
DefaultConfiguration.php:1312ReplyAcknowledged -
Markus Klein commented on patch set 13 07/19/24, 17:51
LockBackendCommand.php:46While we are at it: "redirect to the locking state" does not make any sense to me. I think we should rephrase this.DefaultConfigurationDescription.yaml:237"must be writable for the PHP user" this may be different in some casesDefaultConfigurationDescription.yaml:237Directory *must be* relativeFeature-104126-AddConfigurationSettingToDefineBackendLockingFile.rst:30"or" is superfluous -
Garvin Hicking uploaded patch set 14
V +107/19/24, 19:35Apply code review suggestions -
Garvin Hicking commented on patch set 14 07/19/24, 19:37
LockBackendCommand.php:46ReplyGood one, I didn't even read that yet. Tried to rephrase this, what do you think?DefaultConfigurationDescription.yaml:237ReplyDoneDefaultConfigurationDescription.yaml:237ReplyDoneFeature-104126-AddConfigurationSettingToDefineBackendLockingFile.rst:30ReplyActually I wanted to express three possibilities: * Change your deployment script for the new location * Adjust the setting to point to "the old location" * Use the CLI I see that this was not phrased well and tried another stab, how about that? -
core-ci voted on patch set 14 V +1 07/19/24, 19:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61837
-
Markus Klein commented on patch set 14 CR +1 07/25/24, 16:08
LockBackendCommand.php:46ReplyDoneFeature-104126-AddConfigurationSettingToDefineBackendLockingFile.rst:30ReplyDone -
Garvin Hicking commented on patch set 14 07/31/24, 08:04
Would anyone like to talk about this on T3DD24 to talk about if/how to push this forward? -
Helmut Hummel voted on patch set 14 CR +1 V +1 08/07/24, 10:30
-
Markus Klein voted on patch set 14 V +1 08/07/24, 12:32
-
Garvin Hicking voted on patch set 14 CR +2 V +2 08/07/24, 12:49
-
Garvin Hicking merged patch set 15 08/07/24, 12:49