FileSync Plugin
Adds a filesync repository type that copies source from a local directory or a Windows SMB/UNC share into Codumentor's repos directory before ingestion. Use it when the code lives on a shared drive rather than a Git host.
SMB/UNC support uses the smbprotocol package, which is part of the Codumentor install.
Configuration
Register the plugin (no args are required):
plugins:
- module: codumentor.plugins.filesync
class: FileSyncPlugin
Optional plugin args:
| Key | Type | Default | Description |
|---|---|---|---|
target_root | string | the instance repos_dir | Base directory that synced repos are copied into |
Declare repositories with scm: filesync:
repos:
- name: my-project
scm: filesync
path: /mnt/shared/projects/my-project
- name: legacy-app
scm: filesync
path: "\\\\fileserver\\projects\\legacy-app"
options:
username: "domain\\user"
password: "${SMB_PASSWORD}"
- name: another-app
scm: filesync
path: "smb://fileserver/projects/another-app"
options:
username: user
password: "${SMB_PASSWORD}"
clear_target: false
Repository fields
| Field | Type | Default | Description |
|---|---|---|---|
path | string | — | Source directory, UNC path (\\server\share\...), or smb://server/share/... URL. ${ENV_VAR} expansion is supported. |
options.username | string | — | SMB username (${ENV_VAR} expansion supported) |
options.password | string | — | SMB password (${ENV_VAR} expansion supported) |
options.clear_target | bool | true | Delete the destination before copying. Set false to keep files that were removed from the source. |
options.target_dir | string | <repos_dir>/<name> | Override the destination path |
Behaviour
On ingestion, each filesync repo is copied from the source to the target, then ingested from that local copy. Both a directory and a single file are accepted as the source.
Local paths, \\server\share\path UNC paths, and smb://server/share/path URLs all work. Credentials, when given, are used for the SMB server in the path.