feat: add SFTP monitor type with password and private key authentication#7034
feat: add SFTP monitor type with password and private key authentication#7034eXtgmA wants to merge 7 commits intolouislam:masterfrom
Conversation
|
Hello and thanks for lending a paw to Uptime Kuma! 🐻👋 |
There was a problem hiding this comment.
Pull request overview
Adds a new SFTP monitor type to Uptime Kuma, including backend connectivity checks (password or SSH private key auth), UI configuration fields, persistence via DB migration, and backend unit tests.
Changes:
- Implemented a new backend monitor type (
sftp) usingssh2-sftp-client, including optional remote path existence checks. - Added SFTP configuration UI to the monitor editor and new i18n strings.
- Added DB columns + serialization/persistence wiring and backend tests for SFTP scenarios.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
server/monitor-types/sftp.js |
New SFTP monitor type implementation. |
server/uptime-kuma-server.js |
Registers the new sftp monitor type. |
server/server.js |
Persists SFTP fields when saving a monitor. |
server/model/monitor.js |
Serializes/deserializes SFTP fields (incl. sensitive fields). |
db/knex_migrations/2026-02-23-0000-add-sftp-monitor.js |
Adds DB columns for SFTP configuration. |
src/pages/EditMonitor.vue |
Adds SFTP to monitor type list and renders SFTP-specific form fields. |
src/lang/en.json |
Adds English translations for SFTP UI strings. |
test/backend-test/monitors/test-sftp.js |
Adds backend unit tests for SFTP monitor behavior. |
package.json / package-lock.json |
Adds ssh2-sftp-client dependency. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…timeouts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| table.string("sftp_password"); | ||
| table.string("sftp_path"); | ||
| table.text("sftp_private_key"); | ||
| table.string("sftp_passphrase"); | ||
| table.string("sftp_auth_method").defaultTo("password"); |
There was a problem hiding this comment.
Except sftp_path, I think it should called ssh_*. In case someone implement ssh monitor in the future, they can reuse the fields.
There was a problem hiding this comment.
we also likely already have username and password fields for monitors -> reuse those
This package seems to provide a basic working sftp server, not tested, but feel free to add to devDependencies. |
Summary
In this pull request, the following changes are made:
SFTP/FTPas a new monitor #2877Please follow this checklist to avoid unnecessary back and forth (click to expand)
I understand that I am responsible for and able to explain every line of code I submit.
For the private key, I decided against a hidden input because it is much more readable with a text area.
New dependencies
Screenshots for Visual Changes