Clean up obsolete CalDAV environment variables
Some checks failed
Build and Push Docker Image / docker (push) Failing after 2s
Some checks failed
Build and Push Docker Image / docker (push) Failing after 2s
## Removed Obsolete Environment Variables: - `CALDAV_SERVER_URL` - provided by user login - `CALDAV_USERNAME` - provided by user login - `CALDAV_PASSWORD` - provided by user login - `CALDAV_TASKS_PATH` - not used in any features ## Kept with Intelligent Discovery: - `CALDAV_CALENDAR_PATH` - optional override, defaults to smart discovery ## Changes: ### Backend - Remove `CalDAVConfig::from_env()` method (not used in main app) - Add `CalDAVConfig::new()` constructor with credentials - Remove `tasks_path` field from CalDAVConfig - Update auth service to use new constructor - Update tests to use hardcoded test values instead of env vars - Update debug tools to use test credentials ### Frontend - Remove unused `config.rs` file entirely (frontend uses backend API) ## Current Authentication Flow: 1. User provides CalDAV credentials via login API 2. Backend creates CalDAVConfig dynamically from login request 3. Backend tests authentication via calendar discovery 4. Optional `CALDAV_CALENDAR_PATH` env var can override discovery 5. No environment variables required for normal operation This simplifies deployment - users only need to provide CalDAV credentials through the web interface, no server-side configuration required. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -72,9 +72,9 @@ mod test_utils {
|
||||
|
||||
pub async fn login(&self) -> String {
|
||||
let login_payload = json!({
|
||||
"username": std::env::var("CALDAV_USERNAME").unwrap_or("test".to_string()),
|
||||
"password": std::env::var("CALDAV_PASSWORD").unwrap_or("test".to_string()),
|
||||
"server_url": std::env::var("CALDAV_SERVER_URL").unwrap_or("https://example.com".to_string())
|
||||
"username": "test".to_string(),
|
||||
"password": "test".to_string(),
|
||||
"server_url": "https://example.com".to_string()
|
||||
});
|
||||
|
||||
let response = self.client
|
||||
@@ -134,12 +134,10 @@ mod tests {
|
||||
async fn test_auth_login() {
|
||||
let server = TestServer::start().await;
|
||||
|
||||
// Load credentials from .env
|
||||
dotenvy::dotenv().ok();
|
||||
let username = std::env::var("CALDAV_USERNAME").unwrap_or("test".to_string());
|
||||
let password = std::env::var("CALDAV_PASSWORD").unwrap_or("test".to_string());
|
||||
|
||||
let server_url = std::env::var("CALDAV_SERVER_URL").unwrap_or("https://example.com".to_string());
|
||||
// Use test credentials
|
||||
let username = "test".to_string();
|
||||
let password = "test".to_string();
|
||||
let server_url = "https://example.com".to_string();
|
||||
|
||||
let login_payload = json!({
|
||||
"username": username,
|
||||
@@ -196,7 +194,7 @@ mod tests {
|
||||
|
||||
// Load password from env for CalDAV requests
|
||||
dotenvy::dotenv().ok();
|
||||
let password = std::env::var("CALDAV_PASSWORD").unwrap_or("test".to_string());
|
||||
let password = "test".to_string();
|
||||
|
||||
let response = server.client
|
||||
.get(&format!("{}/api/user/info", server.base_url))
|
||||
@@ -226,7 +224,7 @@ mod tests {
|
||||
|
||||
// Load password from env for CalDAV requests
|
||||
dotenvy::dotenv().ok();
|
||||
let password = std::env::var("CALDAV_PASSWORD").unwrap_or("test".to_string());
|
||||
let password = "test".to_string();
|
||||
|
||||
let response = server.client
|
||||
.get(&format!("{}/api/calendar/events?year=2024&month=12", server.base_url))
|
||||
@@ -254,7 +252,7 @@ mod tests {
|
||||
|
||||
// Load password from env for CalDAV requests
|
||||
dotenvy::dotenv().ok();
|
||||
let password = std::env::var("CALDAV_PASSWORD").unwrap_or("test".to_string());
|
||||
let password = "test".to_string();
|
||||
|
||||
let create_payload = json!({
|
||||
"title": "Integration Test Event",
|
||||
@@ -308,7 +306,7 @@ mod tests {
|
||||
|
||||
// Load password from env for CalDAV requests
|
||||
dotenvy::dotenv().ok();
|
||||
let password = std::env::var("CALDAV_PASSWORD").unwrap_or("test".to_string());
|
||||
let password = "test".to_string();
|
||||
|
||||
// Use a dummy UID for testing - this will likely return 404 but we're testing the endpoint structure
|
||||
let test_uid = "test-event-uid";
|
||||
@@ -373,7 +371,7 @@ mod tests {
|
||||
|
||||
// Load password from env for CalDAV requests
|
||||
dotenvy::dotenv().ok();
|
||||
let password = std::env::var("CALDAV_PASSWORD").unwrap_or("test".to_string());
|
||||
let password = "test".to_string();
|
||||
|
||||
let create_payload = json!({
|
||||
"title": "Integration Test Series",
|
||||
@@ -431,7 +429,7 @@ mod tests {
|
||||
|
||||
// Load password from env for CalDAV requests
|
||||
dotenvy::dotenv().ok();
|
||||
let password = std::env::var("CALDAV_PASSWORD").unwrap_or("test".to_string());
|
||||
let password = "test".to_string();
|
||||
|
||||
let update_payload = json!({
|
||||
"series_uid": "test-series-uid",
|
||||
@@ -493,7 +491,7 @@ mod tests {
|
||||
|
||||
// Load password from env for CalDAV requests
|
||||
dotenvy::dotenv().ok();
|
||||
let password = std::env::var("CALDAV_PASSWORD").unwrap_or("test".to_string());
|
||||
let password = "test".to_string();
|
||||
|
||||
let delete_payload = json!({
|
||||
"series_uid": "test-series-to-delete",
|
||||
|
||||
Reference in New Issue
Block a user