Commit Graph

135 Commits

Author SHA1 Message Date
Spencer Gibb
828df5262f Add resolvePlaceholders request parameter to EnvironmentController.
Specifically to the `{json|yaml|properties}` endpoints to support sidecar or non-jvm apps to have placeholders resolved automatically.

See https://github.com/spring-cloud/spring-cloud-netflix/issues/877
2016-03-10 11:59:13 -07:00
Dave Syer
82e009b1c2 Add support for comma separated application names in placeholders
Both the SCM and native repositories should now be able to scan
search paths in {application} when application is a comma separated
list.

Fixes gh-338
2016-02-23 17:11:12 +00:00
Dave Syer
b268963025 Let MVC handle content negotiation for endpoints
In particular the ResourceEndpoint is likely to serve data that is
not JSON, so having a "produces" attribute at the type level is a bad
idea.

Fixes gh-337
2016-02-22 14:03:26 +00:00
Dave Syer
f1b4f5c98e Small optimization with duplicate search paths 2016-02-16 10:24:15 +00:00
Dave Syer
8125007700 Add sample app for testing SVN repos manually 2016-02-15 17:05:34 +00:00
Conny Nilimaa
1ca0ba6222 Fix for paths containing spaces. 2016-02-10 10:53:03 -07:00
Dave Syer
2043b05bbe Add placeholder substitution to search paths within SCM repository
E.g. ...searchPaths={application}/ to search the directory with the
same name as the application (in addition to the root).

