From 0c91ab0e42eec70fba5c3afa52ce1c77b0dd8763 Mon Sep 17 00:00:00 2001 From: Ayush Jha Date: Mon, 28 Apr 2025 18:46:45 +0545 Subject: [PATCH 1/2] feat: add `enable_email` field to app.yaml configuration this allows users to specify if they want an email address associated with their app. When enabled, the following happens: - a randomly generated email address is associated with the app - env vars are set to allow the app to access the email credentials --- lib/cli/src/commands/app/create.rs | 3 ++- lib/config/src/app/mod.rs | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/cli/src/commands/app/create.rs b/lib/cli/src/commands/app/create.rs index 1107c9c3a4d..28ba423f4d3 100644 --- a/lib/cli/src/commands/app/create.rs +++ b/lib/cli/src/commands/app/create.rs @@ -147,8 +147,9 @@ impl CmdAppCreate { scaling: None, locality: None, redirect: None, - extra: IndexMap::new(), jobs: None, + enable_email: None, + extra: IndexMap::new(), } } diff --git a/lib/config/src/app/mod.rs b/lib/config/src/app/mod.rs index a01b5d9eee5..948203d6cae 100644 --- a/lib/config/src/app/mod.rs +++ b/lib/config/src/app/mod.rs @@ -97,6 +97,10 @@ pub struct AppConfigV1 { #[serde(skip_serializing_if = "Option::is_none")] pub jobs: Option>, + /// Associate an email account with the app + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enable_email: Option, + /// Capture extra fields for forwards compatibility. #[serde(flatten)] pub extra: IndexMap, From 11fbedbc25fb2df7aa6111fcd5ef04be1cd1cd74 Mon Sep 17 00:00:00 2001 From: Ayush Jha Date: Mon, 28 Apr 2025 18:55:45 +0545 Subject: [PATCH 2/2] chore: generate app-onfig schema --- .../generated/jsonschema/types/AppConfigV1.schema.json | 7 +++++++ lib/config/src/app/mod.rs | 1 + 2 files changed, 8 insertions(+) diff --git a/docs/schema/generated/jsonschema/types/AppConfigV1.schema.json b/docs/schema/generated/jsonschema/types/AppConfigV1.schema.json index 0272f17fe74..95a99660e51 100644 --- a/docs/schema/generated/jsonschema/types/AppConfigV1.schema.json +++ b/docs/schema/generated/jsonschema/types/AppConfigV1.schema.json @@ -51,6 +51,13 @@ "type": "string" } }, + "enable_email": { + "description": "Associate an email account with the app", + "type": [ + "boolean", + "null" + ] + }, "env": { "description": "Environment variables.", "type": "object", diff --git a/lib/config/src/app/mod.rs b/lib/config/src/app/mod.rs index 948203d6cae..f99bc36477e 100644 --- a/lib/config/src/app/mod.rs +++ b/lib/config/src/app/mod.rs @@ -397,6 +397,7 @@ scheduled_tasks: regions: vec!["eu-rome".to_string()] }), jobs: None, + enable_email: None, } ); }