Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion server/models/DiskUsage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type {Disks} from '@shared/types/DiskUsage';
import {isPlatformSupported, diskUsage} from '../util/diskUsageUtil';

import type {SupportedPlatform} from '../util/diskUsageUtil';
import {isAllowedPath} from '../util/fileUtil';

export interface DiskUsageSummary {
id: number;
Expand Down Expand Up @@ -59,7 +60,9 @@ class DiskUsage extends (EventEmitter as new () => TypedEmitter<DiskUsageEvents>
return diskUsage[process.platform as SupportedPlatform](INTERVAL_UPDATE / 2)
.then((disks) => {
// Mountpoints with a very long path are unlikely to be useful.
return disks.filter((disk) => typeof disk.target === 'string' && disk.target.length < 30);
return disks.filter(
(disk) => typeof disk.target === 'string' && (disk.target.length < 30 || isAllowedPath(disk.target)),
);
})
.then((disks) => {
if (disks.length !== this.disks.length || disks.some((d, i) => d.used !== this.disks[i].used)) {
Expand Down