Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be2b168c6c | ||
|
|
6b296d6110 | ||
|
|
6757348ac9 | ||
|
|
a7e6bed071 | ||
|
|
8b8c5bdb98 | ||
|
|
5b77b23e9f |
@@ -38,3 +38,4 @@ jobs:
|
||||
path: |
|
||||
main.js
|
||||
manifest.json
|
||||
styles.css
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "obsdian-save-remote",
|
||||
"id": "obsidian-save-remote",
|
||||
"name": "Save remote",
|
||||
"version": "0.0.13",
|
||||
"version": "0.0.14",
|
||||
"minAppVersion": "0.12.15",
|
||||
"description": "This is yet another plugin allowing users to sync notes between local device and the cloud.",
|
||||
"author": "fyears",
|
||||
|
||||
+5
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "obsidian-save-remote",
|
||||
"version": "0.0.13",
|
||||
"version": "0.0.14",
|
||||
"description": "This is yet another sync plugin for Obsidian app.",
|
||||
"scripts": {
|
||||
"dev": "webpack --mode development --watch",
|
||||
@@ -31,11 +31,11 @@
|
||||
"typescript": "^4.4.4",
|
||||
"webdav-server": "^2.6.2",
|
||||
"webpack": "^5.58.2",
|
||||
"webpack-cli": "^4.9.1",
|
||||
"xregexp": "^5.1.0"
|
||||
"webpack-cli": "^4.9.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-s3": "^3.37.0",
|
||||
"@aws-sdk/lib-storage": "^3.40.1",
|
||||
"@aws-sdk/signature-v4-crt": "^3.37.0",
|
||||
"acorn": "^8.5.0",
|
||||
"aws-crt": "^1.10.1",
|
||||
@@ -50,6 +50,7 @@
|
||||
"rimraf": "^3.0.2",
|
||||
"stream-browserify": "^3.0.0",
|
||||
"webdav": "^4.7.0",
|
||||
"webdav-fs": "^4.0.0"
|
||||
"webdav-fs": "^4.0.0",
|
||||
"xregexp": "^5.1.0"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ import { Vault } from "obsidian";
|
||||
import * as path from "path";
|
||||
|
||||
import { base32 } from "rfc4648";
|
||||
import XRegExp from "XRegExp";
|
||||
import XRegExp from "xregexp";
|
||||
|
||||
export type SUPPORTED_SERVICES_TYPE = "s3" | "webdav" | "ftp";
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import { Readable } from "stream";
|
||||
|
||||
import { Vault } from "obsidian";
|
||||
|
||||
import { Upload } from "@aws-sdk/lib-storage";
|
||||
import {
|
||||
S3Client,
|
||||
ListObjectsV2Command,
|
||||
@@ -115,14 +116,24 @@ export const uploadToRemote = async (
|
||||
remoteContent = await encryptArrayBuffer(localContent, password);
|
||||
}
|
||||
const body = arrayBufferToBuffer(remoteContent);
|
||||
await s3Client.send(
|
||||
new PutObjectCommand({
|
||||
|
||||
const upload = new Upload({
|
||||
client: s3Client,
|
||||
queueSize: 20, // concurrency
|
||||
partSize: 5242880, // minimal 5MB by default
|
||||
leavePartsOnError: false,
|
||||
params: {
|
||||
Bucket: s3Config.s3BucketName,
|
||||
Key: uploadFile,
|
||||
Body: body,
|
||||
ContentType: contentType,
|
||||
})
|
||||
);
|
||||
},
|
||||
});
|
||||
upload.on("httpUploadProgress", (progress) => {
|
||||
// console.log(progress);
|
||||
});
|
||||
await upload.done();
|
||||
|
||||
return await getRemoteMeta(s3Client, s3Config, uploadFile);
|
||||
}
|
||||
};
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"0.0.13": "0.12.15"
|
||||
"0.0.14": "0.12.15"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user