Commit Graph

386 Commits

Author SHA1 Message Date
Innei
4e1b27625b feat(config): add development environment constant and enhance font loading logic
- Introduced a global constant `__DEV__` to indicate the development environment in the Vite configuration.
- Updated the `OgService` to conditionally include additional font paths when in development mode, improving font loading flexibility.
- Refactored font loading logic to check for file existence before attempting to read, enhancing reliability.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-14 20:59:14 +08:00
Innei
ef19962eb2 feat(docker): optimize Dockerfile and enhance EXIF data extraction
- Updated Dockerfile to use Alpine base image for reduced size and added necessary runtime dependencies including exiftool.
- Refactored EXIF data extraction logic to utilize exiftool with improved error handling and logging.
- Simplified metadata handling by removing unnecessary checks and ensuring consistent extraction of EXIF data.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-14 20:04:53 +08:00
Innei
fa7b953d78 feat(logger): enhance logging functionality with tag support and message relaying
- Updated the ConsolaCompatibleLogger to include a tag parameter for better log categorization.
- Introduced a relayLogMessage function to facilitate message relaying with associated tags and log levels.
- Refactored the createBuilderLoggerAdapter function to utilize the new tagging system, improving log context and traceability.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-14 18:32:00 +08:00
Innei
51a5a51f20 feat(data-sync): enhance error handling in data synchronization process
- Added an 'errors' field to the DataSyncResultSummary and updated related types to track synchronization errors.
- Modified the DataSyncService to categorize certain failures as errors instead of conflicts.
- Updated UI components to display error counts in synchronization summaries and progress panels, improving user feedback during data sync operations.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-14 17:54:01 +08:00
Innei
5e4b4bb4d1 feat(data-management): add data management module for photo asset maintenance
- Introduced the DataManagementModule, including a controller and service for managing photo asset records.
- Implemented functionality to truncate photo asset records from the database, enhancing data management capabilities.
- Updated existing photo asset deletion logic to support optional deletion from storage.
- Added a new DataManagementPanel in the dashboard for user interaction with data management features.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-14 16:38:15 +08:00
Innei
2b30668072 feat(data-sync): ensure plugin hooks are ready before listing storage objects
- Added a call to `builder.ensurePluginsReady()` in the DataSyncService to ensure that plugin hooks, such as thumbnail storage exclude filters, are executed prior to listing storage objects.
- This change enhances the reliability of the data synchronization process by ensuring all necessary plugins are initialized before operations commence.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-14 14:41:18 +08:00
Wenzhuo Liu
f2658cf5a5 feat: support hdr motion photo (#155) 2025-11-14 14:26:03 +08:00
Innei
6085335242 chore(builder): update package version and adjust module exports
- Bumped package version from 0.1.3 to 0.2.2 for the builder.
- Changed main entry point and module exports from `.js` to `.mjs` and updated type definitions to `.d.mts` for better compatibility with ES modules.
- Modified GitHub repository synchronization plugin options to allow an optional `enable` flag, enhancing configuration flexibility.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-14 00:31:32 +08:00
Innei
3e60b382e1 feat(builder): integrate GitHub repository synchronization plugin and update configuration
- Added `githubRepoSyncPlugin` to the builder configuration, enabling synchronization with a GitHub repository.
- Removed deprecated repository settings from user configuration and streamlined the plugin's integration.
- Updated CLI and documentation to reflect changes in repository configuration handling, enhancing clarity for users.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-14 00:23:26 +08:00
Innei
6a4f868a5a feat(docker): add Docker Compose configuration for database and caching services
- Introduced a new `docker-compose.yml` file to define services for PostgreSQL and Redis, facilitating local development and testing.
- Configured health checks for both services to ensure they are ready before the core application starts.
- Set up environment variables for the PostgreSQL service to manage user credentials and database initialization.
- Added volume mappings for persistent data storage in both PostgreSQL and Redis.

refactor(auth): streamline tenant context resolution and error handling

- Simplified the `AuthGuard` to throw a `BizException` with a detailed message when tenant IDs do not match.
- Removed unnecessary response header settings in the `TenantContextResolver` and middleware, improving clarity and maintainability.
- Updated various controllers and services to utilize the new tenant context handling logic, ensuring consistent behavior across the application.

feat(super-admin): implement builder debug functionality

- Added `SuperAdminBuilderDebugController` to handle image debugging requests with progress tracking.
- Introduced an in-memory storage provider for debugging purposes, allowing for temporary file uploads and processing.
- Enhanced the dashboard with a new debug page for super admins to test and validate image processing workflows.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-13 23:43:22 +08:00
Innei
936666d8a2 refactor: remove unnecessary window checks across components
- Eliminated checks for `typeof window !== 'undefined'` in various components and utility functions, simplifying the codebase.
- Updated logic to directly access `window` properties, assuming the code runs in a browser environment.
- Improved readability and maintainability by streamlining conditional checks related to window availability.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-13 15:03:46 +08:00
Innei
76a4c251e4 feat(photo): enhance photo asset normalization and logging
- Updated photo asset service to correctly use regex in normalization functions, ensuring proper path formatting.
- Introduced builder log relay functionality in the data sync controller to improve logging during synchronization tasks.
- Added error handling improvements across various components, utilizing a centralized error message function for consistency.
- Enhanced photo page actions and library action bar with new select all functionality for better user experience.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-13 14:52:00 +08:00
Innei
e8f967a7ea refactor(s3): replace AWS SDK S3 types with custom S3ObjectLike interface
- Removed dependencies on AWS SDK's S3 types in favor of a custom S3ObjectLike interface for better type management.
- Updated various services and components to utilize the new S3ObjectLike type, enhancing code clarity and maintainability.
- Introduced a SimpleS3Client interface to streamline S3 client interactions and improve fetch handling.
- Added fast-xml-parser for XML response parsing in S3 operations, enhancing object listing functionality.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-13 13:53:54 +08:00
Innei
9f436c63d3 chore(docker): update Dockerfile to include runtime dependencies for image processing
- Added perl, perl-image-exiftool, vips, and libheif to the Dockerfile for enhanced image processing capabilities.
- These dependencies support exiftool functionality and enable HEIF/HEIC support in libvips.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-13 00:46:25 +08:00
Innei
ff73de44c8 feat(data-sync): implement logging for data synchronization process
- Added logging functionality to the DataSyncService to track progress and errors during the manifest generation process.
- Introduced DataSyncLogLevel and DataSyncLogPayload types for structured logging.
- Updated emitLog method to handle different log levels (info, success, warn, error) and include relevant details.
- Enhanced PhotoSyncProgressState to maintain a log of synchronization events, displayed in the PhotoSyncProgressPanel.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-13 00:42:43 +08:00
Innei
42c217e2f8 chore(deps): update package versions across the project
- Bumped versions for several dependencies including `@types/node`, `eslint`, `sharp`, `vite`, and various `@tanstack/react-query` packages to their latest releases for improved stability and features.
- Updated Tailwind CSS related packages to version 4.1.17 for consistency across the project.
- Adjusted other dependencies such as `jotai`, `lucide-react`, and `tailwind-merge` to their latest versions to ensure compatibility and access to new features.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-12 23:57:37 +08:00
Innei
33cbbfe2b4 refactor(errors): simplify BizException and BizErrorResponse interfaces
- Removed generic type parameters from BizExceptionOptions and BizErrorResponse interfaces for clarity.
- Updated BizException class to directly use the message property from options, enhancing readability.
- Adjusted toResponse method in BizException to streamline response structure by removing unnecessary details handling.

fix(controller): update error handling in StorageSettingController

- Changed error code in ensureKeyAllowed method to use COMMON_BAD_REQUEST for better accuracy in error reporting.

fix(dashboard): update HTML files to use link tag for favicon

- Replaced meta tag with link tag for favicon in index.html, tenant-missing.html, and tenant-restricted.html for improved compatibility.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-12 23:30:58 +08:00
Innei
76d60fd672 feat(ui): introduce LinearBorderContainer component and enhance NotFound pages
- Added LinearBorderContainer component for improved UI styling with gradient borders.
- Refactored NotFound components in both web and dashboard to utilize LinearBorderContainer, enhancing visual presentation and user experience.
- Updated layout and messaging for 404 error pages to provide clearer navigation options.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-12 22:47:56 +08:00
Innei
84fe2b70ec fix: response camelCaseKeys
- Removed the server-side check for window existence in usePageRedirect hook, streamlining the redirect logic.
- Ensured that tenant slug resolution remains intact for client-side operations.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-12 21:56:17 +08:00
Innei
d15112293f feat(auth): refine tenant context handling and slug resolution
- Enhanced AuthController to derive requestedSlug based on tenant context and placeholder status.
- Updated TenantContextResolver to utilize requestedSlug for setting tenant headers, improving accuracy in tenant identification.
- Ensured consistent handling of tenant slugs across authentication processes.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-12 21:39:45 +08:00
Innei
6768e86327 fix: update oauth
Signed-off-by: Innei <tukon479@gmail.com>
2025-11-12 19:45:37 +08:00
Innei
a5ff9363af feat(auth): enhance tenant context resolution and error logging
- Updated AuthProvider to improve tenant slug resolution by considering requestedSlug alongside tenant slug.
- Enhanced error handling in the OAuth callback by logging detailed error information when encountering authentication errors.
- Modified TenantContextResolver to include requestedSlug in tenant context creation, ensuring accurate context resolution.
- Updated TenantContext interface to include requestedSlug for better clarity in tenant context management.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-12 19:23:24 +08:00
Innei
715dbf7077 refactor(oauth): remove redirect URI settings from system configuration
- Removed oauthGoogleRedirectUri and oauthGithubRedirectUri from SYSTEM_SETTING_DEFINITIONS and related service logic.
- Updated SystemSettingService to eliminate handling of redirect URIs for Google and GitHub.
- Adjusted UI schema and types to reflect the removal of redirect URI fields.
- Cleaned up associated validation and parsing logic to streamline OAuth configuration.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-12 17:56:22 +08:00
Innei
66c57218e4 feat(oauth-gateway): add oauthGatewayUrl configuration and handling
- Introduced a new configuration for oauthGatewayUrl in system settings, allowing for flexible OAuth callback handling.
- Updated the SystemSettingService to parse and normalize the oauthGatewayUrl.
- Enhanced the AuthProvider to utilize the oauthGatewayUrl for constructing redirect URIs for third-party logins.
- Added validation for the oauthGatewayUrl to ensure it adheres to HTTP/HTTPS protocols.
- Updated UI schema to include oauthGatewayUrl field for user input.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-12 17:14:04 +08:00
Innei
74584cd230 feat(oauth-gateway): implement multi-tenant OAuth gateway service
- Added a new OAuth gateway service to handle multi-tenant authentication callbacks.
- Implemented routing logic for provider callbacks, including tenant slug validation and host resolution.
- Introduced configuration management for environment variables and service settings.
- Created Dockerfile and package.json for service deployment and dependencies.
- Added HTML response for restricted tenant access and updated static web components accordingly.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-12 16:33:24 +08:00
Innei
1435eb0608 feat(auth): enhance redirect URI handling for multi-tenant support
- Updated the buildBetterAuthProvidersForHost method to include fallback host and tenant slug parameters for improved redirect URI construction.
- Introduced a new resolveRedirectHost method to determine the appropriate host based on tenant slug and fallback host.
- Refactored buildRedirectUri to utilize the new logic, ensuring correct handling of tenant-specific redirects.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-12 15:29:25 +08:00
Innei
fdf1b891d4 feat(registration-wizard): implement automatic tenant slug locking based on subdomain
- Added logic to automatically set the tenant slug from the current subdomain in the RegistrationWizard component.
- Introduced a state to lock the tenant slug, preventing manual changes when it matches the subdomain.
- Updated WorkspaceStep to reflect the locked state and provide appropriate messaging to users.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-12 15:04:11 +08:00
Innei
0eb4ac939f feat(static-web): enhance tenant access control and response handling
- Added methods to block access for reserved tenants in StaticWebController.
- Implemented logic to allow tenantless access to specific dashboard routes.
- Refactored static dashboard index handling to improve tenant context checks and response management.
- Updated TenantMissingStandalone component to simplify URL construction.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-12 14:47:26 +08:00
Innei
9c4fe4155f chore(landing): update
Signed-off-by: Innei <tukon479@gmail.com>
2025-11-11 23:21:54 +08:00
Innei
16d78812ee chore(landing): update landing
Signed-off-by: Innei <tukon479@gmail.com>
2025-11-11 22:52:35 +08:00
Innei
2665778890 chore: landing init 2025-11-11 21:47:58 +08:00
Innei
6b1f124af6 feat: implement tenant missing page and enhance static web response handling
- Added a new tenant missing page to provide user feedback when a tenant is unavailable.
- Updated StaticWebController to check for tenant context and render the tenant missing page when necessary.
- Refactored StaticAssetService to generalize HTML response creation.
- Introduced new methods for handling tenant missing scenarios and improved response management in StaticWebService.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-11 20:20:01 +08:00
Innei
ee938d1f67 feat: implement root tenant login functionality
- Renamed core package to @afilmory/core for better namespace management.
- Added AppInitializationModule and AppInitializationProvider to handle application startup and root tenant provisioning.
- Introduced root tenant login page and updated routing to support root login.
- Enhanced tenant context resolution to accommodate root tenant paths and added related utility functions.
- Refactored existing services and modules to integrate root tenant logic and improve overall structure.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-11 19:33:51 +08:00
Innei
d1b5ceed70 feat: add SkipTenantGuard to static web routes
- Introduced the SkipTenantGuard decorator to the static web routes in StaticWebController, allowing access without tenant validation.
- Updated the getStaticWebRoot, getStaticWebIndex, and getStaticDashboardIndexWithBasename methods to utilize the new guard.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-11 18:30:35 +08:00
Innei
7eebdb6083 feat: add database migration CLI and entrypoint script
- Introduced a new entrypoint script to handle database migrations before starting the application.
- Implemented CLI commands for database migration, including argument parsing and execution logic.
- Updated Dockerfile to copy the entrypoint script and set it as the container's entrypoint.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-11 17:53:23 +08:00
Innei
f4f66810c1 chore: re-gen db migration
Signed-off-by: Innei <tukon479@gmail.com>
2025-11-11 17:10:53 +08:00
Innei
12adcf0706 feat: enhance version resolution for external dependencies in vite.config.ts
- Added functions to resolve dependency versions from package.json and npm commands, improving the accuracy of version retrieval for external modules.
- Refactored the generateExternalsPackageJson function to utilize the new version resolution logic, streamlining the process of generating package.json for externals.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-11 16:43:29 +08:00
Innei
dd1ab7206b fix: update Dockerfile to specify web filter for build serve
- Changed the build serve command in the Dockerfile to specifically use the @afilmory/web filter, ensuring the correct application context is built and served.
- This adjustment improves the clarity and accuracy of the build process for the web application.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-11 16:02:09 +08:00
Innei
5940558975 fix: improve page redirect handling for tenant sessions
- Refactored the page redirect logic to ensure proper session clearance for placeholder tenants.
- Added an asynchronous function to handle sign-out before redirecting to the target URL, with error logging for better debugging.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-11 15:48:50 +08:00
Innei
88f763d2e2 feat: implement placeholder tenant support across guards and decorators
- Introduced AllowPlaceholderTenant decorator to manage placeholder tenant access.
- Added PlaceholderTenantGuard to enforce access rules for placeholder tenants.
- Enhanced AuthGuard to handle placeholder tenant contexts and permissions.
- Updated roles handling to support inheritance and added RolesGuard for role-based access control.
- Integrated placeholder tenant logic into various controllers and services for consistent behavior.
- Improved tenant context resolution to fallback to placeholder tenant when necessary.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-11 15:28:46 +08:00
Innei
1957abede6 refactor: rename SkipTenant decorator to SkipTenantGuard and update imports
- Renamed the SkipTenant decorator to SkipTenantGuard for clarity and consistency.
- Updated all relevant imports across the application to reflect this change.
- Added mkdir functionality in vite.config.ts to ensure output directory exists before writing package.json.
- Removed unused CJK font promise in og.service.ts and commented out related code for future reference.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-11 02:01:38 +08:00
Innei
f8b879f99a chore: remove git lfs
Signed-off-by: Innei <tukon479@gmail.com>
2025-11-11 01:39:08 +08:00
Innei
df7586c0c4 Delete photos directory 2025-11-11 01:32:06 +08:00
Innei
082f201aea refactor!: split builder config (#154)
Signed-off-by: Innei <tukon479@gmail.com>
2025-11-11 00:39:56 +08:00
Chrys
5078143b1e fix: update config examples with missing settings (#131) 2025-11-10 23:44:36 +08:00
Wenzhuo Liu
777e8cbbba feat: add support for motion photo (#153) 2025-11-10 23:23:09 +08:00
Innei
5c96a65afc refactor(settings): simplify settings component and implement redirect
- Removed the MainPageLayout and its associated components from the settings page, returning null instead.
- Added a loader function to redirect users to the '/settings/site' path, streamlining navigation within the application.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-10 17:45:44 +08:00
Innei
dbc8be1884 refactor(docker): update asset copying in Dockerfile for core application
- Modified the Dockerfile to use wildcard copying for built assets from the web and dashboard applications, ensuring all files are included in the production image.
- This change enhances the reliability of the asset transfer process during the build stage.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-10 17:43:23 +08:00
Innei
5fd3fcb1b5 fix(logging): enhance HTTP logging to include tenant information
- Updated the LoggingInterceptor to extract and log tenant information during HTTP requests.
- Improved log messages to include tenant slug for better traceability in multi-tenant environments.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-10 17:23:41 +08:00
Innei
6e309a724b refactor(docker): update build command in Dockerfile for core application
- Changed the build command from 'build:web' to 'build:serve' to better align with the intended application startup process.
- Ensured that the Dockerfile reflects the latest build requirements for the core application.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-10 17:22:44 +08:00