Feature #33581

Extend configuration/context

Added by Peter Russ over 7 years ago. Updated over 7 years ago.

Status:
Resolved
Priority:
Should have
Category:
Core
Start date:
2012-02-01
Due date:
% Done:

100%

PHP Version:
Has patch:
Yes
Complexity:

Description

So far FLOW3 context is limited to Development, Testing and Production.
Further there is no way that operation/admin can add or overule configuration e.g. to set credentials which should not be store in a dev repro.

FLOW3_SUBSYSTEM

To give more flexibility to the configuration a new environment constant is added FLOW3_SUBSYSTEM:
this could hold e.g. machine or vhost name

If this is set Configuration will be created that way:
Configuration/Settings.yaml
Configuration/<FLOW3_CONTEXT>/Setting.yaml
Configuration/<FLOW3_CONTEXT>/<FLOW3_SUBSYSTEM>.Setting.yaml

The benefit of that is that you can run e.g. Production Context on a machine for staging with slightly different settings e.g. for the database or a LDAP.

FLOW3_STATIC_CONFIGURATION

Credentials or settings that should be set by operations/admin can be define by providing the absolute path and filename without '.yaml' in FLOW3_STATIC_CONFIGURATION.

If this is set Configuration will be created that way:
Configuration/Settings.yaml
Configuration/<FLOW3_CONTEXT>/Setting.yaml
Configuration/<FLOW3_CONTEXT>/<FLOW3_SUBSYSTEM>.Setting.yaml
<FLOW3_STATIC_CONFIGURATION>.yaml

Only small changes in Web/index.php, Bootstrap and ConfigurationManager are required.

Patch attached

33581.patch View (9.34 KB) Peter Russ, 2012-02-01 10:34

33581-V2.patch View (10.4 KB) Peter Russ, 2012-02-07 12:00

missing_flow3.patch View (1.11 KB) Peter Russ, 2012-02-07 12:00

Associated revisions

Revision 9df55671 (diff)
Added by Sebastian Kurfuerst over 7 years ago

[!!!][FEATURE] (Core): Nested FLOW3 Application Contexts

With this change, it is possible to use nested FLOW3 contexts like
"Production/Live" or "Production/Staging/Server1". The main context,
has to be one of "Production", "Development" or "Testing", whereas
arbitrary sub contexts are supported.

If you run in the context "Production/Staging/Server1", the configuration
is inherited in the following way (from most specific to most general):

- Production/Staging/Server1
- Production/Staging
- Production
- as a fallback, the, non-context-specific configuration is used

This change is breaking in the following cases:

- You called TYPO3\FLOW3\Core\Bootstrap::getContext() or
TYPO3\FLOW3\Object\ObjectManagerInterface::getContext()

In this case, not the context string is returned anymore, but instead
the TYPO3\FLOW3\Core\ApplicationContext object. It can be cast to a string to
get the old behavior back; but usually you instead want to call
$context->isDevelopment(), $context->isProduction() or $context->isTesting().

- You wrote your own cache backend

The cache backend constructor now expects the $context object to be of type
TYPO3\FLOW3\Core\ApplicationContext.

Additionally, we removed some leftovers from the configuration manager,
especially Signals/Slots configuration as this is not used anymore.

Releases: 1.1
Resolves: #33581
Change-Id: I3ffe0f98b0c92df41edaa15c7d895422aab28411

Revision 4fe6851b (diff)
Added by Karsten Dambekalns over 7 years ago

[TASK] Small docblock cleanup to Bootstrap

Change-Id: I594f7ab42ac59e95baec39011554eaba6a304293
Related: #33581
Releases: 1.1

Revision cb141c73 (diff)
Added by Karsten Dambekalns about 7 years ago

[TASK] Create configuration directories only on save

The configuration directories for cached configuration were created
inside the constructor of the ConfigurationManager. This caused the
unit test to create directories outside the VFS. Moving the creation
to the saveConfigurationCache method fixes that. Additionally cleans
up some unit tests related to ApplicationContext and
ConfigurationManager.

Change-Id: I90d3f1410314fa39836fdde2a28c911a173a630d
Related: #33581
Releases: 1.1, 1.2

Revision 2a228475 (diff)
Added by Karsten Dambekalns about 7 years ago

[TASK] Create configuration directories only on save

The configuration directories for cached configuration were created
inside the constructor of the ConfigurationManager. This caused the
unit test to create directories outside the VFS. Moving the creation
to the saveConfigurationCache method fixes that. Additionally cleans
up some unit tests related to ApplicationContext and
ConfigurationManager.

Change-Id: I90d3f1410314fa39836fdde2a28c911a173a630d
Related: #33581
Releases: 1.1, 1.2

