You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(api): make default template visibility (public/private) configurable via TEMPLATES_DEFAULT_PUBLIC #3703
Make the default visibility of newly created templates configurable (public vs private) via an opt-in environment variable, instead of it being fixed in code.
This is not about forcing templates to be public — it is about giving self-hosted operators a single switch to choose the default visibility that fits their deployment:
leave it unset / false → keep the current private-by-default behavior (unchanged);
set it true → new templates default to public (useful for deployments that want a shared, platform-wide catalog).
Background
Today the public flag for a newly created template is effectively hardcoded and cannot be configured:
packages/api/internal/handlers/template_request_build_v3.go sets public := false for a new template (V2 and V3 both funnel through requestTemplateBuild); it only becomes true by inheriting from a previous same-alias template owned by the same team.
The V1 path (deprecated_template_request_build.go → buildTemplate → RegisterBuildData) leaves Public at its zero value false.
The request bodies (TemplateBuildRequestV3 etc.) expose no public field, and there is no env var or feature flag controlling the default.
So an operator who wants a different default visibility must fork and edit Go code — there is no configuration knob either way.
Proposal
Add an opt-in environment variable TEMPLATES_DEFAULT_PUBLIC that controls the default visibility of newly created templates:
Read in template.RegisterBuild — the single funnel all three create paths (V1/V2/V3) go through.
Applied after the existing rebuild-inheritance (data.Public = previous.Public) so the configured default governs both the stored DB row and the API response.
changed the title [-]feat(api): allow forcing new templates public via TEMPLATES_DEFAULT_PUBLIC (self-hosting)[/-][+]feat(api): make default template visibility (public/private) configurable via TEMPLATES_DEFAULT_PUBLIC[/+]on Oct 20, 2026
Activity
[-]feat(api): allow forcing new templates public via TEMPLATES_DEFAULT_PUBLIC (self-hosting)[/-][+]feat(api): make default template visibility (public/private) configurable via TEMPLATES_DEFAULT_PUBLIC[/+]ryan-sana commentedon Oct 21, 2026
Closing since the linked PR (#3704) was closed, we don't plan to add this for now. Thanks for the suggestion!