Commit Graph

179 Commits

Author SHA1 Message Date
Dave Syer
a0b9fc6ced Update docs to show encrypt key is mandatory 2015-02-05 10:08:26 +01:00
Dave Syer
79d20a0f74 Fix error message if not failing fast
Fixes gh-78
2015-02-04 11:46:14 +01:00
Dave Syer
6d3a60b64c Add a call to update log levels during bootstrap
Since the bootstrap customizations are applied in ApplicationContextInitializers
they come too late to affect the logging levels. But the LoggingRebinder listener
isn't installed yet, and the context is not ready for events to be published. So
to get the logging changes in as early as possible we actually need to explicitly
apply them in the property source initializer as soon as the remote properties are
available.

Fixes gh-74, fixes gh-75
2015-01-30 11:44:22 +00:00
Roy Kachouh
2be1962893 Account for different base directories depending on test environment
Fixes gh-62, fixes gh-68
2015-01-29 14:25:25 +00:00
Dave Syer
8c2560b113 Fix YAML endpoints when there are multiple property sources
Also affects properties endpoints. The order of property sources
should be reversed when creating the properties to mimic accurately
the behaviuour of Spring's Environment.

Fixes gh-71
2015-01-28 14:11:20 +00:00
Dave Syer
e5e4cb0348 Change method name from getUri() to getRawUri()
Users would have seen DOWN status in a health indicator whenever
the config server was secure.

Fixes gh-69
2015-01-23 17:39:14 +00:00
Dave Syer
8c6740ab71 Use only ConfigFileApplicationListener in server mini-application
In the server we use a SpringApplicationEnvironmentRepository to load
the YAML and properties files from git (or locally). It creates a mini
SpringApplication so as to faithfully replicate the way the Environment
is created. Unfortunately that can have side effects on the server
application itself (e.g. setting log levels). In particular if the
mini SpringApplication fails to start then the log levels could be
left in a "preInitialized" state with all log levels OFF by default.

This change ensures that the server logs all errors when loading YAML
and properties files, and also that the client logs the error response
if it is JSON (as it should be).

Fixes gh-66, fixes gh-67
2015-01-21 14:40:39 +00:00
Dave Syer
55f04aaa38 More @Conditionals to prevent error if bootstrap disabled
If user disables bootstrap configuration
(spring.cloud.bootstrap.enabled:false) we have to anticipate some
beans will be missing.

Fixes gh-65
2015-01-19 16:51:53 +00:00
Dave Syer
3d1bc33f8e Don't delete the remote repo if it is also local 2015-01-19 16:11:45 +00:00
Dave Syer
fecc7c8539 Use local file:/... repository in place instead of cloning
Since JGit cannot use the "local" protocol (only git, ssh and https) we can't
use file:/... repositories in the same way as the other protocols. Formerly
we would copy the whole directory and use the copy as a local cache. But then
users are confused when they commit changes to the "remote" and they don't
show up in the server. It seems less confusing to simply use the local
repository as the basedir (although it does mean that ssh: should be used
if you are scaling up the config server).

Fixes gh-63
2015-01-19 15:05:21 +00:00
Dave Syer
048bc6a9a7 systemPropertiesOverride -> overrideSystemProperties 2015-01-17 15:11:47 +00:00
Dave Syer
a0c9ae3ff0 Allow system property override to be switched off
The default behaviour is the same as before, so a config client
adds the remote property sources "first" (i.e. ahead of system
properties). If the user sets up a  remote config repo with
spring.cloud.config.overrideSystemProperties=false they can
change this behaviour and insert the new property source after
systemEnvironment (i.e. before local config files but after the
other local sources). Of course using an `application.yml` on
the server you can change the default  for all applications.

There is also a new feature in the config server where the operator
can add a map of override properties in
spring.cloud.config.server.overrides.* and have them added with
highest priority in the Environment returned from the server.
Using that the operator can prevent config repositories from
changing the override behaviour by setting
spring.cloud.config.allowOverride=false.

Fixes gh-57
2015-01-16 16:24:41 +00:00
Dave Syer
1a2c21a081 Move health indicator to main application context 2015-01-16 14:12:59 +00:00
Dave Syer
d8c7cc52fe Be smarter about the ConfigClientProperties and parent context
In case there is a parent context we can re-use the bean from that
if it exists, instead of always creating it and risking the values
being different.
2015-01-16 14:03:12 +00:00
Stefan Djurasic
e2b4bea238 Fixing copy/paste error in BootsrapApplicationListener
... which prevented using an external bootstrap.properties file

Fixes gh-56, fixes gh-59
2015-01-15 16:14:56 +00:00
Dave Syer
3796133980 Use @ConditionalOnProperty where possible 2015-01-15 14:07:45 +00:00
Dave Syer
ecc65dd087 Clarify EnvironmentRepository contract 2015-01-06 09:18:40 +00:00
Dave Syer
2a718a2d40 Suppress compiler warnings 2015-01-02 07:29:48 +00:00
Dave Syer
1a4658dedc Update README 2014-12-26 14:05:08 +00:00
Spencer Gibb
78cc55c97b update version of jgit for zero day fix
fixes gh-52
2014-12-18 15:39:35 -07:00
Dave Syer
6d6ad3dc65 Remove default URI for git repository
Application will fail fast if the URI is not set. It *is* however
still set to the sample repo in the -exec.jar that we distribute.

