|
1 | | -# Conduit Connector Template |
| 1 | +# Conduit Connector SFTP |
2 | 2 |
|
3 | | -This is a template project for building [Conduit](https://conduit.io) connectors in Go. It makes it possible to |
4 | | -start working on a Conduit connector in a matter of seconds. |
| 3 | +The SFTP connector is one of [Conduit](https://github.com/ConduitIO/conduit) plugins. It |
| 4 | +provides both, a source and a destination SFTP connector. |
5 | 5 |
|
6 | | -## Quick start |
| 6 | +## How to build it |
7 | 7 |
|
8 | | -1. Click [_Use this template_](https://github.com/new?template_name=conduit-connector-template&template_owner=ConduitIO) and clone your new repository. |
9 | | -2. Initialize the repository using [`setup.sh`](https://github.com/ConduitIO/conduit-connector-template/blob/main/setup.sh) and commit your changes. |
10 | | - ```sh |
11 | | - ./setup.sh github.com/myusername/conduit-connector-myconnector |
12 | | - git add -A |
13 | | - git commit -m "initialize repository" |
14 | | - ``` |
15 | | -3. Set up [automatic Dependabot PR merges](#automatically-merging-dependabot-prs). |
| 8 | +Run `make build`. |
16 | 9 |
|
17 | | -With that, you're all set up and ready to start working on your connector! As a next step, we recommend that you |
18 | | -check out the [Conduit Connector SDK](https://github.com/ConduitIO/conduit-connector-sdk). |
| 10 | +## Testing |
19 | 11 |
|
20 | | -## What's included? |
| 12 | +Run `make test` to run all the unit and integration tests. |
21 | 13 |
|
22 | | -* Skeleton code for the connector's configuration, source and destination. |
23 | | -* Example unit tests. |
24 | | -* A [Makefile](/Makefile) with commonly used targets. |
25 | | -* A [GitHub workflow](/.github/workflows/test.yml) to build the code and run the tests. |
26 | | -* A [GitHub workflow](/.github/workflows/lint.yml) to run a pre-configured set of linters. |
27 | | -* A [GitHub workflow](/.github/workflows/release.yml) which automatically creates a release when a tag is pushed. |
28 | | -* A [Dependabot setup](/.github/dependabot.yml) which checks your dependencies for available updates and |
29 | | -[merges minor version upgrades](/.github/workflows/dependabot-auto-merge-go.yml) automatically. |
30 | | -* [Issue](/.github/ISSUE_TEMPLATE) and [PR templates](/.github/pull_request_template.md). |
31 | | -* A [README template](/README_TEMPLATE.md). |
| 14 | +## Source |
32 | 15 |
|
33 | | -## Automatically merging Dependabot PRs |
| 16 | +The source SFTP connector monitors a directory on an SFTP server for files matching a specified pattern. It reads these files and converts them into `opencdc.Record` that can be processed by Conduit. For handling large files, it splits them into smaller chunks, enabling smooth data handling through the Conduit pipeline. |
| 17 | +The connector supports both password and private key authentication methods. |
34 | 18 |
|
35 | | -> [!NOTE] |
36 | | -> This applies only to public connector repositories, as branch protection rules are not enforced in private repositories. |
| 19 | +### Configuration Options |
37 | 20 |
|
38 | | -The template makes it simple to keep your connector up-to-date using automatic merging of |
39 | | -[Dependabot](https://github.com/dependabot) PRs. To make use of this setup, you need to adjust |
40 | | -some repository settings. |
| 21 | +| name | description | required | default value | |
| 22 | +| -------------- | ----------------------------------------------------------------------------------------------------- | -------- | -------- | |
| 23 | +| `address` | Address is the address of the sftp server to connect.| **true** | | |
| 24 | +| `hostKey` | HostKey is the key used for host key callback validation.| **true** | | |
| 25 | +| `username`| User is the username of the SFTP user. | **true** | | |
| 26 | +| `password`| Password is the SFTP password (can be used as passphrase for private key). | false | | |
| 27 | +| `privateKeyPath`| PrivateKeyPath is the private key for ssh login.| false | | |
| 28 | +| `directoryPath` | DirectoryPath is the path to the directory to read data. | **true** | | |
| 29 | +| `filePattern` | Pattern to match files that should be read (e.g., "*.txt") | false | `*` | |
| 30 | +| `fileChunkSizeBytes` | Maximum size of a file chunk in bytes to split large files. | false | `3145728` | |
41 | 31 |
|
42 | | -1. Navigate to Settings -> General and allow auto-merge of PRs. |
| 32 | +## Destination |
43 | 33 |
|
44 | | -  |
| 34 | +### Configuration Options |
45 | 35 |
|
46 | | -2. Navigate to Settings -> Branches and add a branch protection rule. |
47 | | - |
48 | | -  |
49 | | - |
50 | | -3. Create a rule for branch `main` that requires status checks `build` and `golangci-lint`. |
51 | | - |
52 | | -  |
53 | | - |
54 | | -## Recommended repository settings |
55 | | - |
56 | | -- Allow squash merging only. |
57 | | -- Always suggest updating pull request branches. |
58 | | -- Automatically delete head branches. |
59 | | -- Branch protection rules on branch `main` (only in public repositories): |
60 | | - - Require a pull request before merging. |
61 | | - - Require approvals. |
62 | | - - Require status checks `build` and `golangci-lint`. |
63 | | - - Require branches to be up to date before merging. |
64 | | - - Require conversation resolution before merging. |
65 | | - - Do not allow bypassing the above settings. |
| 36 | + |
0 commit comments