mcrio / configuration.provider.docker.secrets Goto Github PK
View Code? Open in Web Editor NEW.NET Core configuration provider for Docker Secrets.
License: MIT License
.NET Core configuration provider for Docker Secrets.
License: MIT License
Hi I'm trying to use your nuget, but I get a UnauthorizedAccessException
when I start my container.
I'm using normal docker (No swarm or kubernetes).
version: "3.8"
secrets:
chargeampguard__uri:
file: ./guard-relay/secrets/chargeampguard_uri.secret
chargeampguard__pin:
file: ./guard-relay/secrets/chargeampguard_pin.secret
services:
guard-relay:
container_name: guard-relay
image: "ghcr.io/anderssonpeter/guardrelay:${GUARDRELAY_VERSION}"
environment:
- Application__Application=/config/GuardRelay.sqlite
- MQTT__Connection__Server=mosquitto
secrets:
- chargeampguard__uri
- chargeampguard__pin
volumes:
- ./guard-relay/config:/config
Exception:
Unhandled exception. System.UnauthorizedAccessException: Access to the path '/run/secrets/chargeampguard__uri' is denied.
---> System.IO.IOException: Permission denied
--- End of inner exception stack trace ---
at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException)
at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
at System.IO.File.OpenRead(String path)
at System.IO.Abstractions.FileWrapper.OpenRead(String path)
at Mcrio.Configuration.Provider.Docker.Secrets.DockerSecretsConfigurationProvider.ProcessFile(String secretFilePath)
at Mcrio.Configuration.Provider.Docker.Secrets.DockerSecretsConfigurationProvider.Load()
at Microsoft.Extensions.Configuration.ConfigurationManager.AddSource(IConfigurationSource source)
at Microsoft.Extensions.Configuration.ConfigurationManager.ConfigurationSources.Add(IConfigurationSource source)
at Microsoft.Extensions.Configuration.ConfigurationManager.Microsoft.Extensions.Configuration.IConfigurationBuilder.Add(IConfigurationSource source)
at Mcrio.Configuration.Provider.Docker.Secrets.DockerSecretsConfigurationExtension.AddDockerSecrets(IConfigurationBuilder configurationBuilder, String secretsDirectoryPath, String colonPlaceholder, ICollection`1 allowedPrefixes)
at Program.<Main>$(String[] args) in /src/GuardRelay/Program.cs:line 16
at Program.<Main>(String[] args)
Do you have any idea why?
Readme explains by default this library will load secrets from the linux mount location: /run/secrets
However when running under windows contaienrs, the mount path is C:\ProgramData\Docker\secrets
- does this library detect the correct default location based on the platform (windows vs linux)?
Hello,
Do you know if this library would also handle a mounted volume containing Key Vault secret files, based on the setup for kubernets described here:
https://docs.microsoft.com/en-us/azure/key-vault/general/key-vault-integrate-kubernetes
I am guessing that it should
as its just a set of files? Would be interested to know if anyone has tried this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.