Skip to content

File server

Where: Menu → Manage → Knowledge sources → Connectors → Add connector → “File server”

This connector reads documents from Windows file shares (SMB), NFS exports and local folders. A file server is inside your network, where the portal can’t reach it, so this connector always runs at your organisation: on a machine next to the file server, under an account that may only read.

It brings along who may read each file (its NTFS permissions), so people in the Academy find only what they may open on the share.

Step Where Who
A read-only account for the share Active Directory or the file server A Windows or domain administrator
A machine to run the connector on Your network Whoever may run a container or a program there
Add the connector and its sources The Academy, Manage → Knowledge sources An administrator of your organisation
Start the connector That machine Whoever runs it
  1. Create an account (e.g. svc-academy) with read permission on the share, nothing more. The connector reads only; it never writes, moves or deletes.
  2. Choose the machine:
    • Windows (the file server itself or a server next to it): the connector runs with Node.js under that account. Permissions are read with Windows’ own Get-Acl.
    • Linux: the share is mounted (CIFS for SMB, or NFS) and the connector runs as a container or with Node.js. To read NTFS permissions on a CIFS mount, install the package cifs-utils (it brings getcifsacl).
  3. The machine must reach the portal’s API address over HTTPS (port 443, outgoing). No port has to be opened towards your network.
  1. Manage → Knowledge sources, tab Connectors, Add connector.
  2. Kind: “File server”. Where it runs is “At your organisation” (the only choice).
  3. Name: e.g. File server Berlin.
  4. Shared folder: this field says “Set where the connector runs (CONNECTOR_ROOT)”: it is given to the connector in step 3.
  5. Path for people (optional): how people open the share themselves, e.g. \\fileserver\docs. Needed when the connector sees the share under another path (in a container it is /data): links to originals then start with this path, so people can open them. Leave it empty when the connector sees the share as people do.
  6. Read NTFS permissions: on by default. Leave it on so that each file keeps its readers. Off, every file is open to the whole audience of its source.
  7. Click Add. Copy the token from the window Connector token.
  1. Install Node.js 26 or later.

  2. Copy the connector’s file main.js (the platform’s administrators provide it) to e.g. C:\Academy\fileshare\.

  3. Next to it, create connector.json:

    { "settings": { "root": "\\\\fileserver\\docs" } }

    (In JSON every \ is written twice: this is \\fileserver\docs.)

  4. Set the environment variables PORTAL_URL (the address from the token window) and CONNECTOR_TOKEN (the token).

  5. Start it with node main.js. In the Academy it turns Online.

  6. To start it with the machine: Task Scheduler → Create Task → trigger At startup, action node main.js with Start in C:\Academy\fileshare, Run whether user is logged on or not, user svc-academy.

Mount the share read-only into the container as /data, e.g. with Docker Compose:

services:
connector:
image: academy-connector-fileshare
restart: unless-stopped
environment:
PORTAL_URL: https://api.academy.example.com
CONNECTOR_TOKEN: ck_…
CONNECTOR_ROOT: /data
volumes:
- share:/data:ro
volumes:
share:
driver_opts:
type: cifs
device: "//fileserver/docs"
o: "username=svc-academy,password=…,ro,vers=3.0"

For NFS: type: nfs, o: "addr=fileserver,ro", device: ":/export/docs". Then set Path for people in the Academy to \\fileserver\docs, because the container sees the share as /data.

  1. Tab Sources → Add source, choose this connector.
  2. Folder: a folder inside the shared folder, picked with Browse… once the connector is online. Empty means all of the shared folder.
  3. Include (one pattern per line): by default PDF, Word, PowerPoint, Excel, Markdown, text and HTML files. ** means any folders, * any name, {a,b} either.
  4. Leave out: by default Office lock files (~$…) and .tmp files. Add folders you never want read, e.g. **/Personnel/** or **/Payroll/**.
  5. The rest as for every source (see Sources), then Save and Sync now.
  • Nothing outside the shared folder: paths that lead out of it are refused, and symbolic links aren’t followed.
  • Lock, thumbnail and hidden files are skipped.
  • A file server has no change list, so each sync lists the folder again; a file whose size or change time differs from the last sync is read again, the others aren’t.
  • Search the sources live (tab Documents) searches file names on the share, not the content.

With Read NTFS permissions on, each file brings its readers:

  • Everyone, Authenticated Users, Users and Domain Users count as everyone in your organisation.
  • People and groups are matched by their Windows ids (SIDs) when your Active Directory is synced to Microsoft Entra and people sign in with Microsoft.
  • Without Entra, the AD groups appear under Access areas: give each group the teams whose members belong to it.
  • Without Get-Acl (Windows) or getcifsacl (Linux), permissions are unknown: then only the source’s audience (For whom) decides who finds a file.
Message Cause What to do
the shared folder (root) is not set CONNECTOR_ROOT or root in connector.json is missing Set it and restart the connector
… isn’t a folder this connector can reach The path is wrong, the share isn’t mounted, or the account may not read it Open the path on that machine under that account; check the mount
that folder can’t be read The account lacks read permission on that folder Give svc-academy read permission there
that path leads outside the shared folder A source’s folder or a link points out of the shared folder Choose a folder inside it
the file is gone The file was moved or deleted after the sync listed it Nothing; the next sync catches up
Readers stay empty getcifsacl missing (Linux), or Read NTFS permissions off Install cifs-utils; switch the setting on under Settings
Offline The program isn’t running See Connectors