Skip to content

Feat: R2 storage#13

Merged
AnnaSasDev merged 23 commits intocorefrom
R2Storage
Jan 27, 2026
Merged

Feat: R2 storage#13
AnnaSasDev merged 23 commits intocorefrom
R2Storage

Conversation

@AnnaSasDev
Copy link
Contributor

No description provided.

- Introduce `R2ContentStorage` class for managing read/write operations with R2 bucket.
- Add `R2StorageOptions` to handle configuration for R2 content storage.
- Replace `LocalFileStorage.IsLocalhost` checks with `Storage.IsWritable` and implement unified `IContentStorage` interface.
- Update components and services to support R2-based content management and streamline file operations.
- Modify program configuration to include `appsettings.json` and R2 settings.
- Enhance content loading and saving logic to accommodate both local and remote storage scenarios.
- Update `LocalizedMarkdownEditor`, `ContentManagerPage`, and related components for improved flexibility with remote storage.
…sourceStorage`) and associated tests

- Eliminate legacy file system services and interfaces (`IContentStorage`, `ILocalFileStorage`, `IResourceStorage`), along with their implementations and references.
- Simplify `TagsEditor` by removing `SaveResxToDisk` logic and `ResourceStorage` dependency.
- Clean up service registration tests to reflect the removal of file system services.
- Refactor `Program.cs` to reorganize configuration loading logic.
… consistency and modular design. Update related tests, components, and service registrations accordingly. Migrate `R2StorageOptions` to record type for improved immutability and refactor validation logic.
…services, and tests for simplified storage handling. Refactor related logic to improve consistency and streamline operations.
- Introduced `DirectiveAthena.Website.DevServer` project for dev-only purposes.
- Refactored `R2ContentStorage` with better handling for proxy and presigned operations.
- Updated `ContentStorageFactory` and added `HttpClient` dependency for more flexibility.
- Added debug-only local settings logic in `Program.cs`.
- Improved type safety and code clarity by updating variable declarations in components, services, and tests.
- Removed unused `launchSettings.json` to clean up configuration files.
- Introduced logic in **TagsEditor.razor** for saving `.resx` files localized by culture, using the file system API.
- Added `Snackbar` for user feedback on save success or failure.
- Updated `Tags.resx` and `Tags.nl.resx` to include a new resource key (`NewTag`).
- Added **moon-horizon.svg** asset to the project.
- Transitioned from Amazon S3 SDK to MinIO SDK for R2 storage integration.
- Refactored `R2ContentStorage` and `ContentStorageFactory` to use MinIO client.
- Updated corresponding read/write operations and proxy logic in `R2ContentStorage`.
- Removed `AWSSDK.S3` dependency and added `Minio` package.
- Simplified code by removing redundant configurations and handling.
…teDevServer` and modularize API endpoints

- Renamed `DirectiveAthena.Website.DevServer` to `DirectiveAthena.WebsiteDevServer` for consistency.
- Introduced `ApiEndpoints` class to modularize `upload` and `delete` R2 proxy operations.
- Refactored `Program.cs` to delegate R2 API call logic to `ApiEndpoints`.
- Updated namespaces and paths to reflect the renaming.
- Adjusted `.gitignore` and solution files accordingly.
- Removed duplicate `NotFoundPage.razor` in `DirectiveAthena.Website/Pages`.
- Moved `NotFoundPage.razor` to `DirectiveAthena.Website.Components/Pages`.
- Updated router declarations in `App.razor` and `AdminApp.razor` for the new `NotFoundPage` path.
- Changed `ApiEndpoints` to static for improved clarity and usage.
- Added a responsive layout and updated visual design using MudBlazor components.
- Introduced localization for NotFoundPage with new resources: `NotFound.GoHome`, `NotFound.BrowseArticles`, etc.
- Updated `.resx` files (`Shared.resx`, `Shared.nl.resx`) and corresponding constants in `Shared.cs` to support multilingual content.
…and localization

- Cleaned up `Shared.resx`, `Shared.nl.resx`, and `Tags.nl.resx` by removing unused resource keys.
- Updated `Shared.cs` to reflect the removal of resource constants.
- Simplified localization files by eliminating redundant entries.
- Added `DirectiveAthena.Website.GithubPages.slnf` for selective project builds and tests.
- Modified `publishGithubPages.yml` to use the new solution file for restoration and testing steps.
- Made `ApplyPreferredCultureAsync` more robust by adding null/whitespace check for `culture` in `LocalizationInitializer`.
- Updated Twitch iframe in `TwitchSection.razor` to include `autoplay=false` and `loading="lazy"` for performance improvements.
- Added browser warning logging flag in `ContentStorageFactory` to prevent repeated messages.
- Integrated `lib_testing.yml` into `publishGithubPages.yml` and `onPullRequestTests.yml` workflows.
- Updated solution file to include `lib_testing.yml` in the `.dev-tools/github` folder.
- Removed direct `HttpClient` dependency from `ArticleRepository` and `WorldRuleRepository`.
- Introduced `ContentReadResult` struct to improve response handling for content storage operations.
- Updated `IContentStorage` and `R2ContentStorage` interfaces to include `ReadIndexAsync` method for content retrieval.
- Moved applicable JSON serialization logic to content storage layer.
- Adjusted unit tests to mock `ContentStorage` instead of `HttpClient`.
- Deleted obsolete article and index files from project.
…trings

- Replaced `GetAllWithoutHiddenAsync` with `GetAllAsync` in `ArticleRepository` usage within `ContentManagerPage.razor`.
- Updated `.resx` files (`Shared.resx`, `Shared.nl.resx`) to reflect R2 storage terminology (e.g., "saved to disk" → "saved to R2").
- Simplified cache refresh logic in `ContentRepository` using `switch` expression and cleaned up unused `CacheRefreshWindow`.
- Modularized `ServiceCollectionExtensions` by extracting `AddContentStorage` method to improve readability and reusability.
- Introduced `DevRefreshWindow` (5 seconds) for debug builds and `CacheRefreshWindow` (5 minutes) for release builds using preprocessor directives.
@AnnaSasDev AnnaSasDev merged commit 74ff5f2 into core Jan 27, 2026
1 check passed
@AnnaSasDev AnnaSasDev deleted the R2Storage branch January 27, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant