Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/edufolly/work-with-secrets
Working with Docker secrets in Quarkus
https://github.com/edufolly/work-with-secrets
docker docker-swarm java quarkus swarm
Last synced: 17 days ago
JSON representation
Working with Docker secrets in Quarkus
- Host: GitHub
- URL: https://github.com/edufolly/work-with-secrets
- Owner: edufolly
- Created: 2022-06-19T19:43:46.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-24T01:14:26.000Z (over 1 year ago)
- Last Synced: 2024-11-13T16:53:53.576Z (3 months ago)
- Topics: docker, docker-swarm, java, quarkus, swarm
- Language: Java
- Homepage:
- Size: 262 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# work-with-secrets
## Motivation
> Docker secrets do not set environment variables directly.
> This was a conscious decision, because environment variables can
> unintentionally be leaked between containers._from_: https://docs.docker.com/engine/swarm/secrets/#build-support-for-docker-secrets-into-your-images
### SmallRye FileSystem Config Source
https://smallrye.io/docs/smallrye-config/main/config-sources/config-sources.html#filesystem-config-source
### Quarkus PR
https://github.com/quarkusio/quarkus/pull/21478
## Implementation
Using in `build.gradle`:
```groovy
implementation 'io.smallrye.config:smallrye-config-source-file-system'
```Using in `pom.xml`:
```xml
io.smallrye.config
smallrye-config-source-file-system```
Check `application.properties`:
```yaml
smallrye.config.source.file.locations=secret-template-folder# Docker secrets path.
%prod.smallrye.config.source.file.locations=/run/secrets# This way you can use a docker secret interpolated with a
# datasource connection.
my-injected=${my-secret:-not found}
```### Endpoints
#### /swagger-ui
Swagger UI.
http://localhost:8080/swagger-ui/
#### /config
Checking the base configuration from `ConfigProvider`.
```shell
curl -s http://localhost:8080/config | jq .
```#### /injected
Using the secret with a `application.properties` interpolation.
```shell
curl -s http://localhost:8080/injected | jq .
```---
Version: CHECK_VERSION_IN_BRANCH_PROD