Files
spring-cloud-config/docs/modules/ROOT/pages/server/serving-binary-files.adoc
Spencer Gibb 59a40db4f7 Antora migration (#2328)
* Migrate Structure

* Insert explicit ids for headers

* Remove unnecessary asciidoc attributes

* Copy default antora files

* Fix indentation for all pages

* Split files

* Generate a default navigation

* Remove includes

* Fix cross references

* Enable Section Summary TOC for small pages

* WIP

* Antora migration

---------

Co-authored-by: Marcin Grzejszczak <mgrzejszczak@vmware.com>
2023-09-19 12:42:15 -04:00

81 lines
2.4 KiB
Plaintext

[[serving-binary-files]]
= Serving Binary Files
In order to serve binary files from the config server you will need to send an `Accept` header of `application/octet-stream`.
[[spring-cloud-config-serving-plain-text-git-svn-native-backends]]
== Git, SVN, and Native Backends
Consider the following example for a GIT or SVN repository or a native backend:
[source]
----
application.yml
nginx.conf
----
The `nginx.conf` might resemble the following listing:
[source]
----
server {
listen 80;
server_name ${nginx.server.name};
}
----
`application.yml` might resemble the following listing:
[source,yaml]
----
nginx:
server:
name: example.com
---
spring:
profiles: development
nginx:
server:
name: develop.com
----
The `/sample/default/master/nginx.conf` resource might be as follows:
[source]
----
server {
listen 80;
server_name example.com;
}
----
`/sample/development/master/nginx.conf` might be as follows:
[source]
----
server {
listen 80;
server_name develop.com;
}
----
[[spring-cloud-config-serving-plain-text-aws-s3]]
== AWS S3
To enable serving plain text for AWS s3, the Config Server application needs to include a dependency on `io.awspring.cloud:spring-cloud-aws-context`.
For details on how to set up that dependency, see the
https://docs.awspring.io/spring-cloud-aws/docs/2.4.3/reference/html/index.html#spring-cloud-aws-maven-dependency-management[Spring Cloud AWS Reference Guide].
In addition, when using Spring Cloud AWS with Spring Boot it is useful to include the https://docs.awspring.io/spring-cloud-aws/docs/2.4.3/reference/html/index.html#spring-boot-auto-configuration[auto-configuration dependency].
Then you need to configure Spring Cloud AWS, as described in the
https://docs.awspring.io/spring-cloud-aws/docs/2.4.3/reference/html/index.html#configuring-credentials[Spring Cloud AWS Reference Guide].
[[decrypting-plain-text]]
== Decrypting Plain Text
By default, encrypted values in plain text files are not decrypted. In order to enable decryption for plain text files, set `spring.cloud.config.server.encrypt.enabled=true` and `spring.cloud.config.server.encrypt.plainTextEncrypt=true` in `bootstrap.[yml|properties]`
NOTE: Decrypting plain text files is only supported for YAML, JSON, and properties file extensions.
If this feature is enabled, and an unsupported file extention is requested, any encrypted values in the file will not be decrypted.