fix: root user for dbs on arm
This commit is contained in:
parent
06d40b8a81
commit
a70adc5eb3
@ -1,17 +1,17 @@
|
|||||||
import { FastifyPluginAsync } from 'fastify';
|
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<void> => {
|
const root: FastifyPluginAsync = async (fastify): Promise<void> => {
|
||||||
fastify.addHook('onRequest', async (request) => {
|
fastify.addHook('onRequest', async (request) => {
|
||||||
try {
|
try {
|
||||||
await request.jwtVerify()
|
await request.jwtVerify();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
fastify.get('/', async (request) => {
|
fastify.get('/', async (request) => {
|
||||||
const teamId = request.user?.teamId;
|
const teamId = request.user?.teamId;
|
||||||
const settings = await listSettings()
|
const settings = await listSettings();
|
||||||
try {
|
try {
|
||||||
return {
|
return {
|
||||||
ipv4: teamId ? settings.ipv4 : null,
|
ipv4: teamId ? settings.ipv4 : null,
|
||||||
@ -20,12 +20,12 @@ const root: FastifyPluginAsync = async (fastify): Promise<void> => {
|
|||||||
whiteLabeled: process.env.COOLIFY_WHITE_LABELED === 'true',
|
whiteLabeled: process.env.COOLIFY_WHITE_LABELED === 'true',
|
||||||
whiteLabeledIcon: process.env.COOLIFY_WHITE_LABELED_ICON,
|
whiteLabeledIcon: process.env.COOLIFY_WHITE_LABELED_ICON,
|
||||||
isRegistrationEnabled: settings.isRegistrationEnabled,
|
isRegistrationEnabled: settings.isRegistrationEnabled,
|
||||||
}
|
isARM: isARM(process.arch)
|
||||||
|
};
|
||||||
} catch ({ status, message }) {
|
} catch ({ status, message }) {
|
||||||
return errorHandler({ status, message })
|
return errorHandler({ status, message });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default root;
|
export default root;
|
||||||
|
@ -23,7 +23,8 @@ interface AppSession {
|
|||||||
github: string | null,
|
github: string | null,
|
||||||
gitlab: string | null,
|
gitlab: string | null,
|
||||||
},
|
},
|
||||||
pendingInvitations: Array<any>
|
pendingInvitations: Array<any>,
|
||||||
|
isARM: boolean
|
||||||
}
|
}
|
||||||
interface AddToast {
|
interface AddToast {
|
||||||
type?: "info" | "success" | "error",
|
type?: "info" | "success" | "error",
|
||||||
@ -52,7 +53,8 @@ export const appSession: Writable<AppSession> = writable({
|
|||||||
github: null,
|
github: null,
|
||||||
gitlab: null
|
gitlab: null
|
||||||
},
|
},
|
||||||
pendingInvitations: []
|
pendingInvitations: [],
|
||||||
|
isARM: false
|
||||||
});
|
});
|
||||||
export const disabledButton: Writable<boolean> = writable(false);
|
export const disabledButton: Writable<boolean> = writable(false);
|
||||||
export const isDeploymentEnabled: Writable<boolean> = writable(false);
|
export const isDeploymentEnabled: Writable<boolean> = writable(false);
|
||||||
|
@ -75,6 +75,7 @@
|
|||||||
$appSession.version = baseSettings.version;
|
$appSession.version = baseSettings.version;
|
||||||
$appSession.whiteLabeled = baseSettings.whiteLabeled;
|
$appSession.whiteLabeled = baseSettings.whiteLabeled;
|
||||||
$appSession.whiteLabeledDetails.icon = baseSettings.whiteLabeledIcon;
|
$appSession.whiteLabeledDetails.icon = baseSettings.whiteLabeledIcon;
|
||||||
|
$appSession.isARM = baseSettings.isARM;
|
||||||
|
|
||||||
$appSession.pendingInvitations = pendingInvitations;
|
$appSession.pendingInvitations = pendingInvitations;
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
export let database: any;
|
export let database: any;
|
||||||
import { status } from '$lib/store';
|
import { status, appSession } from '$lib/store';
|
||||||
import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';
|
import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';
|
||||||
import { t } from '$lib/translations';
|
import { t } from '$lib/translations';
|
||||||
import Explainer from '$lib/components/Explainer.svelte';
|
import Explainer from '$lib/components/Explainer.svelte';
|
||||||
@ -56,7 +56,7 @@
|
|||||||
placeholder={$t('forms.generated_automatically_after_start')}
|
placeholder={$t('forms.generated_automatically_after_start')}
|
||||||
id="rootUser"
|
id="rootUser"
|
||||||
name="rootUser"
|
name="rootUser"
|
||||||
value={database.rootUser}
|
value={$appSession.isARM ? 'root' : database.rootUser}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="grid grid-cols-2 items-center">
|
<div class="grid grid-cols-2 items-center">
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
export let database: any;
|
export let database: any;
|
||||||
import { status } from '$lib/store';
|
import { status, appSession } from '$lib/store';
|
||||||
import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';
|
import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';
|
||||||
import { t } from '$lib/translations';
|
import { t } from '$lib/translations';
|
||||||
import Explainer from '$lib/components/Explainer.svelte';
|
import Explainer from '$lib/components/Explainer.svelte';
|
||||||
@ -22,6 +22,7 @@
|
|||||||
bind:value={database.defaultDatabase}
|
bind:value={database.defaultDatabase}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
{#if !$appSession.isARM}
|
||||||
<div class="grid grid-cols-2 items-center">
|
<div class="grid grid-cols-2 items-center">
|
||||||
<label for="rootUser"
|
<label for="rootUser"
|
||||||
>Postgres User Password <Explainer
|
>Postgres User Password <Explainer
|
||||||
@ -38,6 +39,7 @@
|
|||||||
bind:value={database.rootUserPassword}
|
bind:value={database.rootUserPassword}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
{/if}
|
||||||
<div class="grid grid-cols-2 items-center">
|
<div class="grid grid-cols-2 items-center">
|
||||||
<label for="dbUser">{$t('forms.user')}</label>
|
<label for="dbUser">{$t('forms.user')}</label>
|
||||||
<CopyPasswordField
|
<CopyPasswordField
|
||||||
|
Loading…
x
Reference in New Issue
Block a user