schedule Published: October 17, 2024
update Last updated: October 17, 2024

What are Sources?

Sources are the directories that FileBrowser Quantum makes available to users. Each source represents a filesystem path that can be browsed, searched, and managed through the web interface.

Source Basics

Unique Paths Required

Each source must have a unique real filesystem path. FileBrowser uses the actual resolved path on the filesystem to identify sources internally, not the name you assign.

YAML
1
2
3
4
sources:
  - path: "/data"        # ✅ Valid
  - path: "/mnt/storage" # ✅ Valid - different path
  - path: "/data"        # ❌ Invalid - duplicate path

Source Names

Automatic naming: If you don’t specify a name, FileBrowser automatically assigns one based on the base folder name.

YAML
1
2
3
sources:
  - path: "/mnt/documents"  # Name: "documents"
  - path: "/data/photos"    # Name: "photos"

Custom naming: You can specify a custom display name:

YAML
1
2
3
sources:
  - path: "/mnt/documents"
    name: "Company Files"   # Custom name

Minimal Configuration

The simplest source configuration (same structure as server.sources in the generated reference config.generated.yaml):

YAML
1
2
3
4
5
server:
  sources:
    - path: "/data"
      config:
        defaultEnabled: true

This creates a source that:

  • Is available to all new users
  • Has indexing enabled for advanced features
  • Uses all default settings

Reference: config and rules

The generated config lists every supported key. Under config, non-deprecated fields are:

FieldPurpose
denyByDefaultDeny access unless an allow rule exists
privateNo sharing for this source
disabledTemporarily disable the source in config
rulesPer-path indexing and visibility rules (see Conditional Rules)
defaultUserScopeInitial path scope for new users (under path)
defaultEnabledAdd this source to new users by default
useLogicalSizeUse logical file sizes instead of disk usage (du-style); empty folders report as 0 bytes

Example rules entry (field names match the generator):

YAML
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
server:
  sources:
    - path: "/data"
      name: "My Files"
      config:
        defaultEnabled: true
        rules:
          - neverWatchPath: ""
            includeRootItem: ""
            fileStartsWith: ""
            folderStartsWith: ""
            fileEndsWith: ""
            folderEndsWith: ""
            folderPath: ""
            filePath: ""
            fileName: ""
            folderName: ""
            viewable: false
            ignoreHidden: false
            ignoreZeroSizeFolders: false
            ignoreSymlinks: false

Indexing Overview

Sources are indexed by default, which enables:

  • Search functionality - Fast full-text and filename search
  • Folder size calculations - Accurate directory size reporting
  • Folder previews - Thumbnail previews for image directories
  • Health monitoring - Source statistics and health information

Performance: Indexing uses adaptive scanning intervals based on filesystem complexity. For typical filesystems (under 50,000 items), expect scan times under 30 seconds with minimal memory usage (100-300MB). Larger filesystems may require more resources but benefit from smart interval adjustments that reduce scan frequency.

For detailed indexing information, see Understanding Indexing.

Configuration Options

path (required)

YAML
1
path: "/data"

The filesystem path to the directory you want to serve. Can be absolute or relative, but must exist and be readable by FileBrowser.

name

YAML
1
name: "My Files"

Display name shown in the UI. If not specified, uses the base folder name from the path. Useful for providing user-friendly names like “Company Files” instead of just “documents”.

defaultEnabled

YAML
1
2
config:
  defaultEnabled: true

Whether new users automatically get access to this source. Defaults to false. Set to true for shared sources that all users should see.

denyByDefault

YAML
1
2
config:
  denyByDefault: true

Deny access unless an explicit “allow” access rule exists. Defaults to false. Use this for high-security sources where access must be explicitly granted per user or group.

See Access Control Guide for more information.

private

YAML
1
2
config:
  private: true

Designate source as private, which disables sharing. Defaults to false. Use this to prevent users from creating public shares for sensitive data.

useLogicalSize

YAML
1
2
config:
  useLogicalSize: true

When true, sizes follow logical file size instead of on-disk allocation (similar intent to du). Empty folders report as 0 bytes. Default is false.

defaultUserScope

YAML
1
2
config:
  defaultUserScope: "/subfolder"

Default scope path for new users created automatically via API or CLI. Defaults to "/" (root of source). This restricts where new users can access within the source. Include the leading slash.

Example placing users under a subfolder of the source:

YAML
1
2
3
4
5
sources:
  - path: "/shared"
    config:
      defaultUserScope: "/users"
      defaultEnabled: true

New users are scoped under /shared/users (and receive a per-user directory there when applicable).

createUserDir (deprecated)

YAML
1
2
config:
  defaultUserScope: "/home"

Creates /home/john for user john under the source path and scopes the user there.

disabled

YAML
1
2
config:
  disabled: true

Disable the source without removing it from config. Defaults to false. Useful for temporarily disabling a source for maintenance or testing. Users cannot access disabled sources.

disableIndexing (deprecated)

When indexing is effectively off for a source, these features do not work:

  • Search
  • Folder size calculations
  • Folder preview images
  • Source statistics / health

Users may still browse files with reduced functionality.

indexingIntervalMinutes (deprecated)

conditionals (deprecated)

Common Configuration Patterns

Single Shared Source

Use case: Simple shared file access

YAML
1
2
3
4
sources:
  - path: "/data"
    config:
      defaultEnabled: true

Multi-User with Personal Directories

Use case: Each user gets private space

YAML
1
2
3
4
5
sources:
  - path: "/home"
    config:
      defaultEnabled: true
      defaultUserScope: "/"

Departmental Sources

Use case: Multiple departments with access control

YAML
1
2
3
4
5
sources:
  - path: "/dept/sales"
    name: "Sales"
  - path: "/dept/engineering"
    name: "Engineering"

Use access rules to control who sees what.

Mixed Public/Private

Use case: Some sources public, others restricted

YAML
1
2
3
4
5
6
7
8
sources:
  - path: "/public"
    config:
      defaultEnabled: true
  - path: "/private"
    config:
      denyByDefault: true
      private: true

Best Practices

  1. Start Simple - Begin with minimal configuration and add options as needed
  2. Use Real Paths - Always use absolute paths for production deployments
  3. Plan Access Control - Design your access strategy before creating multiple sources
  4. Monitor Resources - Watch memory/CPU usage after adding sources with large filesystems

Next Steps