Repository navigation
Conversation
ep0ll
force-pushed
the
feat(dapr-init-sentry)/self-hosted
branch
from
November 1, 2026 07:58
d0869bf to
fbe1f85
Compare
Author
|
@JoshVanL can you please look at this PR. this currently works locally on my mac, but when i run in github codespaces, the volumes are becoming readonly NOTE: i am taking assist of LLMs to generate tests, the current tests are expected to be falsy and possibly can also error/tests-might-fail, so please ignore the current test files |
ep0ll
marked this pull request as ready for review
November 1, 2026 11:00
ep0ll
force-pushed
the
feat(dapr-init-sentry)/self-hosted
branch
from
November 1, 2026 14:32
58b09c9 to
7758079
Compare
Wire up the existing `--enable-mtls` flag in `dapr init` so that it provisions the Sentry service and enables mTLS in the default configuration. This covers a subset of dapr#1648. Changes: - Add an `--enable-mtls` example to the `dapr init` cobra command help. - Add `EnableMTLS` to `InitOptions`. When set, the init flow runs the install-sentry and run-sentry-service steps. - Add public `GetDaprSentryCertsPath` helper that returns the Sentry certs directory (`<GetDaprRuntimePath>/certs`). - `runSentryService` mounts the local certs directory (read-write, so Sentry can write generated certs) and the default configuration directory (read-only) into the container as volumes. - Pass `--trust-domain=cluster.local`, `--issuer-credentials` and `--config` as container entrypoint args, as described in the Dapr self-hosted mTLS docs: https://docs.dapr.io/operations/security/mtls/#self-hosted - Enable mTLS in the default configuration when the flag is used. Refs: dapr#1648 Signed-off-by: ep0ll <wygininc@gmail.com>
`dapr uninstall` now checks whether the Sentry container exists and removes it alongside the other self-hosted containers. This covers a subset of dapr#1648. Changes: - Check for an installed Sentry container during uninstall and remove it if found. - The check does not depend on `--enable-mtls`. uninstall has no such flag, so Sentry is removed whenever it is installed, regardless of whether mTLS was enabled. - No-op when Sentry is not installed. Refs: dapr#1648 Signed-off-by: ep0ll <wygininc@gmail.com>
Signed-off-by: ep0ll <wygininc@gmail.com>
When mTLS is enabled in self-hosted mode, daprd needs DAPR_TRUST_ANCHORS,
DAPR_CERT_CHAIN, DAPR_CERT_KEY and NAMESPACE, which users currently
export by hand from $HOME/.dapr/certs before running `dapr run`.
Add standalone.MTLSEnv, which builds these variables from
<dapr-dir>/certs/{ca.crt,issuer.crt,issuer.key} and use it in both
run modes:
- With --run-file, the values are merged into common.env in GetApps,
so every app in the run file receives them.
- Without --run-file, they are set on SharedRunConfig.Env.
Precedence, highest first: apps[i].env, common.env, variables already
exported in the shell, values read from the certs directory. Variables
already present in the environment are not overridden and their files
are not read.
If the certs are not present, nothing is injected and behaviour is
unchanged. Any other read error (e.g. permission denied) is returned
to the caller instead of being silently ignored. NAMESPACE defaults to
"default" and is only added when at least one cert variable is
injected.
Also fix a nil map write in mergeCommonAndAppsEnv, which panicked when
an app had no `env` block and common.env was non-empty.
The certs directory is resolved from the runtime path, so
--runtime-path and common.daprdInstallPath are respected.
Signed-off-by: ep0ll <wygininc@gmail.com>
Update Sentry health and metrics ports to avoid conflicts with the Placement service. Resolve Sentry certificate directory and configuration file paths to absolute paths to prevent path-resolution issues when running in Docker. Standardize container paths for mounted volumes: - Config: /.dapr/config.yaml - Certificates: /.dapr/certs/ Signed-off-by: ep0ll <wygininc@gmail.com>
Signed-off-by: ep0ll <wygininc@gmail.com>
Add tests for the mTLS code as it was before the refactor: config detection, cert loading, sentry address and daprd args, default configuration output, and the run-file env handling. Comments mark behaviors that look questionable. Signed-off-by: ep0ll <wygininc@gmail.com>
Signed-off-by: ep0ll <wygininc@gmail.com>
Signed-off-by: ep0ll <wygininc@gmail.com>
Signed-off-by: ep0ll <wygininc@gmail.com>
ep0ll
force-pushed
the
feat(dapr-init-sentry)/self-hosted
branch
from
November 1, 2026 14:41
7758079 to
ea4395f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Wire up the existing
--enable-mtlsflag indapr initso that it provisions the Sentry service and enables mTLS in the default configuration. This covers a subset of#1648.
Changes:
--enable-mtlsexample to thedapr initcobra command help.EnableMTLStoInitOptions. When set, the init flow runs the install-sentry and run-sentry-service steps.GetDaprSentryCertsPathhelper that returns the Sentry certs directory (<GetDaprRuntimePath>/certs).runSentryServicemounts the local certs directory (read-write, so Sentry can write generated certs) and the default configuration directory (read-only) into the container as volumes.--trust-domain=cluster.local,--issuer-credentialsand--configas container entrypoint args, as described in the Dapr self-hosted mTLS docs: https://docs.dapr.io/operations/security/mtls/#self-hostedIssue reference
Refs: #1648
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: