mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-15 09:46:19 +01:00
♻️ Remove the checks for mounts
This commit is contained in:
@@ -15,9 +15,6 @@ import { getTotalUserCountAsync } from '~/server/db/queries/user';
|
|||||||
import { getConfig } from '~/tools/config/getConfig';
|
import { getConfig } from '~/tools/config/getConfig';
|
||||||
import { getServerSideTranslations } from '~/tools/server/getServerSideTranslations';
|
import { getServerSideTranslations } from '~/tools/server/getServerSideTranslations';
|
||||||
|
|
||||||
const util = require('util');
|
|
||||||
const exec = util.promisify(require('child_process').exec);
|
|
||||||
|
|
||||||
export default function OnboardPage({
|
export default function OnboardPage({
|
||||||
configSchemaVersions,
|
configSchemaVersions,
|
||||||
databaseNotWriteable,
|
databaseNotWriteable,
|
||||||
@@ -123,43 +120,6 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
Consola.info('Database is writeable');
|
Consola.info('Database is writeable');
|
||||||
|
|
||||||
if (process.platform !== 'win32') {
|
|
||||||
try {
|
|
||||||
const { stdout, stderr } = await exec("mount | grep '/data'");
|
|
||||||
|
|
||||||
if (stderr.split('\n').length > 1 || stdout.split('\n').length <= 1) {
|
|
||||||
Consola.error(
|
|
||||||
`Database at '${rawDatabaseUrl}' has not been mounted: ${stdout.replace(
|
|
||||||
'\n',
|
|
||||||
'\\n'
|
|
||||||
)} ${stderr.replace('\n', '\\n')}`
|
|
||||||
);
|
|
||||||
return {
|
|
||||||
props: {
|
|
||||||
...translations,
|
|
||||||
configSchemaVersions: configSchemaVersions,
|
|
||||||
databaseNotWriteable: true,
|
|
||||||
errorMessage: `Database at '${rawDatabaseUrl}' is not mounted:\n${stdout}`,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
const errorMessage = `Database at '${rawDatabaseUrl}' has not been mounted: ${error}`;
|
|
||||||
Consola.error(errorMessage);
|
|
||||||
return {
|
|
||||||
props: {
|
|
||||||
...translations,
|
|
||||||
configSchemaVersions: configSchemaVersions,
|
|
||||||
databaseNotWriteable: true,
|
|
||||||
stringifiedError: JSON.stringify(error),
|
|
||||||
errorMessage: errorMessage,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Consola.info(`Database at '${rawDatabaseUrl}' is writeable and mounted`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import {
|
|||||||
} from '@mantine/core';
|
} from '@mantine/core';
|
||||||
import { createFormContext } from '@mantine/form';
|
import { createFormContext } from '@mantine/form';
|
||||||
import { IconArrowLeft } from '@tabler/icons-react';
|
import { IconArrowLeft } from '@tabler/icons-react';
|
||||||
import { changeLanguage } from 'i18next';
|
|
||||||
import { GetServerSideProps } from 'next';
|
import { GetServerSideProps } from 'next';
|
||||||
import { useTranslation } from 'next-i18next';
|
import { useTranslation } from 'next-i18next';
|
||||||
import Head from 'next/head';
|
import Head from 'next/head';
|
||||||
@@ -74,6 +73,7 @@ const SettingsComponent = ({
|
|||||||
label: language.originalName,
|
label: language.originalName,
|
||||||
description: language.translatedName,
|
description: language.translatedName,
|
||||||
value: language.shortName,
|
value: language.shortName,
|
||||||
|
country: language.country,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const { t, i18n } = useTranslation(['user/preferences', 'common']);
|
const { t, i18n } = useTranslation(['user/preferences', 'common']);
|
||||||
|
|||||||
Reference in New Issue
Block a user