diff --git a/apps/api/src/routes/api/v1/base/index.ts b/apps/api/src/routes/api/v1/base/index.ts index 170a138f3..d631df3d8 100644 --- a/apps/api/src/routes/api/v1/base/index.ts +++ b/apps/api/src/routes/api/v1/base/index.ts @@ -1,31 +1,31 @@ import { FastifyPluginAsync } from 'fastify'; -import { errorHandler, listSettings, version } from '../../../../lib/common'; +import { errorHandler, isARM, listSettings, version } from '../../../../lib/common'; const root: FastifyPluginAsync = async (fastify): Promise => { - fastify.addHook('onRequest', async (request) => { - try { - await request.jwtVerify() - } catch(error) { - return - } - }); - fastify.get('/', async (request) => { - const teamId = request.user?.teamId; - const settings = await listSettings() - try { - return { - ipv4: teamId ? settings.ipv4 : null, - ipv6: teamId ? settings.ipv6 : null, - version, - whiteLabeled: process.env.COOLIFY_WHITE_LABELED === 'true', - whiteLabeledIcon: process.env.COOLIFY_WHITE_LABELED_ICON, - isRegistrationEnabled: settings.isRegistrationEnabled, - } - } catch ({ status, message }) { - return errorHandler({ status, message }) - } - }); - + fastify.addHook('onRequest', async (request) => { + try { + await request.jwtVerify(); + } catch (error) { + return; + } + }); + fastify.get('/', async (request) => { + const teamId = request.user?.teamId; + const settings = await listSettings(); + try { + return { + ipv4: teamId ? settings.ipv4 : null, + ipv6: teamId ? settings.ipv6 : null, + version, + whiteLabeled: process.env.COOLIFY_WHITE_LABELED === 'true', + whiteLabeledIcon: process.env.COOLIFY_WHITE_LABELED_ICON, + isRegistrationEnabled: settings.isRegistrationEnabled, + isARM: isARM(process.arch) + }; + } catch ({ status, message }) { + return errorHandler({ status, message }); + } + }); }; export default root; diff --git a/apps/ui/src/lib/store.ts b/apps/ui/src/lib/store.ts index f779eb1dc..493896c70 100644 --- a/apps/ui/src/lib/store.ts +++ b/apps/ui/src/lib/store.ts @@ -23,7 +23,8 @@ interface AppSession { github: string | null, gitlab: string | null, }, - pendingInvitations: Array + pendingInvitations: Array, + isARM: boolean } interface AddToast { type?: "info" | "success" | "error", @@ -52,7 +53,8 @@ export const appSession: Writable = writable({ github: null, gitlab: null }, - pendingInvitations: [] + pendingInvitations: [], + isARM: false }); export const disabledButton: Writable = writable(false); export const isDeploymentEnabled: Writable = writable(false); diff --git a/apps/ui/src/routes/__layout.svelte b/apps/ui/src/routes/__layout.svelte index f9c41a702..d71367a6c 100644 --- a/apps/ui/src/routes/__layout.svelte +++ b/apps/ui/src/routes/__layout.svelte @@ -75,6 +75,7 @@ $appSession.version = baseSettings.version; $appSession.whiteLabeled = baseSettings.whiteLabeled; $appSession.whiteLabeledDetails.icon = baseSettings.whiteLabeledIcon; + $appSession.isARM = baseSettings.isARM; $appSession.pendingInvitations = pendingInvitations; diff --git a/apps/ui/src/routes/databases/[id]/_Databases/_MySQL.svelte b/apps/ui/src/routes/databases/[id]/_Databases/_MySQL.svelte index 886f1cbd2..5bd94fd85 100644 --- a/apps/ui/src/routes/databases/[id]/_Databases/_MySQL.svelte +++ b/apps/ui/src/routes/databases/[id]/_Databases/_MySQL.svelte @@ -1,6 +1,6 @@