From 3ecd8b8e3211d35d3e5013522c0ff279b5a59b40 Mon Sep 17 00:00:00 2001 From: MauriceNino Date: Wed, 6 Jul 2022 18:17:24 +0200 Subject: [PATCH] feat: add fs type filter to disable invalid storage types --- apps/api/src/config.ts | 1 + apps/api/src/dynamic-info.ts | 7 ++++++- apps/docs/docs/config/index.mdx | 9 +++++++++ libs/common/src/index.ts | 1 + 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/apps/api/src/config.ts b/apps/api/src/config.ts index 56a18e529..d10435b4e 100644 --- a/apps/api/src/config.ts +++ b/apps/api/src/config.ts @@ -16,6 +16,7 @@ export const CONFIG: Config = { running_in_docker: penv('RUNNING_IN_DOCKER') === 'true', accept_ookla_eula: penv('ACCEPT_OOKLA_EULA') === 'true', use_network_interface: penv('USE_NETWORK_INTERFACE') ?? '', + fs_type_filter: lst(penv('FS_TYPE_FILTER') ?? ''), disable_integrations: penv('DISABLE_INTEGRATIONS') === 'true', show_host: penv('SHOW_HOST') === 'true', diff --git a/apps/api/src/dynamic-info.ts b/apps/api/src/dynamic-info.ts index 21ed129e3..f47afe0cb 100644 --- a/apps/api/src/dynamic-info.ts +++ b/apps/api/src/dynamic-info.ts @@ -87,7 +87,12 @@ export const getDynamicServerInfo = () => { } ); - const INVALID_FS_TYPES = ['cifs', '9p', 'fuse.rclone', 'fuse.mergerfs']; + const INVALID_FS_TYPES = [ + 'cifs', + '9p', + 'fuse.rclone', + 'fuse.mergerfs', + ].concat(CONFIG.fs_type_filter); const storageObs = createBufferedInterval( 'Storage', diff --git a/apps/docs/docs/config/index.mdx b/apps/docs/docs/config/index.mdx index c40b1404f..7c2aa450b 100644 --- a/apps/docs/docs/config/index.mdx +++ b/apps/docs/docs/config/index.mdx @@ -34,6 +34,15 @@ If dash. detects the wrong gateway as your default interface, you can provide a - type: `string` - default: `unset` +### `DASHDOT_FS_TYPE_FILTER` + +If dash. detects network drives as internal drives, you can provide a list of ignored FS types here (e.g. `cifs,9p`). +Please also create a [bug ticket](https://github.com/MauriceNino/dashdot/issues/new/choose) on the +repository though, so that we can fix this problem for everyone. + +- type: `string` +- default: `unset` + ### `DASHDOT_DISABLE_INTEGRATIONS` Disables support for integrations. This does two things: disable CORS and disable open API endpoints. diff --git a/libs/common/src/index.ts b/libs/common/src/index.ts index e8de586b8..6eb523d83 100644 --- a/libs/common/src/index.ts +++ b/libs/common/src/index.ts @@ -86,6 +86,7 @@ export type Config = { running_in_docker: boolean; use_network_interface: string; accept_ookla_eula: boolean; + fs_type_filter: string[]; disable_integrations: boolean; show_host: boolean;