History

#1 Updated by Peter Russ over 7 years ago

#2 Updated by Karsten Dambekalns over 7 years ago

  • Project changed from TYPO3 Flow Base Distribution to TYPO3.Flow

#3 Updated by Karsten Dambekalns over 7 years ago

  • Category set to Core
  • Target version deleted (1.1)
  • Has patch set to No

#4 Updated by Peter Russ over 7 years ago

  • Target version set to 1.1

why is patch set to no although there is one attached?

#5 Updated by Peter Russ over 7 years ago

  • Target version deleted (1.1)

#6 Updated by Karsten Dambekalns over 7 years ago

  • Has patch changed from No to Yes

Peter Russ wrote:

why is patch set to no although there is one attached?

By accident, it's the default it seems. No intended change. :)

#7 Updated by Karsten Dambekalns over 7 years ago

Regarding the FLOW3_STATIC_CONFIGURATION idea, please check https://review.typo3.org/5731 and see if that would work for you.

#8 Updated by Peter Russ over 7 years ago

As operation might use different versioning system this will not work for us. Further it requires to restart the php-fpm to activate the settings. This is not really practicable. Further it seems to be a solution to set a few parameters.
I discussed with our operations with the result that our solution would be prefered.

#9 Updated by Chris Zepernick over 7 years ago

I have to agree with Peter there,... passwords and stuff in environment of the v-host is a big no no in most enterprise scenarios, and most likely will not be approved by security audit.

I also would prefer Peters solution on the one hand because of security reasons, on ther other because it can provide us with an option for A/B Testing and stuff, without the hazzel to need to have the config seperated from the project to do so.

Our setup at the moment:

1. Development
2. Continous Deployment Development
-------------------------------------------
3. System Integration (For Release Build)
4. Testing (Unit Testing and Stuff)
-------------------------------------------
5. Production
6. A/B Closed User group testing of new Features

We currently work with a of staff of 10 Devs and 2 Admins at one of Telekoms Top 60 Intranet Solutions, of which FLOW3 is a Core component serving as the middleware to our TYPO3 systems.

Regards

Chris

#10 Updated by Peter Russ over 7 years ago

Added new version of patch as flow3.php patched part was missing

#11 Updated by Sebastian Kurfuerst over 7 years ago

  • Status changed from New to Accepted
  • Assignee set to Sebastian Kurfuerst

I'm currently working on this one.

Main question is how to call this "subSystem":

  • FLOW3_SUBSYSTEM
  • FLOW3_SUBCONTEXT
  • FLOW3_TARGET
  • ... your idea here

#12 Updated by Peter Russ over 7 years ago

As we are using this already on several servers in production we would prefer to stay with
FLOW3_SUBSYSTEM (similar we use in TYPO3 ;-)

Example: We are in the production context and have there systems with different tasks:
one for system integration testing, an other for approval or one for beta.

That the reason we we decided to use FLOW3_SUBSYSTEM.

#13 Updated by Karsten Dambekalns over 7 years ago

Since any new context should inherit from either production or development, I'd rather like to see FLOW3_CONTEXT get the ability to be fed with something like Development, Production/Staging and Production/Live.

Any splitting into FLOW3_CONTEXT and FLOW3_SUBSYSTEM (and where is it a subsystem of FLOW3?) is more complexity IMHO.

#14 Updated by Gerrit Code Review over 7 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10808

#15 Updated by Gerrit Code Review over 7 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10808

#16 Updated by Gerrit Code Review over 7 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10808

#17 Updated by Gerrit Code Review over 7 years ago

Patch set 4 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10808

#18 Updated by Gerrit Code Review over 7 years ago

Patch set 5 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10808

#19 Updated by Gerrit Code Review over 7 years ago

Patch set 6 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10808

#20 Updated by Gerrit Code Review over 7 years ago

Patch set 7 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10808

#21 Updated by Gerrit Code Review over 7 years ago

Patch set 8 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10808

#22 Updated by Gerrit Code Review over 7 years ago

Patch set 9 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10808

#23 Updated by Gerrit Code Review over 7 years ago

Patch set 10 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10808

#24 Updated by Gerrit Code Review over 7 years ago

Patch set 11 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10808

#25 Updated by Gerrit Code Review over 7 years ago

Patch set 12 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10808

#26 Updated by Gerrit Code Review over 7 years ago

Patch set 13 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10808

#27 Updated by Sebastian Kurfuerst over 7 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 80 to 100

#28 Updated by Karsten Dambekalns over 7 years ago

  • Target version set to 1.1 beta 1

Also available in: Atom PDF