From 5bc1948f1abfc5e0fe675d75f460b4b1969bed40 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Mar 2026 10:37:17 +0000 Subject: [PATCH] feat: make repo URL optional when creating an app MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Useful for git-push-only deploys where no external repo URL is needed. - CreateApp.repo_url: String → Option - DB schema default: repo_url TEXT NOT NULL DEFAULT '' - UI validation no longer requires the field - Label marked (optional) in the form https://claude.ai/code/session_01FKCW3FDjNFj6jve4niMFXH --- server/src/db.rs | 2 +- server/src/models.rs | 2 +- server/src/routes/apps.rs | 2 +- server/src/routes/ui.rs | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server/src/db.rs b/server/src/db.rs index 1a3980f..cd99c36 100644 --- a/server/src/db.rs +++ b/server/src/db.rs @@ -17,7 +17,7 @@ pub async fn migrate(pool: &DbPool) -> anyhow::Result<()> { r#"CREATE TABLE IF NOT EXISTS apps ( id TEXT PRIMARY KEY, name TEXT NOT NULL UNIQUE, - repo_url TEXT NOT NULL, + repo_url TEXT NOT NULL DEFAULT '', branch TEXT NOT NULL DEFAULT 'main', port INTEGER NOT NULL, webhook_secret TEXT NOT NULL, diff --git a/server/src/models.rs b/server/src/models.rs index 8ac30f4..d77d42d 100644 --- a/server/src/models.rs +++ b/server/src/models.rs @@ -15,7 +15,7 @@ pub struct App { #[derive(Debug, Deserialize)] pub struct CreateApp { pub name: String, - pub repo_url: String, + pub repo_url: Option, pub branch: Option, pub port: i64, } diff --git a/server/src/routes/apps.rs b/server/src/routes/apps.rs index 9856d92..e5344a5 100644 --- a/server/src/routes/apps.rs +++ b/server/src/routes/apps.rs @@ -36,7 +36,7 @@ pub async fn create( ) .bind(&id) .bind(&payload.name) - .bind(&payload.repo_url) + .bind(payload.repo_url.unwrap_or_default()) .bind(&branch) .bind(payload.port) .bind(&secret) diff --git a/server/src/routes/ui.rs b/server/src/routes/ui.rs index 2cc932d..6857f7e 100644 --- a/server/src/routes/ui.rs +++ b/server/src/routes/ui.rs @@ -241,7 +241,7 @@ pub async fn index(State(s): State) -> Result, StatusCode

Add App

-
+
@@ -266,7 +266,7 @@ pub async fn index(State(s): State) -> Result, StatusCode branch: document.getElementById('f-branch').value.trim() || 'main', port: parseInt(document.getElementById('f-port').value), }}; - if (!data.name || !data.repo_url || !data.port) {{ alert('Fill in all fields'); return; }} + if (!data.name || !data.port) {{ alert('Fill in all fields'); return; }} const r = await fetch('/api/apps', {{ method: 'POST', headers: {{'Content-Type': 'application/json'}},