Repository navigation
Custom branding - Add primary color and app name customization - #134
normanalie wants to merge 7 commits into
Conversation
Configure the app name (Default Forkmost) with an env variable.
There was a problem hiding this comment.
This project is currently EOL.
The PR adds the option for a user to load any URL each time they visit a page. If a favicon option were added, I would require it to be downloaded to the server first and served from there.
|
Thanks for opening this PR! Currently this projects reaches EOL, but I am not opposed to merge one or two smaller PRs like this one. Greetings |
For security reasons custom favicon need to be uploaded rather than an URL
|
Yes, absolutely! I changed the favicon customization to use file upload, reusing AvatarIconType and limiting it to 10 KB. The file is stored locally on the server. |
Vito0912
left a comment
There was a problem hiding this comment.
Thank you for the changes!
I left some comments. If you think someone should be the case, please say so.
This is just a first look without actually running it, so maybe I missed some behavior.
|
|
||
| preparedFile.fileName = uuid4() + preparedFile.fileExtension; | ||
| const filePath = `${getAttachmentFolderPath(AttachmentType.WorkspaceFavicon, workspaceId)}/${preparedFile.fileName}`; | ||
| const faviconUrl = `/api/attachments/favicon/${workspaceId}/${preparedFile.fileName}`; |
There was a problem hiding this comment.
Can a workspace have multiple favicons?
I think it would make more sense to have it just as favicon.<> or something like this.
There was a problem hiding this comment.
You're right, I've copied the same logic as avatars but it's not needed for favicon
|
|
||
| type FormValues = z.infer<typeof formSchema>; | ||
|
|
||
| const FAVICON_MAX_SIZE = 100 * 1024; // 100KB |
There was a problem hiding this comment.
Is there a reason why it is 100KB here, but 10KB on the server side?
| const faviconUrl = | ||
| (workspace?.settings as any)?.appearance?.faviconUrl ?? null; | ||
|
|
||
| if (faviconUrl && !faviconUrl.toLowerCase().startsWith('http')) { |
There was a problem hiding this comment.
I know that this is probably because you run the fork for yourself. But as the URL never was introduced I would prefer not to have old handling from before paths
Or do I overlook something and this would have active usage? Also for the other functions?
There was a problem hiding this comment.
Introduced in my previous commit, forgot to remove it when we changed from URL to file upload
| } | ||
|
|
||
| @Public() | ||
| @Get('attachments/favicon/:workspaceId/:fileName') |
There was a problem hiding this comment.
Same here. I think just having attachments/favicon/:workspaceId would make more sense.
This could have caching "issues" if changed, but as it is not cached that long, it should be not that big of a problem
- Removed legacy code from the first implementation of custom favicon. - Update favicon filenaming for simplicity and update the favicon server url
|
JFYI I will review it next weekend. Sorry for the delay! |
|
Sorry, totally forgot. Next weekend. If not by Saturday, please ping me |
This pull request introduces workspace-level branding customization, allowing workspace owners to set a primary theme color and favicon. The changes span both frontend and backend, providing a new settings UI, persisting branding options, and applying them dynamically throughout the app. Additionally, the app name can now be customized via environment variables and is consistently displayed in the UI.
This changes are useful for enterprise use.
Workspace Branding Customization
WorkspaceBrandingFormcomponent to the workspace settings page, allowing workspace owners to update the primary color and favicon URL for their workspace. These settings are validated and persisted, and only owners are permitted to make changes. [1] [2] [3] [4]primaryColor,faviconUrl) and ensured these are available on the workspace object. [1] [2] [3]applyWorkspaceBrandingutility, which dynamically updates CSS variables and favicon links based on workspace settings, ensuring the UI reflects the selected branding.App Name and UI Consistency
APP_NAMEenvironment variable, with a fallback to "Forkmost". Updated all relevant UI components to use the newgetAppNamehelper for consistent branding. [1] [2] [3] [4] [5] [6] [7]Backend Enforcement
primaryColor,faviconUrl).Build and Environment Configuration
.env.exampleto support the newAPP_NAMEenvironment variable, ensuring it is available at build time. [1] [2]Code Quality and Formatting