Commit Graph

378 Commits

Author SHA1 Message Date
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
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
5cae9431c0 refactor(config): simplify default builder configuration and enforce storage requirement
- Removed unnecessary fields from the default builder configuration, including repository and storage settings.
- Set storage to null to enforce configuration validation.
- Updated loadBuilderConfig to ensure storage configuration is provided, throwing an error if missing.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-09 23:17:24 +08:00
Innei
7be611cc83 refactor(docker): update Dockerfile to use lts-alpine and streamline build process
- Changed base image for both builder and runner stages to node:lts-alpine for improved performance and reduced image size.
- Removed hardcoded NODE_VERSION argument to simplify the Dockerfile.
- Updated package installation command to use 'apk add' for consistency.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-09 23:00:03 +08:00
Innei
017cd7635c feat(docker): add Dockerfile for core application build and production setup
- Introduced a new Dockerfile to streamline the build process for the core application.
- Configured multi-stage builds to optimize image size and separate build dependencies from production.
- Included installation of necessary packages and setup for the web and dashboard applications.
- Ensured proper copying of built assets to the production image for deployment.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-09 22:56:04 +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