Add Blossom blob storage server and subscription management
- Introduced the `initializeBlossomServer` function to set up the Blossom blob storage server with dynamic base URL handling and ACL configuration. - Implemented the `blossomHandler` method to manage incoming requests to the Blossom API, ensuring proper URL handling and context management. - Enhanced the `PaymentProcessor` to support Blossom service levels, allowing for subscription extensions based on payment metadata. - Added methods for parsing and validating Blossom service levels, including storage quota management and subscription extension logic. - Updated the configuration to include Blossom service level settings, facilitating dynamic service level management. - Integrated storage quota checks in the blob upload process to prevent exceeding allocated limits. - Refactored existing code to improve organization and maintainability, including the removal of unused blob directory configurations. - Added tests to ensure the robustness of new functionalities and maintain existing behavior across blob operations.
This commit is contained in:
@@ -119,6 +119,14 @@ func Run(
|
||||
// Initialize the user interface
|
||||
l.UserInterface()
|
||||
|
||||
// Initialize Blossom blob storage server
|
||||
if l.blossomServer, err = initializeBlossomServer(ctx, cfg, db); err != nil {
|
||||
log.E.F("failed to initialize blossom server: %v", err)
|
||||
// Continue without blossom server
|
||||
} else if l.blossomServer != nil {
|
||||
log.I.F("blossom blob storage server initialized")
|
||||
}
|
||||
|
||||
// Ensure a relay identity secret key exists when subscriptions and NWC are enabled
|
||||
if cfg.SubscriptionEnabled && cfg.NWCUri != "" {
|
||||
if skb, e := db.GetOrCreateRelayIdentitySecret(); e != nil {
|
||||
|
||||
Reference in New Issue
Block a user