Fixes gh-51
2014-12-18 17:09:11 +00:00
Dave Syer
b29b492817 Add label/ prefix to properties files in the "native" profile
This allows user s to separate their native resources by label, e.g.
/config/master/*.properties, /config/dev/*.properties etc.
2014-12-18 16:49:52 +00:00
Spencer Gibb
fade46210e make ConfigClientProperties required=false
fixes gh-50
2014-12-16 12:55:02 -07:00
Dave Syer
574c4d5097 Really enable cacheing 2014-12-12 11:56:01 +00:00
Dave Syer
0ef78db45c Fix integration test 2014-12-12 11:23:42 +00:00
Dave Syer
aeda3cb3f3 Enable caching in travis 2014-12-12 10:42:18 +00:00
Dave Syer
7a7550735e Change docs path in README 2014-12-11 15:41:36 +00:00
Spencer Gibb
954adc21c2 document failFast option
fixes gh-49
2014-12-05 12:31:16 -07:00
Spencer Gibb
eb48314cea added failFast option
fixes gh-1
2014-12-04 19:38:02 -07:00
Marcin Zajaczkowski
66ab6ca461 Small simplifications in BootstrapApplicationListener
Fixes gh-42
2014-12-04 08:35:40 +00:00
Spencer Gibb
28b27dfac7 add RefreshScopeRefreshedEvent when RefreshScope.refresh*() is called. This is so apps can do something when a POST is received at /refresh even if the environment hasn't changed. 2014-12-03 11:36:47 -07:00
Dave Syer
2caf87f92e Revert some @Ignores after bugfixes in Spring
Also lifts the restriction on @RefreshScope and @Configuration
(since that was imposed by a bug).

Fixes gh-43
2014-12-03 17:19:05 +00:00
Dave Syer
3911d91e57 Remove reflection hack 2014-12-03 15:06:17 +00:00
Dave Syer
0d2cb07384 Revert some of the changes to RefreshScope and @Configuration
Some things were changed in Spring and some problems are fixed
(while at least one is not - scope!="refresh" for a @Configuration
with @RefreshScope)
2014-12-03 14:31:39 +00:00
Lukasz Kryger
001e449be2 Update README.adoc
Fixed links to follow the asciidoctor syntax, not MD.
2014-12-01 16:09:05 +00:00
Dave Syer
66de92b4e2 Close repository after each operation
This prevents the tests failing when they try to delete the
.git files, but there is still a file lock (in Snake YAML),
so does not yet fix gh-45.
2014-12-01 12:20:03 +00:00
Dave Syer
815f9be894 Use entrySet() instead of keySet()
Fixes gh-46
2014-12-01 10:36:02 +00:00
Dave Syer
1065149cc9 Fix Maven compiler error 2014-12-01 10:35:38 +00:00
Dave Syer
0ae34b06fe Make it illegal to add @RefreshScope to @Configuration
There are still some problematic areas (see SPR-12486) where users
might be surprised, but at least there now is an error message for the
specific case of @RefreshScope on @Configuration.

Fixes gh-43
2014-12-01 09:47:58 +00:00
Dave Syer
0af301e7c2 More care with form-encoded data if it might be hex 2014-11-29 12:04:47 +00:00
Dave Syer
208173eccd More granular exception handling to provide better error message 2014-11-29 12:04:25 +00:00
Dave Syer
a83daa0ef5 starters->starter-parent 2014-11-26 14:05:57 +00:00
Dave Syer
775eb3b0e0 Fix travis build script 2014-11-26 09:26:26 +00:00
Dave Syer
6205bc7d81 Add more tests for gh-43 2014-11-26 08:11:13 +00:00
Dave Syer
689d12e9c1 Break Mvc endpoint configuration out from non Mvc
Fixes gh-44 because it allows an extra layer to insert
an @AutoConfigureAfter.

Also adds some more integration tests for refresh scope

Per gh-43, note that @Configuration does not play well
with @RefreshScope (see @Ignored test case).
2014-11-25 12:25:14 +00:00
Dave Syer
56434c79eb Fix pull request builds 2014-11-25 09:47:55 +00:00
Dave Syer
4f326b59a0 Add @ConditionalOnClass to health indicator 2014-11-23 07:40:15 +00:00
Spencer Gibb
65112da6fb Merge pull request #35 from spring-cloud/config-server-health-indicator
a HealthIndicator for ConfigServer.  It tests the http connection to the...
2014-11-18 11:11:54 -07:00
Dave Syer
03d827b432 Break @ConfigurationProperties out to type level 2014-11-17 14:35:52 +00:00
Dave Syer
4669102be6 Search in subdirectories of main config repo
... in addition to top level. That way users can
organize their config files, e.g. by subsystem.
Subdirectories have *higher* precedence than the
top level. Users configure which subdirectories to
search through spring.cloud.config.server.git.searchPaths
(array or String, so csv in config file, default empty).

Fixes gh-36
2014-11-17 13:42:04 +00:00