[PR #2053] [MERGED] feat(files): validate file storage is writable on startup #8020

Closed
opened 2026-04-20 17:59:23 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-vikunja/vikunja/pull/2053
Author: @kolaente
Created: 1/5/2026
Status: Merged
Merged: 1/6/2026
Merged by: @kolaente

Base: mainHead: feat-file-writable-startup-validation


📝 Commits (4)

  • 6a0c00a feat(files): validate file storage is writable on startup
  • c236b6a fix(files): fix tests for file storage validation
  • 91b8fb5 remove comment
  • 723ca96 remove more comments

📊 Changes

3 files changed (+56 additions, -19 deletions)

View changed files

📝 pkg/files/filehandling.go (+31 -2)
📝 pkg/files/files.go (+13 -14)
📝 pkg/files/s3_test.go (+12 -3)

📄 Description

Summary

  • Adds startup validation that checks if the configured file storage is writable
  • Creates and removes a temporary .vikunja-check-{timestamp} file during InitFileHandler()
  • Fails startup with a clear error if storage is not writable

Changes

  • Extract writeToStorage() internal function from Save() for reuse
  • Add ValidateFileStorage() function to test storage writability
  • Call validation after backend initialization in InitFileHandler()

Test plan

  • Start Vikunja with valid local storage path - should start normally
  • Start Vikunja with read-only local storage path - should fail with clear error
  • Start Vikunja with valid S3 configuration - should start normally
  • Start Vikunja with invalid S3 credentials - should fail with clear error

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-vikunja/vikunja/pull/2053 **Author:** [@kolaente](https://github.com/kolaente) **Created:** 1/5/2026 **Status:** ✅ Merged **Merged:** 1/6/2026 **Merged by:** [@kolaente](https://github.com/kolaente) **Base:** `main` ← **Head:** `feat-file-writable-startup-validation` --- ### 📝 Commits (4) - [`6a0c00a`](https://github.com/go-vikunja/vikunja/commit/6a0c00a41db3678ff86b281b7fa67a2e70988102) feat(files): validate file storage is writable on startup - [`c236b6a`](https://github.com/go-vikunja/vikunja/commit/c236b6a85121f06cb833fb7182f25f52ef87b528) fix(files): fix tests for file storage validation - [`91b8fb5`](https://github.com/go-vikunja/vikunja/commit/91b8fb5abe2dc3b2860cbbdb91bcc645b2df2211) remove comment - [`723ca96`](https://github.com/go-vikunja/vikunja/commit/723ca96df46c1e06e3961cc323143bb4be451a8f) remove more comments ### 📊 Changes **3 files changed** (+56 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `pkg/files/filehandling.go` (+31 -2) 📝 `pkg/files/files.go` (+13 -14) 📝 `pkg/files/s3_test.go` (+12 -3) </details> ### 📄 Description ## Summary - Adds startup validation that checks if the configured file storage is writable - Creates and removes a temporary `.vikunja-check-{timestamp}` file during `InitFileHandler()` - Fails startup with a clear error if storage is not writable ## Changes - Extract `writeToStorage()` internal function from `Save()` for reuse - Add `ValidateFileStorage()` function to test storage writability - Call validation after backend initialization in `InitFileHandler()` ## Test plan - [ ] Start Vikunja with valid local storage path - should start normally - [ ] Start Vikunja with read-only local storage path - should fail with clear error - [ ] Start Vikunja with valid S3 configuration - should start normally - [ ] Start Vikunja with invalid S3 credentials - should fail with clear error --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-20 17:59:23 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#8020