[Feature]: Allow native services to load an environment file #8863
vladbisceanu
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Before submitting
Area
apps/server
Problem or use case
t3 service installcreates a native systemd or launchd service, but there is no way to give that service an operator-owned environment file.A background service does not normally inherit variables from an interactive shell. This matters when provider sessions and their child commands need service-wide settings such as proxy configuration, certificate paths, tool configuration, or credentials for tools that only support environment-based authentication.
Repository
.envfiles are a different concern and should remain owned by each repository. T3's per-provider environment settings are also different because they apply only to a selected provider instance.Today an operator must choose between:
t3 servein a custom launcher;The wrapper option means no longer using T3's native service lifecycle directly. Platform-specific configuration also behaves differently between systemd and launchd.
Proposed solution
Allow the native T3 service to load one explicitly configured environment file before starting the server.
For example:
The command shape is only illustrative. The useful behavior is:
T3 should not search repositories for
.envfiles or load them automatically.Why this matters
systemd supports
EnvironmentFile=, but launchd has no equivalent. Since T3 already owns native service installation on both platforms, it can provide one consistent configuration mechanism instead of requiring every operator to maintain a wrapper.This would also help installations that use a local secret manager to materialize a protected environment file, without making T3 depend on any particular secret manager.
Smallest useful scope
One trusted, explicitly configured environment file loaded when the native background service starts.
No UI, hot reload, per-project environment, per-provider reconciliation, secret-manager integration, or shell-profile import is required.
Alternatives considered
EnvironmentVariablesembeds literal values in the plist and has no file-loading option.t3 serveworks but replaces the native service entry point.Risks or tradeoffs
Every child process can inherit these values. The feature should therefore require an explicit, trusted absolute path and should never automatically load a repository-controlled file. Environment precedence should be deterministic and documented.
The operator remains responsible for the file's ownership and permissions.
Related
#5840 describes the same macOS launch-context limitation for the desktop app. This proposal is limited to services installed through
t3 service install.Contribution
All reactions