mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 15:24:35 +01:00
@@ -8,6 +8,7 @@ class SftpReq {
|
|||||||
String? privateKey;
|
String? privateKey;
|
||||||
Spi? jumpSpi;
|
Spi? jumpSpi;
|
||||||
String? jumpPrivateKey;
|
String? jumpPrivateKey;
|
||||||
|
Map<String, String>? knownHostFingerprints;
|
||||||
|
|
||||||
SftpReq(this.spi, this.remotePath, this.localPath, this.type) {
|
SftpReq(this.spi, this.remotePath, this.localPath, this.type) {
|
||||||
final keyId = spi.keyId;
|
final keyId = spi.keyId;
|
||||||
@@ -18,6 +19,11 @@ class SftpReq {
|
|||||||
jumpSpi = Stores.server.box.get(spi.jumpId);
|
jumpSpi = Stores.server.box.get(spi.jumpId);
|
||||||
jumpPrivateKey = Stores.key.fetchOne(jumpSpi?.keyId)?.key;
|
jumpPrivateKey = Stores.key.fetchOne(jumpSpi?.keyId)?.key;
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
knownHostFingerprints = Map<String, String>.from(Stores.setting.sshKnownHostFingerprints.get());
|
||||||
|
} catch (_) {
|
||||||
|
knownHostFingerprints = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ Future<void> _download(SftpReq req, SendPort mainSendPort, SendErrorFunction sen
|
|||||||
privateKey: req.privateKey,
|
privateKey: req.privateKey,
|
||||||
jumpSpi: req.jumpSpi,
|
jumpSpi: req.jumpSpi,
|
||||||
jumpPrivateKey: req.jumpPrivateKey,
|
jumpPrivateKey: req.jumpPrivateKey,
|
||||||
|
knownHostFingerprints: req.knownHostFingerprints,
|
||||||
);
|
);
|
||||||
mainSendPort.send(SftpWorkerStatus.sshConnectted);
|
mainSendPort.send(SftpWorkerStatus.sshConnectted);
|
||||||
|
|
||||||
@@ -121,6 +122,7 @@ Future<void> _upload(SftpReq req, SendPort mainSendPort, SendErrorFunction sendE
|
|||||||
privateKey: req.privateKey,
|
privateKey: req.privateKey,
|
||||||
jumpSpi: req.jumpSpi,
|
jumpSpi: req.jumpSpi,
|
||||||
jumpPrivateKey: req.jumpPrivateKey,
|
jumpPrivateKey: req.jumpPrivateKey,
|
||||||
|
knownHostFingerprints: req.knownHostFingerprints,
|
||||||
);
|
);
|
||||||
mainSendPort.send(SftpWorkerStatus.sshConnectted);
|
mainSendPort.send(SftpWorkerStatus.sshConnectted);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user