Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: add externalized configuration for certificates and logging #50

Open
dsschneidermann opened this issue Oct 31, 2020 · 0 comments

Comments

@dsschneidermann
Copy link
Contributor

dsschneidermann commented Oct 31, 2020

Hi guys. Thanks for this repo. I'm now using it succesfully to mock CosmosDb for the Azure IoT Device Simulation solution (https://github.com/Azure/device-simulation-dotnet/tree/DS-2.0.6).

I've set it up with docker-compose and have generated a self-signed CA certificate for the assigned hostname, and added it to the device simulation container, so when it connects using the Azure CSharp SDK, all SSL checks out and it just works(tm), aside from a few quirks that I had to look at (#46 and #48).

In doing this, I found a need for two main things:

  • Adding optional paths for an external cert and cert key to cosmosdb-server
  • Adding more default logging for the requests and responses

My solution was to take the index.js (after compilation) and provide a replacement instead, packaging it with the docker image.

I'm not a node wiz, by far, so my logging additions have just been hacked together from what I could find from examples online, here it is: https://gist.github.com/dsschneidermann/a9314afee146feaffbeada42829e2e73

I can also provide the Dockerfile, docker-compose.yml etc if anyone is interested.

Edit: I forgot, I'm also overriding the read-meta.js file in order to set the self-aware "databaseAccountEndpoint" address and switch the default consistency level to "Strong", as it's needed for my case. Gist: https://gist.github.com/dsschneidermann/952f9160d5ce08aa69908b0862dcb5c6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant