Commit Graph

135 Commits

Author SHA1 Message Date
Dave Syer
22f241e342 Add spring.cloud.config.server.encrypt.enabled flag
So server can delegate decryption to the clients.

Fixes gh-162
2015-06-23 13:53:29 +01:00
Dave Syer
772fa118f3 Split up basedir.mkdirs() for Windows users
Fixes gh-173
2015-06-23 13:39:03 +01:00
Dave Syer
1504d6cb0c Provide options for key rotation and per-app cryptography
Cipher text (and plain text in the /encrypt endpoint) can now
carry a prefix of {name:value} pairs, all of which are passed
into the TextEncryptorLocator (instead of just the app name
and profiles).

The inputs are prepared symmetrically by the EncryptionController
(if used) and the EnvironmentEncryptor (used in the EnvironmentController).

Tidy up docs and add notes on keys.
2015-06-12 10:15:09 +01:00
Alex Corvino
fdf6689e90 Add option to clone repositories on start
On startup the server will clone all git repositories if the property
"spring.cloud.config.server.git.cloneOnStart" is set to true. If the
property is not set or is set to false then the server will behave
as it does currently.

Fixes gh-149
2015-06-10 09:33:47 +01:00
wojtkiewicz
14726f4964 added few missing tests for new endpoints in EncryptionController 2015-06-08 06:56:04 +01:00
Dave Syer
2a0f73740a Make text encryptor configuration an autoconfig
So that it can be controlled with @ConditionalOnBean etc.
2015-05-26 16:54:57 +01:00
wojtkiewicz
7437cdef49 Introduce TextEncryptorLocator abstraction
Allows more customization of encryption and decryption stack. Should
be no change for existing users.

Fixes gh-124
2015-05-26 15:26:04 +01:00
Dave Syer
891e928890 Extend NoSuchLabelException to SVN repository
See gh-153
2015-05-19 11:58:53 +01:00
Dave Syer
c685931308 Send 404 if Git label not found
See gh-153
2015-05-19 11:49:41 +01:00
Dave Syer
e94b4039a6 Strip "document" prefix from YAML by default
It's pretty uncommon for Spring apps, but sometimes YAML is not a
map, but more naturally a String or Collection. In these cases Spring
puts a "document" prefix in the Map it creates, so we can strip that
off if the user prefers it.

Fixes gh-143
2015-05-19 10:53:51 +01:00
Mikel Armañanzas
641d5b40e8 Fixing problem in windows loading files
Fixes gh-133, fixes gh-136, fixes gh-135
2015-05-06 06:47:24 -04:00
Spencer Gibb
242baae663 add a configurable health indicator for the Config Server
fixes gh-142
2015-05-04 13:32:51 -06:00
Dave Syer
98b64aa4cb If URI has no context path add one ("/")
Fixes gh-131
2015-04-29 11:38:00 +02:00
Dave Syer
5440d1d157 Add synchronized keyword to protect repository access
Fixes gh-128
2015-04-17 11:48:16 +01:00
Dave Syer
280a7a2c09 Allow environment overrides to be escaped for placeholders
E.g. spring.cloud.config.server.overrides.foo=$\{bar} will evaluate
to foo=${bar} in the client's Environment (allowing local replacement
of the placeholder instead of on the configserver).
2015-04-03 10:32:41 +01:00
Dave Syer
0f3233bad1 Add logging to EncryptionController
Fixes gh-115
2015-03-26 10:19:20 +00:00
Roy Clarkson
a15aed0b78 Use 'trunk' as default label for Subversion repositories
This commit adds a getDefaultLabel() method to the EnvironmentRepository
interface. SvnKitEnvironmentRepository returns 'trunk', while all other
implementations return 'master'. ConfigServerMvcConfiguration and
ConfigServerBootstrapConfiguration will utilize labels configured on
the client and server before falling back to the repository's default
label.

Resolves #107
2015-03-24 14:36:52 -05:00
Dave Syer
93543644a2 Nested JSON format instead of flat properties
Since JSON is a subset of YAML it makes more sense to keep the
same format (i.e. nested objects instead of the flattened
property names).

See gh-112
2015-03-24 13:50:36 +00:00
Chris Manning
57bcd734d1 Adding endpoint for .json similar to .yml, .yaml, and .properties
Fixes gh-113, fixes gh-112
2015-03-24 13:25:19 +00:00
Dave Syer
b1ba8df066 Fix native profile so it behaves as described in docs
The SCM repositories have a "clean()" method to strip out the server's
own configuration files from the property sources shipped to remote
clients. The "native" one didn't have that method so this change adds
it with a similar implementation to the SCM case, except slightly
more complicated because of the extra search locations added by the
"label" parameter.

Also changes the name SpringApplicationEnvironmentRepository to
NativeEnvironmentRepository to match the profile and the config properties.

Fixes gh-109
2015-03-20 14:42:42 +00:00
Dave Syer
5a80ce9e3a Explicitly list profiles and label in Environment
Fixes gh-111
2015-03-20 13:13:52 +00:00
Dave Syer
ea138e8dbd Default label on client is null (so server can set priority)
Fixes gh-108
2015-03-20 07:59:49 +00:00
Dave Syer
ae343454a4 Add getters and setter for native profile repository 2015-03-19 17:22:16 +00:00
Dave Syer
02b13a41b2 Moved non-config client related code into commons
Refresh, Bootstrap and encryption features all moved into commons

See gh-104
2015-03-18 15:41:20 +00:00
Spencer Gibb
9d6dcac60b remove unused annotations 2015-03-17 10:36:18 -06:00
Dave Syer
83ef3e4b74 Disable config server client by default in config server
This change adds a listener that inserts a PropertySource really early
so that spring.cloud.config.enabled=false is the default in a config
server. It can be overridden if the user primes the Environment with
spring.cloud.config.enabled=true.

