-
Notifications
You must be signed in to change notification settings - Fork 967
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
include base(); "config://" url handler; #22
Comments
I'm not sure I understand all aspects of the suggestion, but you could add the base config directory to the classpath, right? or maybe there's a reason that a separate "config path" can be useful? Also it should work to manually include one file from the base config directory, and then have that file include all the others relatively. Should only have to specify the full path to the first "bootstrap" file... |
Havoc, hello: thanks for considering this; my typesafe.config use-case:
"master" "version"
thank you; Andrei. |
Thanks for the detailed use-case, I guess I would need to dig in here a bit. I think the hooks are there and you could use either the custom url protocol or a ConfigIncluder implementation to do this, but both are fairly cumbersome, so some kind of "just extend the search path" convenience feature could certainly make sense. Perhaps it could just be an option added to ConfigParseOptions (say setSearchPath), and also a system property supported in ConfigFactory.load (similar to -Dconfig.file= etc. we could have config.path). Something along those lines, not sure. |
cool; let it cook then :-) |
Also relevant is #202, right now includes are not in fact relative to the including file if you specify url()/file()/classpath(). |
@carrot-garden: I assume you solved this by now, four years later ;) May I ask what you did? |
Hey @havocp (Havoc) and @carrot-garden, |
Hi @havocp and @akka-team,
Is there any update on @ajayvkm comment? I would be very useful feature |
hello;
this is a feature request;
currently, include url()/file()/classpath()
https://github.com/typesafehub/config/blob/master/HOCON.md#includes
are either relative or absolute, to the specific url:
"otherwise, a file or other resource "adjacent to" the one being parsed"
I suggest to introduce a concept of a "base()" stanza:
include base("common/server/instance/settings.conf")
witch represents an idea: include form a root of "common configuration store",
and is agnostic of url()/file()/classpath() distinctions;
"configuration store" would have to be a new concept for typesafe.config;
base() url handler would have to be provided to the typesafe.config library
in some external way
another alternative would be to rely on new custom "config://" protocol handler
explicitly, such as, in this stanza:
include url("config://common/server/instance/settings.conf")
an example of custom url approach can be found here:
https://github.com/barchart/barchart-config/tree/master/barchart-conf-base
https://github.com/barchart/barchart-config/blob/master/barchart-conf-base/src/main/java/com/barchart/conf/impl/ConfigHandlerProvider.java
the benefit of "include base()" in typesafe.config would be to standardize
the "configuration store" approach to configuration management;
thank you.
The text was updated successfully, but these errors were encountered: