183 Commits

Author SHA1 Message Date
Innei
dafc621033 feat(config): update site configuration and enhance author handling
- Changed default site name and URL to reflect new branding.
- Updated author information in the site configuration, including name, URL, and avatar.
- Removed author-related settings from the configuration schema to streamline the setup.
- Enhanced the SiteSettingService to resolve author details dynamically based on tenant context.
- Added a new endpoint to retrieve the status of photo synchronization, improving user feedback on sync operations.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-15 01:08:31 +08:00
Innei
0621909e49 feat(app): integrate Hono framework for improved routing and error handling
- Replaced the previous application instance with Hono for better routing capabilities.
- Updated OpenAPI route registration to use a new internal path structure.
- Enhanced error handling by utilizing Hono's built-in error management features.
- Adjusted logging to reflect the new route paths for OpenAPI documentation.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-14 23:37:16 +08:00
Innei
3f27b971f6 feat(manifest): add public controller and enhance manifest service
- Introduced `ManifestPublicController` to handle public requests for the manifest.
- Updated `ManifestModule` to include the new controller.
- Enhanced `ManifestService` to support additional sync statuses in the query logic.
- Updated type imports in `PhotoAssetService` for better type safety.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-14 23:27:30 +08:00
Innei
4391721d55 feat(auth): implement account unlinking validation and add tenant account deletion functionality
- Enhanced the AuthController to validate that at least one OAuth provider remains linked when unlinking accounts.
- Introduced a new endpoint in DataManagementController for deleting tenant accounts, ensuring proper checks for tenant slug and permissions.
- Updated DataManagementService to handle the deletion of tenant-related data across multiple tables in the database.
- Added user confirmation prompts in the DataManagementPanel for account deletion to prevent accidental data loss.
- Integrated new hooks and API functions to support tenant account deletion in the dashboard.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-14 23:03:00 +08:00
Innei
77f16490e4 chore: adjust docs and add cjk font
- Created a new documentation site under `apps/docs` using Vite, React, and MDX.
- Added essential files including `index.html`, `package.json`, and various configuration files.
- Implemented a file-system based routing system with automatic route generation from markdown files.
- Included support for syntax highlighting, responsive design, and TypeScript.
- Established a structure for documentation content with initial deployment guides and storage provider information.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-14 21:52:54 +08:00
Innei
c107aa49b3 fix(og.service): improve font loading error handling
- Updated the font loading logic in `OgService` to handle potential errors when checking file existence.
- Utilized optional chaining to ensure that the code does not throw an error if the stat call fails, enhancing reliability during font loading.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-14 21:07:54 +08:00
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
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
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
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
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
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
082f201aea refactor!: split builder config (#154)
Signed-off-by: Innei <tukon479@gmail.com>
2025-11-11 00:39:56 +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
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
2700d22983 refactor(tsconfig): update TypeScript configuration and enhance middleware handling
- Changed target from ES2022 to ESNext in tsconfig files for core and framework packages.
- Reformatted paths and include/exclude arrays for better readability.
- Introduced a new middleware for context propagation in the application, ensuring HttpContext values are preserved for downstream handlers.
- Refactored middleware registration logic to streamline the process and improve maintainability.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-10 17:19:40 +08:00
Innei
4064c1341c refactor(auth): streamline onboarding process and enhance registration flow
- Removed the onboarding module and its associated components to simplify the application structure.
- Introduced a new welcome module with components for site schema and registration wizard.
- Updated routing to direct users to the new welcome page for tenant registration.
- Enhanced the registration process by integrating social authentication options and improving user experience.
- Refactored related hooks and utilities to support the new onboarding flow.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-10 00:55:20 +08:00
Innei
442e1bcbf8 feat(docker): add perl installation to Dockerfile for production environment
- Updated Dockerfile to include installation of perl in the production image.
- Ensured that the environment is prepared for any necessary scripts or dependencies requiring perl.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-09 22:47:42 +08:00
Innei
e4d61ebd28 feat(auth): enhance social account management and improve authentication flow
- Added endpoints for linking and unlinking social accounts in AuthController.
- Introduced new types for social account requests and responses.
- Implemented methods to fetch and serialize social accounts.
- Updated the AuthProvider to include verification handling and cookie prefix management.
- Created new components for social connection settings in the dashboard, allowing users to manage their linked accounts.
- Added database migration for the new auth_verification table to support account verification processes.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-08 23:47:51 +08:00
Innei
bc4e21d2f8 feat(dependencies): add @iconify-json/simple-icons and update auth routes
- Added @iconify-json/simple-icons version 1.2.57 to pnpm-lock.yaml and package.json.
- Changed the sign-up endpoint from '/sign-in/email' to '/sign-up/email' in AuthController.
- Enhanced SocialAuthButtons component with improved styling and accessibility features.
- Updated login page layout and error message presentation for better user experience.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-08 22:37:21 +08:00
Innei
129682d191 feat(auth): update authentication routes and enhance super admin settings management
- Changed the sign-up endpoint to sign-in for email authentication.
- Added a new script to reset the superadmin password during development.
- Refactored super admin settings types to improve flexibility and introduced a new utility for schema form adaptation.
- Streamlined the SuperAdminSettingsForm component to utilize the new schema form adapter for better state management and change detection.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-08 22:19:14 +08:00
Innei
5fe57599d7 feat(errors): add new error codes for internal server errors and reserved tenant slugs
- Introduced COMMON_INTERNAL_SERVER_ERROR and TENANT_SLUG_RESERVED error codes to enhance error handling.
- Updated ERROR_CODE_DESCRIPTORS to include HTTP status and messages for the new error codes.
- Refactored various services and controllers to replace references to SuperAdminSettingService with SystemSettingService for improved consistency and clarity.
- Removed SuperAdminSettingService and its associated types, consolidating functionality into SystemSettingService.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-08 21:36:01 +08:00
Innei
8d0e5dfe6b feat(sdk): consolidate SDK functionality and update dependencies
- Introduced a new SDK package to replace the previous ssr-sdk, consolidating shared functionality for handling views and reactions.
- Updated package.json files across applications to reference the new @afilmory/sdk.
- Removed the old ssr-sdk package and its associated files, streamlining the codebase.
- Enhanced API routes for reactions and views to utilize the new SDK schemas and client methods.
- Updated dependencies in various packages to ensure compatibility and improved functionality.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-08 21:13:02 +08:00