See gh-104
2015-03-17 15:14:32 +00:00
Dave Syer
ee4717bbab Allow patterns in repository search paths
User can now specify spring.cloud.config.server.git.searchPaths as
a list of patterns (instead of a list of subdirectory names).

See gh-97
2015-03-16 11:01:21 +00:00
Dave Syer
4ae639c351 Extra docs for embeddable config server
Fixes gh-100
2015-03-11 10:32:02 +00:00
Dave Syer
5fc2b1af66 Fix @RequestMapping so that git label can contain periods
Spring MVC lops off the "extension" from request paths by default
(causing no end of other problems), but in this case making it
impossible, or unintuitive at best, to use version-like labels
in git repositories (e.g. 1.0.0). This change makes the mapping
a regex match which includes the whole path, not just the stem.

Fixes gh-94
2015-03-02 09:03:59 +00:00
Dave Syer
80cc7f9800 source->environment 2015-02-27 15:52:45 +00:00
Dave Syer
9a8e8e7627 Back to configure->config
The connectors project doesn't use any of the subpackages we do
here so if we movethe Environment and PropertySource into a sub-
package it should be safe.

See gh-91
2015-02-27 15:33:43 +00:00
Dave Syer
0c794adf5c Fix concurrent map modification error 2015-02-27 10:27:50 +00:00
Dave Syer
1dc13c2964 Tweak test sensitive to ordering 2015-02-27 08:35:00 +00:00
Dave Syer
76871fdf7c Fix YAML output if arrays are nested or contain objects
Fixes gh-92
2015-02-26 18:11:33 +00:00
Dave Syer
105612d30e Config package name change to avoid conflict with connectors
Fixes gh-91
2015-02-25 17:13:00 +00:00
Spencer Gibb
51c53e301e Update return type of environmentRepository @Bean definitions to EnvironmentRepository so @ConditionalOnMissingBean works. 2015-02-16 11:45:56 -07:00
eidottermihi
bc0fc13e28 Fix merge mistake in ConfigServerConfiguration. 2015-02-14 23:31:49 +01:00
eidottermihi
686064e22e Merge branch 'subversion-support' of https://github.com/eidottermihi/spring-cloud-config into subversion-support
Conflicts:
	spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/JGitEnvironmentRepository.java
2015-02-14 23:28:11 +01:00
eidottermihi
3e3638a813 Use Spring Cloud code conventions. 2015-02-14 23:23:08 +01:00
eidottermihi
cbbcab3e62 Removed @Profile for JGitEnvironmentRepository (so it's the default if
no active profile is set). More tests for Subversion Support (based on
Git tests).
2015-02-14 23:21:11 +01:00
eidottermihi
bbd22d0caf missing svn repo metadata 2015-02-14 23:21:10 +01:00
eidottermihi
6112418d42 Add Subversion-backed EnvironmentRepository (SVN operations via SVNKit).
Move SCM independent code to abstract superclass.
2015-02-14 23:21:10 +01:00
Dave Syer
897ad1face Instead of using Map everywhere it's neater to use a strongly typed
object. This reuses JGitEnvironmentRepository, since it shares
most of the same properties. The format of the repos config
changes - now it is a Map not a List and the key is used as a "name"
to provide a default pattern and a location in the basedir.

Example config:

    spring:
      application:
        name: configserver
      cloud:
        config:
          server:
            git:
              uri: https://github.com/spring-cloud-samples/config-repo
              repos:
                iceycake: https://github.com/iceycake/config-repo
                project1:
                  patterns: project1-*,*-project1
                  uri: https://github.com/spring-cloud-samples/config-repo-1
2015-02-12 10:20:16 +00:00
Andy Chan
e05e876f8f Optional support for multiple Git repos
This implementation adds multiple git repositories support to Spring Cloud Config Server.
By giving the following properties file:

info:
  component: Config Server
spring:
  application:
    name: configserver
  jmx:
    default_domain: cloud.config.server
  cloud:
    config:
      server:
        git:
          uri: https://github.com/spring-cloud-samples/config-repo
          repos:
            - patterns: iceycake-*
              uri: https://github.com/iceycake/config-repo
            - patterns: project1-*,*-project1
              uri: https://github.com/spring-cloud-samples/config-repo-1
with uri:

  /{application}/{profile}/{label}

where

spring.cloud.config.server.git.uri is the default git repository
spring.cloud.config.server.repos is a mapping between a git repository and
a string pattern that matches the {application} string in the endpoint.

Fixes gh-82, fixes gh-58
2015-02-10 11:43:28 +00:00
Dave Syer
2d63d598db Add test for spring.cloud.config.server.bootstrap
Setting this flag to "true" makes the config server load its own
configuration from the git repository (hence both have to be
confifgured in bootstrap.yml)
2015-02-10 11:01:26 +00:00
eidottermihi
d6f3177bfb Use Spring Cloud code conventions. 2015-02-05 21:46:54 +01:00
eidottermihi
fcb6200f90 Removed @Profile for JGitEnvironmentRepository (so it's the default if
no active profile is set). More tests for Subversion Support (based on
Git tests).
2015-02-03 18:29:39 +01:00
eidottermihi
55b5b56660 missing svn repo metadata 2015-02-02 23:02:00 +01:00
eidottermihi
6d0b5ce6a2 Add Subversion-backed EnvironmentRepository (SVN operations via SVNKit).
Move SCM independent code to abstract superclass.
2015-02-02 22:58:17 +01: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