Enhance Docker and backend configurations for improved deployment
- Updated docker-compose.yml to include environment variable support for services, enhancing flexibility in configuration. - Refactored Dockerfile to utilize build arguments for VITE environment variables, allowing for better customization during builds. - Improved Nginx configuration to handle larger video uploads by increasing client_max_body_size to 5GB. - Enhanced backend Dockerfile to include wget for health checks and improved startup logging for database migrations. - Added validation for critical environment variables in the backend to ensure necessary configurations are present before application startup. - Updated content streaming logic to support direct HLS URL construction, improving streaming reliability and user experience. - Refactored various components and services to streamline access checks and improve error handling during content playback.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { apiService } from './api.service'
|
||||
import { indeehubApiService } from './indeehub-api.service'
|
||||
import type { ApiRent, ApiContent } from '../types/api'
|
||||
import { USE_MOCK } from '../utils/mock'
|
||||
|
||||
@@ -99,10 +100,11 @@ class LibraryService {
|
||||
|
||||
/**
|
||||
* Check if an active (non-expired) rent exists for a given content ID.
|
||||
* Returns the rental expiry when one exists.
|
||||
* Uses indeehubApiService which carries Nostr JWT auth tokens for more
|
||||
* reliable authentication than the generic apiService.
|
||||
*/
|
||||
async checkRentExists(contentId: string): Promise<{ exists: boolean; expiresAt?: string }> {
|
||||
return apiService.get(`/rents/content/${contentId}/exists`)
|
||||
return indeehubApiService.get(`/rents/content/${contentId}/exists`)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -157,8 +157,14 @@ class Nip98Service {
|
||||
sessionStorage.setItem('nostr_token', accessToken)
|
||||
|
||||
return accessToken
|
||||
} catch {
|
||||
this.clearSession()
|
||||
} catch (err) {
|
||||
// Don't wipe tokens on refresh failure — the refresh token may
|
||||
// still be valid and a retry could succeed (e.g. transient network
|
||||
// error). Only clear the expired access token so the next request
|
||||
// tries a fresh refresh instead of sending a stale token.
|
||||
sessionStorage.removeItem(TOKEN_KEY)
|
||||
sessionStorage.removeItem(EXPIRES_KEY)
|
||||
console.warn('Token refresh failed:', err)
|
||||
return null
|
||||
} finally {
|
||||
this.refreshPromise = null
|
||||
|
||||
Reference in New Issue
Block a user