Sync docs from master to gh-pages
This commit is contained in:
@@ -451,9 +451,6 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
||||
<div class="paragraph">
|
||||
<p>Spring Cloud Config provides server and client-side support for externalized configuration in a distributed system. With the Config Server you have a central place to manage external properties for applications across all environments. The concepts on both client and server map identically to the Spring <code>Environment</code> and <code>PropertySource</code> abstractions, so they fit very well with Spring applications, but can be used with any application running in any language. As an application moves through the deployment pipeline from dev to test and into production you can manage the configuration between those environments and be certain that applications have everything they need to run when they migrate. The default implementation of the server storage backend uses git so it easily supports labelled versions of configuration environments, as well as being accessible to a wide range of tooling for managing the content. It is easy to add alternative implementations and plug them in with Spring configuration.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p><a href="https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/contributing-docs.adoc" class="bare">https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/contributing-docs.adoc</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
@@ -663,7 +660,78 @@ the config server URL.
|
||||
<p>The Server provides an HTTP, resource-based API for external
|
||||
configuration (name-value pairs, or equivalent YAML content). The
|
||||
server is easily embeddable in a Spring Boot application using the
|
||||
<code>@EnableConfigServer</code> annotation.</p>
|
||||
<code>@EnableConfigServer</code> annotation. So this app is a config server:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="title">ConfigServer.java</div>
|
||||
<div class="content">
|
||||
<pre class="highlight"><code class="language-java" data-lang="java">@SpringBootApplication
|
||||
@EnableConfigServer
|
||||
public class ConfigServer {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ConfigServer.class, args);
|
||||
}
|
||||
}</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Like all Spring Boot apps it runs on port 8080 by default, but you
|
||||
can switch it to the conventional port 8888 in various ways. The
|
||||
easiest, which also sets a default configuration repository,
|
||||
is by launching it with <code>spring.config.name=configserver</code> (there
|
||||
is a <code>configserver.yml</code> in the Config Server jar). Another is
|
||||
to use your own <code>application.properties</code>, e.g.</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="title">application.properties</div>
|
||||
<div class="content">
|
||||
<pre class="highlight"><code class="language-properties" data-lang="properties">server.port: 8888
|
||||
spring.cloud.config.server.git.uri: file://${HOME}/config-repo</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>where <code>${HOME}/config-repo</code> is a git repository containing
|
||||
YAML and properties files.</p>
|
||||
</div>
|
||||
<div class="admonitionblock tip">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<div class="title">Tip</div>
|
||||
</td>
|
||||
<td class="content">
|
||||
<div class="paragraph">
|
||||
<p>Here’s a recipe for creating the git repository in the example
|
||||
above:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre>$ cd $HOME
|
||||
$ mkdir config-repo
|
||||
$ cd config-repo
|
||||
$ git init .
|
||||
$ echo info.foo: bar > application.properties
|
||||
$ git add -A .
|
||||
$ git commit -m "Add application.properties"</pre>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="admonitionblock warning">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<div class="title">Warning</div>
|
||||
</td>
|
||||
<td class="content">
|
||||
using the local filesystem for your git repository is
|
||||
intended for testing only. Use a server to host your
|
||||
configuration repositories in production.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_environment_repository">Environment Repository</h3>
|
||||
@@ -1045,9 +1113,9 @@ mysecret</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Take the encypted value and add the <code>{cipher}</code> prefix before you put
|
||||
<p>Take the encrypted value and add the <code>{cipher}</code> prefix before you put
|
||||
it in the YAML or properties file, and before you commit and push it
|
||||
to a remote, potentially insecure store. The <code>/encypt</code> and <code>/decrypt</code>
|
||||
to a remote, potentially insecure store. The <code>/encrypt</code> and <code>/decrypt</code>
|
||||
endpoints also both accept paths of the form <code>/*/{name}/{profiles}</code>
|
||||
which can be used to control cryptography per application (name)
|
||||
and profile when clients call into the main Environment resource.</p>
|
||||
@@ -1080,7 +1148,7 @@ mysecret</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>To use a key in a file (e.g. an RSA public key for encyption) prepend
|
||||
<p>To use a key in a file (e.g. an RSA public key for encryption) prepend
|
||||
the key value with "@" and provide the file path, e.g.</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
@@ -1411,7 +1479,7 @@ grabbing it in the bootstrap context and injecting one).</p>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<div id="footer-text">
|
||||
Last updated 2015-08-13 12:39:51 UTC
|
||||
Last updated 2015-08-13 12:39:56 UTC
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user