Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6d1b451f4c | ||
|
|
69537f7002 | ||
|
|
17de78240f | ||
|
|
8cbcdf5323 | ||
|
|
6ba5abc0a6 | ||
|
|
d820285d1e | ||
|
|
a6002ba340 |
@@ -64,6 +64,7 @@ Additionally, the plugin author may occasionally visit Obsidian official forum a
|
||||
- Tutorials / Examples:
|
||||
- [Cloudflare R2](./docs/remote_services/s3_cloudflare_r2/README.md)
|
||||
- [BackBlaze B2](./docs/remote_services/s3_backblaze_b2/README.md)
|
||||
- [Storj](./docs/remote_services/s3_storj_io/README.md)
|
||||
- [腾讯云 COS](./docs/remote_services/s3_tencent_cloud_cos/README.zh-cn.md) | [Tencent Cloud COS](./docs/remote_services/s3_tencent_cloud_cos/README.md)
|
||||
- [MinIO](./docs/remote_services/s3_minio/README.md)
|
||||
- Prepare your S3 (-compatible) service information: [endpoint, region](https://docs.aws.amazon.com/general/latest/gr/s3.html), [access key id, secret access key](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/getting-your-credentials.html), bucket name. The bucket should be empty and solely for syncing a vault.
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
# Storj
|
||||
|
||||
## Links
|
||||
|
||||
<https://www.storj.io/>
|
||||
|
||||
## Steps
|
||||
|
||||
1. Register an account. Login.
|
||||
2. Create a bucket.
|
||||
3. Create S3 Credentials in Access Management. Allow all permissions for the bucket. Remember the access key and secret key and the end point. The end point is likely to be [`https://gateway.storjshare.io`](https://docs.storj.io/dcs/api/s3/s3-compatible-gateway).
|
||||

|
||||

|
||||
4. Input your credentials into remotely-save settings. Region [should be `global`](https://docs.storj.io/dcs/api/s3/s3-compatibility).
|
||||

|
||||
5. Check connectivity.
|
||||
6. Sync!
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a3484f74f45fbdae6110de285edeff10c196c13160cb97f079da77843ae92e80
|
||||
size 386188
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:42593d98e1b154f4174a932088e72c25db9a976b5613f4d6ae21df1445b4559c
|
||||
size 278219
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7843c31153054eb4762dbaf3027c1042b0d7cb4dd774bf584788cd7a97ba4044
|
||||
size 571188
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "remotely-save",
|
||||
"name": "Remotely Save",
|
||||
"version": "0.3.38",
|
||||
"version": "0.3.40",
|
||||
"minAppVersion": "0.13.21",
|
||||
"description": "Yet another unofficial plugin allowing users to synchronize notes between local device and the cloud service.",
|
||||
"author": "fyears",
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "remotely-save",
|
||||
"name": "Remotely Save",
|
||||
"version": "0.3.38",
|
||||
"version": "0.3.40",
|
||||
"minAppVersion": "0.13.21",
|
||||
"description": "Yet another unofficial plugin allowing users to synchronize notes between local device and the cloud service.",
|
||||
"author": "fyears",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "remotely-save",
|
||||
"version": "0.3.38",
|
||||
"version": "0.3.40",
|
||||
"description": "This is yet another sync plugin for Obsidian app.",
|
||||
"scripts": {
|
||||
"dev2": "node esbuild.config.mjs --watch",
|
||||
|
||||
+9
-7
@@ -40,14 +40,16 @@
|
||||
"command_exportsyncplans_json": "export sync plans in json format",
|
||||
"command_exportlogsindb": "export logs saved in db",
|
||||
|
||||
"statusbar_time_years": "{{time}} years",
|
||||
"statusbar_time_months": "{{time}} months",
|
||||
"statusbar_time_weeks": "{{time}} weeks",
|
||||
"statusbar_time_days": "{{time}} days",
|
||||
"statusbar_time_hours": "{{time}} hours",
|
||||
"statusbar_time_minutes": "{{time}} minutes",
|
||||
"statusbar_time_lessminute": "less than a minute",
|
||||
"statusbar_time_years": "Synced {{time}} years ago",
|
||||
"statusbar_time_months": "Synced {{time}} months ago",
|
||||
"statusbar_time_weeks": "Synced {{time}} weeks ago",
|
||||
"statusbar_time_days": "Synced {{time}} days ago",
|
||||
"statusbar_time_hours": "Synced {{time}} hours ago",
|
||||
"statusbar_time_minutes": "Synced {{time}} minutes ago",
|
||||
"statusbar_time_lessminute": "Synced less than a minute ago",
|
||||
"statusbar_lastsync": "Synced {{time}} ago",
|
||||
"statusbar_syncing": "Syncing...",
|
||||
"statusbar_now": "Synced just now",
|
||||
"statusbar_lastsync_label": "Last successful Sync on {{date}}",
|
||||
"statusbar_lastsync_never": "Never Synced",
|
||||
"statusbar_lastsync_never_label": "Never Synced before",
|
||||
|
||||
@@ -40,14 +40,16 @@
|
||||
"command_exportsyncplans_json": "导出同步计划为 json 格式(export sync plans in json format)",
|
||||
"command_exportlogsindb": "从数据库导出终端日志(export logs saved in db)",
|
||||
|
||||
"statusbar_time_years": "{{time}} 年前",
|
||||
"statusbar_time_months": "{{time}} 月前",
|
||||
"statusbar_time_weeks": "{{time}} 周前",
|
||||
"statusbar_time_days": "{{time}} 天前",
|
||||
"statusbar_time_hours": "{{time}} 小时前",
|
||||
"statusbar_time_minutes": "{{time}} 分钟前",
|
||||
"statusbar_time_lessminute": "一分钟之内",
|
||||
"statusbar_time_years": "{{time}} 年前同步",
|
||||
"statusbar_time_months": "{{time}} 月前同步",
|
||||
"statusbar_time_weeks": "{{time}} 周前同步",
|
||||
"statusbar_time_days": "{{time}} 天前同步",
|
||||
"statusbar_time_hours": "{{time}} 小时前同步",
|
||||
"statusbar_time_minutes": "{{time}} 分钟前同步",
|
||||
"statusbar_time_lessminute": "一分钟之内同步",
|
||||
"statusbar_lastsync": "上一次同步于:{{time}}",
|
||||
"statusbar_syncing": "正在同步",
|
||||
"statusbar_now": "刚同步完",
|
||||
"statusbar_lastsync_label": "上一次同步于:{{date}}",
|
||||
"statusbar_lastsync_never": "没触发过同步",
|
||||
"statusbar_lastsync_never_label": "没触发过同步",
|
||||
|
||||
@@ -40,14 +40,16 @@
|
||||
"command_exportsyncplans_json": "匯出同步計劃為 json 格式(export sync plans in json format)",
|
||||
"command_exportlogsindb": "從資料庫匯出終端日誌(export logs saved in db)",
|
||||
|
||||
"statusbar_time_years": "{{time}} 年前",
|
||||
"statusbar_time_months": "{{time}} 月前",
|
||||
"statusbar_time_weeks": "{{time}} 周前",
|
||||
"statusbar_time_days": "{{time}} 天前",
|
||||
"statusbar_time_hours": "{{time}} 小時前",
|
||||
"statusbar_time_minutes": "{{time}} 分鐘前",
|
||||
"statusbar_time_lessminute": "一分鐘之內",
|
||||
"statusbar_time_years": "{{time}} 年前同步",
|
||||
"statusbar_time_months": "{{time}} 月前同步",
|
||||
"statusbar_time_weeks": "{{time}} 周前同步",
|
||||
"statusbar_time_days": "{{time}} 天前同步",
|
||||
"statusbar_time_hours": "{{time}} 小時前同步",
|
||||
"statusbar_time_minutes": "{{time}} 分鐘前同步",
|
||||
"statusbar_time_lessminute": "一分鐘之內同步",
|
||||
"statusbar_lastsync": "上一次同步於:{{time}}",
|
||||
"statusbar_syncing": "正在同步",
|
||||
"statusbar_now": "剛同步完",
|
||||
"statusbar_lastsync_label": "上一次同步於:{{date}}",
|
||||
"statusbar_lastsync_never": "沒觸發過同步",
|
||||
"statusbar_lastsync_never_label": "沒觸發過同步",
|
||||
|
||||
+43
-18
@@ -203,6 +203,10 @@ export default class RemotelySavePlugin extends Plugin {
|
||||
}
|
||||
}
|
||||
|
||||
// change status to "syncing..." on statusbar
|
||||
if (this.statusBarElement !== undefined) {
|
||||
this.updateLastSuccessSyncMsg(-1);
|
||||
}
|
||||
//log.info(`huh ${this.settings.password}`)
|
||||
if (this.settings.currLogLevel === "info") {
|
||||
getNotice(
|
||||
@@ -332,6 +336,7 @@ export default class RemotelySavePlugin extends Plugin {
|
||||
getNotice(t("syncrun_step7"));
|
||||
}
|
||||
this.syncStatus = "syncing";
|
||||
|
||||
await doActualSync(
|
||||
client,
|
||||
this.db,
|
||||
@@ -1076,6 +1081,19 @@ export default class RemotelySavePlugin extends Plugin {
|
||||
this.settings.syncOnSaveAfterMilliseconds > 0
|
||||
) {
|
||||
let runScheduled = false;
|
||||
let needToRunAgain = false;
|
||||
|
||||
const scheduleSyncOnSave = (scheduleTimeFromNow: number) => {
|
||||
log.info(
|
||||
`schedule a run for ${scheduleTimeFromNow} milliseconds later`
|
||||
);
|
||||
runScheduled = true;
|
||||
setTimeout(() => {
|
||||
this.syncRun("auto_sync_on_save");
|
||||
runScheduled = false;
|
||||
}, scheduleTimeFromNow);
|
||||
};
|
||||
|
||||
this.app.workspace.onLayoutReady(() => {
|
||||
const intervalID = window.setInterval(() => {
|
||||
const currentFile = this.app.workspace.getActiveFile();
|
||||
@@ -1086,29 +1104,28 @@ export default class RemotelySavePlugin extends Plugin {
|
||||
// then schedule a run for syncOnSaveAfterMilliseconds after it was modified
|
||||
const lastModified = currentFile.stat.mtime;
|
||||
const currentTime = Date.now();
|
||||
// log.debug(
|
||||
// `Checking if file was modified within last ${
|
||||
// this.settings.syncOnSaveAfterMilliseconds / 1000
|
||||
// } seconds, last modified: ${
|
||||
// (currentTime - lastModified) / 1000
|
||||
// } seconds ago`
|
||||
// );
|
||||
if (
|
||||
currentTime - lastModified <
|
||||
this.settings!.syncOnSaveAfterMilliseconds!
|
||||
) {
|
||||
if (!runScheduled) {
|
||||
if (
|
||||
!needToRunAgain &&
|
||||
!runScheduled &&
|
||||
this.syncStatus === "idle"
|
||||
) {
|
||||
const scheduleTimeFromNow =
|
||||
this.settings!.syncOnSaveAfterMilliseconds! -
|
||||
(currentTime - lastModified);
|
||||
log.info(
|
||||
`schedule a run for ${scheduleTimeFromNow} milliseconds later`
|
||||
);
|
||||
runScheduled = true;
|
||||
setTimeout(() => {
|
||||
this.syncRun("auto_sync_on_save");
|
||||
runScheduled = false;
|
||||
}, scheduleTimeFromNow);
|
||||
scheduleSyncOnSave(scheduleTimeFromNow);
|
||||
} else if (
|
||||
needToRunAgain &&
|
||||
!runScheduled &&
|
||||
this.syncStatus === "idle"
|
||||
) {
|
||||
scheduleSyncOnSave(this.settings!.syncOnSaveAfterMilliseconds!);
|
||||
needToRunAgain = false;
|
||||
} else {
|
||||
needToRunAgain = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1144,6 +1161,10 @@ export default class RemotelySavePlugin extends Plugin {
|
||||
let lastSyncMsg = t("statusbar_lastsync_never");
|
||||
let lastSyncLabelMsg = t("statusbar_lastsync_never_label");
|
||||
|
||||
if (lastSuccessSyncMillis !== undefined && lastSuccessSyncMillis === -1) {
|
||||
lastSyncMsg = t("statusbar_syncing");
|
||||
}
|
||||
|
||||
if (lastSuccessSyncMillis !== undefined && lastSuccessSyncMillis > 0) {
|
||||
const deltaTime = Date.now() - lastSuccessSyncMillis;
|
||||
|
||||
@@ -1154,6 +1175,8 @@ export default class RemotelySavePlugin extends Plugin {
|
||||
const days = Math.floor(deltaTime / 86400000);
|
||||
const hours = Math.floor(deltaTime / 3600000);
|
||||
const minutes = Math.floor(deltaTime / 60000);
|
||||
const seconds = Math.floor(deltaTime / 1000);
|
||||
|
||||
let timeText = "";
|
||||
|
||||
if (years > 0) {
|
||||
@@ -1168,8 +1191,10 @@ export default class RemotelySavePlugin extends Plugin {
|
||||
timeText = t("statusbar_time_hours", { time: hours });
|
||||
} else if (minutes > 0) {
|
||||
timeText = t("statusbar_time_minutes", { time: minutes });
|
||||
} else {
|
||||
} else if (seconds > 30) {
|
||||
timeText = t("statusbar_time_lessminute");
|
||||
} else {
|
||||
timeText = t("statusbar_now");
|
||||
}
|
||||
|
||||
let dateText = new Date(lastSuccessSyncMillis).toLocaleTimeString(
|
||||
@@ -1182,7 +1207,7 @@ export default class RemotelySavePlugin extends Plugin {
|
||||
}
|
||||
);
|
||||
|
||||
lastSyncMsg = t("statusbar_lastsync", { time: timeText });
|
||||
lastSyncMsg = timeText;
|
||||
lastSyncLabelMsg = t("statusbar_lastsync_label", { date: dateText });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user