FileBrowser Quantum Documentation

repository·main·Indexed 26 days ago

https://github.com/gtsteffaniak/filebrowser

A self-hosted, web-based file manager and feature-enhanced fork of the original FileBrowser project. It includes advanced authentication (OIDC, LDAP, JWT, 2FA), multi-source configuration via config.yaml, high-performance SQLite indexed search, and granular sharing options. The system provides a Swagger API at the /swagger endpoint and supports rich media thumbnails for office documents, video, and 3D models.

Tokens
12.1K
Snippets
22
Records
73
Agent score
93%

What's inside FileBrowser Quantum

  1. Overview of FileBrowser Quantum features

    main

    FileBrowser Quantum is a feature-rich fork of the original file browser project. Key capabilities include:

    • Advanced Configuration: Support for multiple sources with include/exclude rules via config.yaml.
    • Enhanced Authentication: Support for OIDC, LDAP, JWT, password + 2FA, and proxy login.
    • High-Performance Search: Ultra-efficient SQLite indexing providing real-time search results, file/folder size filtering, and real-time UI updates.
    • Rich Media Support: Thumbnails for office documents, video, album artwork, and 3D models.
    • Granular Sharing: Highly configurable sharing options including expiration times, access control (anonymous or specific users), and permission settings (view, edit, upload).
    • Access Control: Directory-level access control scoped to users or groups.
    • Developer Tools: Support for long-lived API Tokens and a built-in Swagger API documentation page available at the /swagger endpoint.
  2. Deploy Filebrowser with JWT configuration

    main

    To run Filebrowser using JWT authentication, use the filebrowser-jwt service. This service uses a slim Docker image and requires mounting the frontend directory and a specific config.yaml located in ./src/jwt/backend/ to the container's data directory.

    filebrowser-jwt:
      hostname: filebrowser
      volumes:
        - '../frontend:/home/frontend'
        - "./src/jwt/backend/config.yaml:/home/filebrowser/data/config.yaml"
      build:
        context: ../
        dockerfile: ./_docker/Dockerfile.slim
  3. Deploy standard Filebrowser

    main

    The standard filebrowser service uses a slim Docker image. It requires mounting the frontend directory and a config.yaml from ./src/proxy/backend/ to the container's data directory.

    filebrowser:
      hostname: filebrowser
      volumes:
        - '../frontend:/home/frontend'
        - "./src/proxy/backend/config.yaml:/home/filebrowser/data/config.yaml"
      build:
        context: ../
        dockerfile: ./_docker/Dockerfile.slim
  4. Run Playwright local testing environment

    main

    You can use the local-playwright and local-playwright-screenshots services to run Playwright tests locally. The local-playwright-screenshots service is configured to start the filebrowser, wait for it to be ready, and then execute Playwright tests for both dark-screenshots and light-screenshots projects. It maps the generated frontend files to the host for inspection.

    services:
      local-playwright:
        container_name: local-playwright
        ports:
          - "8080:8080"
        build:
          dockerfile: ./_docker/Dockerfile.playwright-local
          context: ../
      local-playwright-screenshots:
        container_name: local-playwright
        volumes:
          - ../frontend/generated:/app/frontend/generated
        entrypoint: ["/bin/sh", "-c", "./filebrowser & sleep 2 && cd ../frontend && npx playwright test --project dark-screenshots && npx playwright test --project light-screenshots"]
        build:
          dockerfile: ./_docker/Dockerfile.playwright-local
          context: ../
  5. Initialize FileBrowser configuration with setup

    main

    Run the setup command to start an interactive configuration wizard. This wizard will prompt you for:

    • The source filesystem path to manage.
    • The name of the first source.
    • The server listening port.
    • Logging levels (e.g., info|warning|error).
    • The database file path (must end in .db).
    • The application brand name.
    • Default admin credentials.
    • Default permissions for new users (modify content, create shares).

    The wizard generates a config.yaml file. If a database file already exists at the specified path, you will be asked if you want to move it to a .bak file to start fresh.

  6. Access the FileBrowser Quantum API documentation

    main

    For developers building integrations or using API tokens, FileBrowser Quantum provides a Swagger UI page to explore and test the API. Once the application is running, navigate to the following endpoint:

    /swagger

  7. Configure vue-i18n ESLint settings

    main

    The project uses @intlify/eslint-plugin-vue-i18n to enforce internationalization best practices. You can configure the locale directory, message syntax version, and specific rules for missing or unused keys.

    Key configuration options:

    • settings['vue-i18n'].localeDir: Path to the locale JSON file (e.g., src/i18n/en.json).
    • settings['vue-i18n'].messageSyntaxVersion: The version of the message syntax (e.g., ^11.0.0).
    • @intlify/vue-i18n/no-unused-keys: Can be configured with src, extensions, and ignores to define where to look for usage.
    • @intlify/vue-i18n/no-raw-text: Can be configured with ignoreNodes to allow specific HTML elements (like i or v-icon) to contain raw text.
    {
      settings: {
        "vue-i18n": {
          localeDir: "src/i18n/en.json",
          messageSyntaxVersion: "^11.0.0",
        },
      },
      rules: {
        "@intlify/vue-i18n/no-missing-keys": "error",
        "@intlify/vue-i18n/no-unused-keys": ["error", {
          src: "./src",
          extensions: [".js", ".vue", ".ts"],
          ignores: ["/^languages\\./"],
        }],
        "@intlify/vue-i18n/no-raw-text": ["error", {
          ignoreNodes: ["i", "v-icon"],
        }],
        "@intlify/vue-i18n/no-missing-keys-in-other-locales": "warn",
      },
    }
  8. Configure Playwright for proxy frontend testing

    main

    The Playwright configuration for the proxy frontend tests is located in _docker/src/proxy/frontend/playwright.config.ts. It defines the test directory, global setup, and execution parameters.

    Key execution settings:

    • testDir: Set to ./tests/playwright/proxy.
    • globalSetup: Uses ./tests/playwright/proxy-setup.ts.
    • timeout: 10000ms.
    • workers: Currently restricted to 1 to avoid parallelism issues.
    • retries: Set to 3.
    • reporter: Uses the line reporter.
    • fullyParallel: Set to false.
    import { defineConfig, devices } from "@playwright/test";
    
    export default defineConfig({
      globalSetup: "./tests/playwright/proxy-setup.ts",
      timeout: 10000,
      testDir: "./tests/playwright/proxy",
      fullyParallel: false,
      forbidOnly: false,
      retries: 3,
      workers: 1,
      reporter: "line",
      use: {
        actionTimeout: 5000,
        storageState: "loginAuth.json",
        baseURL: "http://127.0.0.1",
        trace: "on-first-retry",
        locale: "en-US",
      },
      projects: [
        {
          name: "firefox",
          use: { ...devices["Desktop Firefox"] },
        },
      ],
    });
  9. Configure Playwright `use` options for no-config frontend

    main

    The use object in the Playwright configuration defines shared settings for all test projects. For the no-config frontend, the following options are configured:

    • actionTimeout: Maximum time for individual actions (e.g., clicks) is 5000ms.
    • storageState: Uses loginAuth.json to persist authentication state across tests.
    • baseURL: The base URL for navigation (e.g., await page.goto('/')) is http://127.0.0.1/.
    • trace: Captures traces on-first-retry to assist in debugging failed tests.
    • locale: Sets the default locale to en-US.
    use: {
      actionTimeout: 5000,
      storageState: "loginAuth.json",
      baseURL: "http://127.0.0.1/",
      trace: "on-first-retry",
      locale: "en-US",
    }
  10. Configure global variables for JS, TS, and Vue files

    main

    The ESLint configuration defines several global variables that are available in .js, .ts, and .vue files. These are marked as readonly to prevent accidental overwriting.

    Available globals:

    • router
    • $t
    • next
    • downloadFiles
    • Standard Node, Browser, and ES2022 globals.
    {
      files: ["**/*.js", "**/*.ts", "**/*.vue"],
      languageOptions: {
        globals: {
          ...globals.node,
          ...globals.browser,
          ...globals.es2022,
          globalVars: "readonly",
          router: "readonly",
          $t: "readonly",
          next: "readonly",
          downloadFiles: "readonly",
        },
      },
    }
  11. Configure Playwright for screenshot testing

    main

    The Playwright configuration for this project is optimized for screenshot testing. It defines a global setup for screenshots, a default timeout of 5000ms, and targets the ./tests/playwright/screenshots directory. It uses loginAuth.json as the storageState to maintain authentication across tests and targets http://localhost:8080 as the baseURL.

    export default defineConfig({
      globalSetup: "./tests/playwright/screenshots-setup.ts",
      timeout: 5000,
      testDir: "./tests/playwright/screenshots",
      use: {
        actionTimeout: 5000,
        storageState: "loginAuth.json",
        baseURL: "http://localhost:8080",
        trace: "on-first-retry",
        locale: "en-US",
      },
    });