mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-02-04 17:45:07 +08:00
feat(connector): add Seafile as data source (#12945)
### What problem does this PR solve? This PR adds **Seafile** as a new data source connector for RAGFlow. [Seafile](https://www.seafile.com/) is an open-source, self-hosted file sync and share platform widely used by enterprises, universities, and organizations that require data sovereignty and privacy. Users who store documents in Seafile currently have no way to index and search their content through RAGFlow. This connector enables RAGFlow users to: - Connect to self-hosted Seafile servers via API token - Index documents from personal and shared libraries - Support incremental polling for updated files - Seamlessly integrate Seafile-stored documents into their RAG pipelines ### Type of change - [x] New Feature (non-breaking change which adds functionality) ### Changes included - `SeaFileConnector` implementing `LoadConnector` and `PollConnector` interfaces - Support for API token - Recursive file traversal across libraries - Time-based filtering for incremental updates - Seafile logo (sourced from Simple Icons, CC0) - Connector configuration and registration ### Testing - Tested against self-hosted Seafile Community Edition - Verified authentication (token) - Verified document ingestion from personal and shared libraries - Verified incremental polling with time filters
This commit is contained in:
committed by
GitHub
parent
25bb2e1616
commit
deeae8dba4
1
web/src/assets/svg/data-source/seafile.svg
Normal file
1
web/src/assets/svg/data-source/seafile.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg fill="#FF9800" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Seafile</title><path d="M8.2129 4.2695c-2.003 0-3.623 1.6201-3.623 3.623 0 .0648.0043.1326.0078.2012a2.3767 2.3767 0 0 0-.9727-.205c-1.3369 0-2.418 1.0815-2.418 2.418 0 .0647.0043.1266.0078.1913-.1299-.119-.2995-.1953-.4902-.1953-.4001 0-.7246.321-.7246.7207 0 .4002.3245.713.7246.7207h3.5489c.6808-1.448 2.1364-2.4062 3.8222-2.4062.8177 0 1.5803.2409 2.2285.6445a5.701 5.701 0 0 1 1.5137-2.125c-.0217-1.9847-1.6364-3.5879-3.625-3.5879ZM15.58 7.4063c-2.4965 0-4.5635 1.8477-4.9024 4.2539-.616-.8212-1.5989-1.3536-2.705-1.3536-1.8696 0-3.3829 1.5168-3.3829 3.3829 0 .544.1283 1.0542.3555 1.5117-1.1744.2376-2.045 1.1499-2.045 2.2343 0 1.2683 1.1885 2.295 2.6583 2.295.6482 0 1.2421-.2022 1.7031-.5371l5.4375-5.3457c.6018-.5514 1.4004-.8868 2.2793-.8868 1.8374 0 3.3324 1.4669 3.3828 3.293 0 0-.0004-.0039-.0039-.0039.0287.5405-.2507 1.0839-.7695 1.3828-.7243.418-1.633.196-2.0293-.4922-.3997-.6917-.1364-1.5903.5879-2.0078a1.6117 1.6117 0 0 1 .5254-.1894c-.1551-.0326-.317-.047-.4824-.047-1.333 0-2.418 1.0792-2.418 2.4161 0 1.3365 1.081 2.418 2.418 2.418.0577 0 .1203-.004.1777-.0078l-.004-.006.0685-.0077h4.744v.0176C22.6275 19.6618 24 18.3256 24 16.6973c0-1.668-1.4258-3.0293-3.0938-3.0293h-.0077c-.2703.4827-.5978.764-.9688 1.0664.3889-.7095.6113-1.5182.6113-2.3828-.0083-1.3647-.5622-2.597-1.459-3.4942-.8972-.8972-2.1333-1.4512-3.502-1.4512Z"/></svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
@ -1026,6 +1026,16 @@ Beispiel: Virtual Hosted Style`,
|
||||
'Die Basis-URL Ihrer Moodle-Instanz (z.B. https://moodle.university.edu). Fügen Sie nicht /webservice oder /login hinzu.',
|
||||
moodleTokenTip:
|
||||
'Generieren Sie ein Web-Service-Token in Moodle: Gehen Sie zu Website-Administration → Server → Web-Services → Token verwalten. Der Benutzer muss in den Kursen eingeschrieben sein, die Sie synchronisieren möchten.',
|
||||
seafileDescription:
|
||||
'Verbinden Sie sich mit Ihrem SeaFile-Server, um Dateien und Dokumente aus Ihren Bibliotheken zu synchronisieren.',
|
||||
seafileUrlTip:
|
||||
'Die Basis-URL Ihres SeaFile-Servers (z.B. https://seafile.example.com). Fügen Sie kein /api2 oder andere Pfade hinzu.',
|
||||
seafileTokenTip:
|
||||
'Erstellen Sie ein API-Token in SeaFile: Gehen Sie zu Einstellungen → API-Token → Token erstellen. Das Token ermöglicht den Zugriff auf alle für Ihr Konto sichtbaren Bibliotheken.',
|
||||
seafileIncludeSharedTip:
|
||||
'Wenn aktiviert, werden auch Bibliotheken synchronisiert, die andere Benutzer mit Ihnen geteilt haben.',
|
||||
seafileBatchSizeTip:
|
||||
'Anzahl der Dokumente, die pro Batch verarbeitet werden. Höhere Werte können die Leistung verbessern, benötigen aber mehr Arbeitsspeicher. Standard: 100.',
|
||||
jiraDescription:
|
||||
'Verbinden Sie Ihren Jira-Arbeitsbereich, um Vorgänge, Kommentare und Anhänge zu synchronisieren.',
|
||||
jiraBaseUrlTip:
|
||||
|
||||
@ -998,6 +998,16 @@ Example: Virtual Hosted Style`,
|
||||
'The base URL of your Moodle instance (e.g., https://moodle.university.edu). Do not include /webservice or /login.',
|
||||
moodleTokenTip:
|
||||
'Generate a web service token in Moodle: Go to Site administration → Server → Web services → Manage tokens. The user must be enrolled in the courses you want to sync.',
|
||||
seafileDescription:
|
||||
'Connect to your SeaFile server to sync files and documents from your libraries.',
|
||||
seafileUrlTip:
|
||||
'The base URL of your SeaFile server (e.g., https://seafile.example.com). Do not include /api2 or other paths.',
|
||||
seafileTokenTip:
|
||||
'Generate an API token in SeaFile: Go to Settings → API Token → Generate Token. The token provides access to all libraries visible to your account.',
|
||||
seafileIncludeSharedTip:
|
||||
'When enabled, libraries shared with you by other users will also be synced.',
|
||||
seafileBatchSizeTip:
|
||||
'Number of documents to process per batch. Higher values may improve performance but use more memory. Default: 100.',
|
||||
jiraDescription:
|
||||
'Connect your Jira workspace to sync issues, comments, and attachments.',
|
||||
jiraBaseUrlTip:
|
||||
|
||||
@ -35,6 +35,7 @@ export enum DataSourceKey {
|
||||
GITHUB = 'github',
|
||||
BITBUCKET = 'bitbucket',
|
||||
ZENDESK = 'zendesk',
|
||||
SEAFILE = 'seafile',
|
||||
// SHAREPOINT = 'sharepoint',
|
||||
// SLACK = 'slack',
|
||||
// TEAMS = 'teams',
|
||||
@ -155,6 +156,11 @@ export const generateDataSourceInfo = (t: TFunction) => {
|
||||
description: t(`setting.${DataSourceKey.ZENDESK}Description`),
|
||||
icon: <SvgIcon name={'data-source/zendesk'} width={38} />,
|
||||
},
|
||||
[DataSourceKey.SEAFILE]: {
|
||||
name: 'SeaFile',
|
||||
description: t(`setting.${DataSourceKey.SEAFILE}Description`),
|
||||
icon: <SvgIcon name={'data-source/seafile'} width={38} />,
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
@ -815,6 +821,39 @@ export const DataSourceFormFields = {
|
||||
],
|
||||
},
|
||||
],
|
||||
[DataSourceKey.SEAFILE]: [
|
||||
{
|
||||
label: 'SeaFile Server URL',
|
||||
name: 'config.seafile_url',
|
||||
type: FormFieldType.Text,
|
||||
required: true,
|
||||
placeholder: 'https://seafile.example.com',
|
||||
tooltip: t('setting.seafileUrlTip'),
|
||||
},
|
||||
{
|
||||
label: 'API Token',
|
||||
name: 'config.credentials.seafile_token',
|
||||
type: FormFieldType.Password,
|
||||
required: true,
|
||||
tooltip: t('setting.seafileTokenTip'),
|
||||
},
|
||||
{
|
||||
label: 'Include Shared Libraries',
|
||||
name: 'config.include_shared',
|
||||
type: FormFieldType.Checkbox,
|
||||
required: false,
|
||||
defaultValue: true,
|
||||
tooltip: t('setting.seafileIncludeSharedTip'),
|
||||
},
|
||||
{
|
||||
label: 'Batch Size',
|
||||
name: 'config.batch_size',
|
||||
type: FormFieldType.Number,
|
||||
required: false,
|
||||
placeholder: '100',
|
||||
tooltip: t('setting.seafileBatchSizeTip'),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const DataSourceFormDefaultValues = {
|
||||
@ -1096,4 +1135,17 @@ export const DataSourceFormDefaultValues = {
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
[DataSourceKey.SEAFILE]: {
|
||||
name: '',
|
||||
source: DataSourceKey.SEAFILE,
|
||||
config: {
|
||||
seafile_url: '',
|
||||
include_shared: true,
|
||||
batch_size: 100,
|
||||
credentials: {
|
||||
seafile_token: '',
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user