Hi Andreas,
I'm not sure if this is going in the right direction - this is currently
implemented at at a local module level
(sling-org-apache-sling-resourceresolver)
when it is really something that the platform should support (see
below).
Also note that your example/reasoning in the description of SLING-7768
only lists DEV/QA/STAGING/PROD - if you are limited to those
environments you
can easily do with runmodes. Placeholder replacement becomes interesting
when
you think about an "elastic number of environments" that are not known
at
development time (think about spinning up "STAGING-7" for that special
performance
test that needs to run in isolation)
... Ruben and I think it could be helpful to make the Placeholder
Provider
more generic to that it could be used in other services like the
distribution/replication, externalizers etc to have an easier way to
manage server configuration in a central place.
I agree we should have the capability in the platform, but IMHO it
should not
be in sling-org-apache-sling-resourceresolver. There was a discussion in
jackrabbit-dev:
http://jackrabbit.510166.n4.nabble.com/Environment-specific-non-role-based-configurations-td4669795.html
and https://issues.apache.org/jira/browse/JCRVLT-254
for the initial issue.
Btw.: you can achieve your requirement already today (down to AEM 6.0)
with
https://github.com/Netcentric/system-env-install-hook
(but I'd rather see this as first-class citizen as part of the platform
and not as a third-party module)
* No need to support anything else like files and system properties to
provide the placeholders. Makes error handling much more complicated
(what
do you do if the http download of that placeholder file fails?), and I
would rather leave it to the ops team to implement that process and
handle
any errors.
I see the issue with the external files / web resources. The system
properties are there to make sure an admin can override any settings
if things do not work out.
I agree here with Jörg that allowing external URLs is dangerous here
(and
it could even be seen critical from a security perspective). Also, the
config allows
to give both key value pairs directly and a URL to retrieve them from -
I suppose
these two property sets are merged?
But to sum up I think the best would be to have a mechanism for
placeholder replacement
on a lower level...
-Georg