Hi Tim,
please see responses below

On Mon, Mar 20, 2017 at 6:26 PM, Keane, Tim <tke...@doitt.nyc.gov> wrote:

> Alessio-
>
>
>
> Thank you very much.  This is definitely what I am after.  I just have a
> couple of points that maybe you can clarify for me:
>
>
>
> 1.        It appears that the properties in geoserver-environment.properties
> can only be applied to configuration in data_dir/workspaces such as
> datastore.xml and coveragestore.xml files, but not other configuration like
> data_dir/logging.xml, data_dir/gwc/geowebcache.xml, or
> data_dir/security/usergroup/default/users.xml – is this correct?
>

*It should work also on other catalog settings, not only on catalog. At
least settings accessible from the UI. Did you already tried it on other
settings?*


> 2.       It also looks like according to the comment in the source code
> for GeoServerEnvironment.java that System variables should also work,
> however neither setting them as System Environment variables or setting
> them in JAVA_OPTS seemed to work – only placing the 
> geoserver-environment.properties
> in the data directory worked. https://github.com/geoserver/geoserver/blob/
> 0054d601f5283fbde087bb253286e9512185d998/src/platform/src/
> main/java/org/geoserver/platform/GeoServerEnvironment.java#L153
>

*That's strange. From what I can see here *
https://github.com/geoserver/geoserver/blob/0054d601f5283fbde087bb253286e9512185d998/src/platform/src/main/java/org/geoserver/platform/GeoServerEnvironment.java#L129
*it
first searches for the property on System and if not null is uses it. You
may try to rise up the log level and see if you find the line *"Could not
access system property ..."

>
>
> Ideally I would like to be able to externalize the data directory using
> the env var GEOSERVER_DATA_DIR and also any property contained within
> config files found in the data directory, allowing for the same war file to
> be deployed across environments.
>

*This feature should be able to parametrize almost all config files. If
someone is not resolved correctly it may be either an issue or not handled
by the code.*

*If you have a very specific use case, you might also consider to backup
and restore the configuration parametrized and implement special extensions
that mangle the data dir like we did in this example for the ImageMosaics*

https://github.com/geoserver/geoserver/blob/55c4740060eb2b8809ae935a510ac83eeb923313/src/community/backup-restore/extension/src/main/java/org/geoserver/backuprestore/imagemosaic/reader/ImageMosaicAdditionalResourceReader.java


*Notice that the backup and restore zip files may be also streamed via
REST. That way you can easily implement scripts to deploy configurations
remotely.*



>
>
> Thanks
>
> -Tim
>
>
>
>
>
> *From:* Alessio Fabiani [mailto:alessio.fabi...@geo-solutions.it]
> *Sent:* Monday, March 20, 2017 11:39 AM
> *To:* Keane, Tim <tke...@doitt.nyc.gov>
> *Cc:* geoserver-users@lists.sourceforge.net
> *Subject:* Re: [Geoserver-users] spring PropertyPlaceholderConfigurer for
> data directory files?
>
>
>
> Hi Tim,
>
> during the work for the Backup & Restore plugin for GeoServer, we had the
> chance to implement also the possibility for GeoServer of externalize
> catalog parameters into a ".properties" file placed on the GeoServer Data
> Directory.
>
> Hopefully this may help you.
>
>
>
> Some more details and a small example on how to use it can be found here
>
>
>
> http://docs.geoserver.org/latest/en/user/community/
> backuprestore/configtemplate.html
>
>
>
> Please, notice that the documentation is a bit misleading. You won't need
> to install also the Backup & Restore plugin, this functionality is already
> available on GeoServer.
>
>
>
> Let me know how it goes and if you need further details/help on this.
>
>
>
> Cheers,
>
> Alessio Fabiani.
>
>
>
>
> Best Regards,
>
> Alessio Fabiani.
>
>
>
> ==
>
> GeoServer Professional Services from the experts!
>
> Visit http://goo.gl/it488V for more information.
>
> ==
>
>
>
> Ing. Alessio Fabiani
>
> @alfa7691
>
> github <https://github.com/afabiani?tab=overview>
>
> Founder/Technical Lead
>
>
>
> GeoSolutions S.A.S.
>
> Via di Montramito 3/A
>
> 55054  Massarosa (LU)
>
> Italy
>
> phone: +39 0584 962313 <0584%20962313>
>
> fax:     +39 0584 1660272 <0584%20166%200272>
>
> mob:   +39 331 6233686 <331%20623%203686>
>
>
>
> http://www.geo-solutions.it
>
> http://twitter.com/geosolutions_it
>
>
>
> -------------------------------------------------------
>
>
>
> *AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*
>
> Le informazioni contenute in questo messaggio di posta elettronica e/o
> nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
> loro utilizzo è consentito esclusivamente al destinatario del messaggio,
> per le finalità indicate nel messaggio stesso. Qualora riceviate questo
> messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
> darcene notizia via e-mail e di procedere alla distruzione del messaggio
> stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
> divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
> utilizzarlo per finalità diverse, costituisce comportamento contrario ai
> principi dettati dal D.Lgs. 196/2003.
>
>
>
> The information in this message and/or attachments, is intended solely for
> the attention and use of the named addressee(s) and may be confidential or
> proprietary in nature or covered by the provisions of privacy act
> (Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
> Code).Any use not in accord with its purpose, any disclosure, reproduction,
> copying, distribution, or either dissemination, either whole or partial, is
> strictly forbidden except previous formal approval of the named
> addressee(s). If you are not the intended recipient, please contact
> immediately the sender by telephone, fax or e-mail and delete the
> information in this message that has been received in error. The sender
> does not give any warranty or accept liability as the content, accuracy or
> completeness of sent messages and accepts no responsibility  for changes
> made after they were sent or for other risks which arise as a result of
> e-mail transmission, viruses, etc.
>
> ---------------------------------------------------------------------
>
>
>
> On Mon, Mar 20, 2017 at 3:29 PM, Keane, Tim <tke...@doitt.nyc.gov> wrote:
>
> Is there a mechanism for using a properties file for value substitution
> into all things xml in the data directory? (i.e., datastore.xml,
> coveragestore.xml, users.xml)
>
>
> ------------------------------
>
>
> This e-mail, including any attachments, may be confidential, privileged or
> otherwise legally protected. It is intended only for the addressee. If you
> received this e-mail in error or from someone who was not authorized to
> send it to you, do not disseminate, copy or otherwise use this e-mail or
> its attachments. Please notify the sender immediately by reply e-mail and
> delete the e-mail from your system.
>
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Geoserver-users mailing list
> Geoserver-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to