Fixes gh-328
2016-01-29 10:10:53 +00:00
Spencer Gibb
05dc6f9ace Force controllers to return json
fixes gh-306
2016-01-15 16:04:06 -07:00
Matt Benson
2ad51fb93e make tests platform-neutral 2016-01-14 18:00:14 -06:00
Dave Syer
25b24e6406 Add some docs for config properties 2015-12-30 15:06:18 +00:00
Michael Wirth
4308bb5eab Close open input streams
Fixes gh-293 fixes gh-315
2015-12-24 15:15:37 +00:00
Dave Syer
3f77d806da Explicitly close all Git objects
It's good manners to do so anyway (and if Git was Closeable we
would have seen compiler warnings). Hopefully means that Windows
users are more happy.
2015-12-22 13:13:23 +00:00
Dave Syer
b553443c70 Use the right cache for placeholder replaced repository locations
Fixes gh-310
2015-12-22 09:18:31 +00:00
Dave Syer
4a35526b97 Locate placeholder in resource search location correctly
Fixes gh-303
2015-12-21 12:16:21 +00:00
Dave Syer
c97a8f5144 Ensure getLocations() is synchronized (just like findOne())
Concurrent access can be an issue with file locks in JGit (e.g.
see gh-261, which no-one reproduced, but smells like it's related).
2015-12-21 10:51:46 +00:00
Dave Syer
9a65a2f1a8 Allow configuration of symmetric key in server outside bootstrap
There's no reason the encrypotor needs to be in the bootstrap context
so we can still support symmetric key encryption via /encrypt
and /decrypt without requiring it to be configured there. With
this change we just look for key properties in the current context
and create an encryptor the same way the bootstrap listener does
in spring-cloud-commons.
2015-12-18 10:17:52 +00:00
Dave Syer
3951569aa2 Allow ciphers in overrides via escape of '{' 2015-12-18 10:15:20 +00:00
Dave Syer
edcb153571 Support for multiple profiles in profile placeholders
In a file-based repository up to now we only support single profiles in
a placeholder. This change adds full support for multiple profiles in
the native profile and slightly limited support for git backends (only
the first profile to match an actual repository will be used to locate
the physical repository, but all profiles will be applied to the search
inside that repository).
2015-12-02 13:18:09 +00:00
Dave Syer
87a1e773a0 Support for placeholders in git and file URIs
The default git repository and also the native one (local files)
now support placeholders for {application}, {profile} and
{label} in the URI (searchLocation for the native repository).

Fixes gh-257
2015-12-02 11:46:30 +00:00
Steve West
d0616a976e Fix bug where prefix keys (e.g. {name: value}) are not stripped
Also removing extraneous post-decrypt stripPrefix which was masking the encrypt bug.

Fixes gh-272
2015-12-01 18:08:55 +00:00
Dave Syer
eb97893b4c Check for escaped labels in binary file paths as well
See gh-264
2015-11-12 16:51:11 +00:00
Dave Syer
c72e3857cd Accept (_) escape for / in environment controller
Fixes gh-264
2015-11-12 15:57:38 +00:00
Dave Syer
15b5ca804e Remove executable jar from distribution
It doesn't get used much and it has way too many optional dependencies
in it now.
2015-11-05 07:13:31 +01:00
Dave Syer
572522f645 Class name change in Spring Boot 2015-11-02 15:05:50 +00:00
Dave Syer
75d79fb7f5 Be defensive about null and empty search locations 2015-10-20 09:23:40 -04:00
Dave Syer
c0ddcd800e Add support for binary file server via context negotation
If client sends "Accept: application/octet-stream" then the server
sends back a binary file (no placeholders and no text conversion)
2015-10-06 17:58:07 +01:00
Spencer Gibb
5ceca18292 Add version to environment response
Users see it logged by the config client, and it appears in the
Environment response from the config server. It's hard to add it
to the /env endpoint without some extension points in Boot.

Fixes gh-244, fixes gh-245
2015-10-02 11:40:22 +01:00
Dave Syer
d4ce149f2d Refactor server into packages
Also removes getDefaultLabel() from EnvironmentRepository.
2015-10-01 11:21:17 +01:00
Dave Syer
b024788be9 Factor out encryption into a repository (not controller) 2015-10-01 11:21:17 +01:00
Dave Syer
4310cc2017 Fix test 2015-09-30 17:53:30 +01:00
Dave Syer
62846bda84 Add ResourceController for serving plain text config files
Can be adapted to serve content in any format (e.g. nginx config file,
XML configuration for logger, etc.) - basically anything that can be
stored in plain text and doesn't require streaming.

Fixes gh-147, see also gh-198
2015-09-30 15:00:37 +01:00
Dave Syer
02a9eb3cd7 Refactor base classes for EnvironmentRepository implementations
Allows us to re-use the Scm features independent of the repository
abstraction.
2015-09-29 17:08:04 +01:00
Dave Syer
25dfa37612 Add support for matching profiles as well as applications
Patterns in the form {application}/{profile} are now supported with
the old behaviour being the default (all profiles matched if none
are specified).

Fixes gh-214
2015-09-25 10:37:34 +01:00
Dave Syer
da2b20c8be Fix test broken by change in commons 2015-09-25 09:43:20 +01:00
Dave Syer
63e90d7d27 Remove extra call to git fetch
A pull is going to happen anyway, so it's probably just
unnecessary overhead.

Fixes gh-227
2015-09-25 09:26:49 +01:00
Dave Syer
8d8e07a78e Push events for config changes
Works from local repos or with explicit POST to /monitor with
path=<serviceId>, also supports webhooks from github and gitlab.
2015-09-22 17:33:42 +01:00
Spencer Gibb
dc5097b188 polish 2015-09-18 08:22:42 -06:00
Dave Syer
33f5cfcdef Line ending changes after gh-221 2015-09-05 10:02:58 +01:00
Dave Syer
14be630f62 Add javadocs for cloneOnStart 2015-09-04 09:52:42 +01:00
Dave Syer
950386dddf Merge branch '1.0.x' 2015-09-04 09:49:02 +01:00
Dave Syer
7b0fb5df5e Make timeout configurable
Fixes gh-225
2015-09-04 09:48:28 +01:00
Dave Syer
acbf3c1166 Adapt NativeEnvironmentRepository to changes in Spring Boot 1.3
The ConfigFileApplicationListener was refactored into a new callback
specifically for messing with the Environment before refresh.
2015-08-18 09:13:30 +01:00
Stephen Oakey
c17d782ec8 Made all RequestMappings GET method only
Request methods for all calls should be GET only.
2015-08-12 10:34:58 -06:00
Dave Syer
922ad890ce Clarify role of ConfigServerBootstrapApplicationListener in javadoc 2015-07-28 13:20:12 +01:00
Spencer Gibb
93bc26fad9 polish 2015-07-27 14:51:08 -06:00
Dave Syer
ec94a579f4 Synchronize access to code that deletes basedir on startup
When the first request comes in there is a potential race while the
basedir is prepared (if another request comes in at that crucial
time they collide). This change just synchronizes the method where
the basedir is prepared (it's a once only operation).

Fixes gh-187
2015-07-16 09:25:58 +01:00
Dave Syer
ca0c5ecf1b Add spring.cloud.config.server.git.timeout (default infinite)
Sets the undlerlying timeout for the HTTP/SSH connection if
applicable in JGit.

See gh-141
2015-07-13 11:53:44 +01:00
Dave Syer
7828a0ee5a Fix possible concurrent modification error in EnvironmentController
Fixes gh-180
2015-07-10 12:02:12 +01:00
Dave Syer
ce494fb053 Bump spring-security-rsa 2015-06-24 17:21:33 +01:00
Dave Syer
0834917275 Support for git labels with slashes ("/")
Spring MVC can't match a pattern with a slash in it so we support
a special character sequence "(_)" which is legal in a URL
but hopefully rare in a git label.

Fixes gh-154
2015-06-24 14:19:13 +01:00