remotely-save/README.md

115 lines
9.5 KiB
Markdown
Raw Normal View History

2021-11-14 14:34:07 +00:00
# Remotely Save
2021-10-17 14:50:12 +00:00
2021-12-28 16:34:16 +00:00
This is yet another unofficial sync plugin for Obsidian. If you like it or find it useful, please consider give it a [star ![GitHub Repo stars](https://img.shields.io/github/stars/fyears/remotely-save?style=social)](https://github.com/fyears/remotely-save) on Github.
2021-10-17 14:50:12 +00:00
2022-01-06 10:38:35 +00:00
[![BuildCI](https://github.com/fyears/remotely-save/actions/workflows/auto-build.yml/badge.svg)](https://github.com/fyears/remotely-save/actions/workflows/auto-build.yml)
2022-01-02 17:07:41 +00:00
2022-04-03 05:16:23 +00:00
[![downloads of latest version](https://img.shields.io/github/downloads-pre/remotely-save/remotely-save/latest/main.js?sort=semver)](https://github.com/fyears/remotely-save/releases)
2021-12-17 16:31:04 +00:00
2021-11-14 16:35:56 +00:00
## Disclaimer
2021-11-06 05:15:54 +00:00
2021-12-03 17:21:37 +00:00
- **This is NOT the [official sync service](https://obsidian.md/sync) provided by Obsidian.**
2021-11-06 05:15:54 +00:00
2021-11-14 16:35:56 +00:00
## !!!Caution!!!
2021-11-06 05:15:54 +00:00
2022-03-18 14:00:08 +00:00
**ALWAYS, ALWAYS, backup your vault before using this plugin.**
2021-11-06 05:15:54 +00:00
2021-11-14 16:35:56 +00:00
## Features
2021-10-17 14:50:12 +00:00
2021-12-09 17:05:47 +00:00
- Supports:
- Amazon S3 or S3-compatible
- Dropbox
- OneDrive for personal
2021-12-09 17:05:47 +00:00
- Webdav
2022-03-14 16:02:22 +00:00
- [Here](./docs/services_connectable_or_not.md) shows more connectable (or not-connectable) services in details.
2022-01-26 20:31:05 +00:00
- **Obsidian Mobile supported.** Vaults can be synced across mobile and desktop devices with the cloud service as the "broker".
2021-11-14 16:35:56 +00:00
- **[End-to-end encryption](./docs/encryption.md) supported.** Files would be encrypted using openssl format before being sent to the cloud **if** user specify a password.
2022-01-22 14:19:31 +00:00
- **Scheduled auto sync supported.** You can also manually trigger the sync using sidebar ribbon, or using the command from the command palette (or even bind the hot key combination to the command then press the hot key combination).
2021-11-14 16:35:56 +00:00
- **[Minimal Intrusive](./docs/minimal_intrusive_design.md).**
- **Fully open source under [Apache-2.0 License](./LICENSE).**
2022-02-27 09:57:20 +00:00
- **[Sync Algorithm open](./docs/sync_algorithm_v2.md) for discussion.**
2021-10-17 14:50:12 +00:00
2021-11-14 16:35:56 +00:00
## Limitations
2021-10-17 14:50:12 +00:00
new sync algo, squashed commit of the following: commit 692bb794aea5609b9e9abf5228620f4479e50983 Author: fyears <1142836+fyears@users.noreply.github.com> Date: Sun Feb 27 17:52:43 2022 +0800 bump to 0.3.0 commit 77335412ad2da2b5bd1ed5075061a5af006e3c36 Author: fyears <1142836+fyears@users.noreply.github.com> Date: Sun Feb 27 17:50:57 2022 +0800 change titles for minimal intrusive design commit 2812adebb84344d384749a62acb63fd0c6fd509d Author: fyears <1142836+fyears@users.noreply.github.com> Date: Sun Feb 27 17:30:53 2022 +0800 remove syncv1 commit 22fc24a76c9851740bbc7c0177d1cb2526e15d8b Author: fyears <1142836+fyears@users.noreply.github.com> Date: Sun Feb 27 17:30:27 2022 +0800 full notice to any one commit d56ea24a78f6dc1fbea2740011ee1cea9c403d4c Author: fyears <1142836+fyears@users.noreply.github.com> Date: Sat Feb 26 23:11:14 2022 +0800 fix test commit 759f82593bbfb9b49079cfd80dbadbbafc0287e5 Author: fyears <1142836+fyears@users.noreply.github.com> Date: Sat Feb 26 21:59:25 2022 +0800 obfuscate metadata on remote commit 9b6bf05288af0e52d0f02468e5ac8757f4f896df Author: fyears <1142836+fyears@users.noreply.github.com> Date: Sat Feb 26 21:33:52 2022 +0800 avoid re-uploading if meta not changed commit 03be1453764e48e99207f44467ee4d5801072ed8 Author: fyears <1142836+fyears@users.noreply.github.com> Date: Sat Feb 26 00:35:52 2022 +0800 add password condition commit 7f899f7c2572df3e2a35e16cbdaab94db113f366 Author: fyears <1142836+fyears@users.noreply.github.com> Date: Sat Feb 26 00:22:58 2022 +0800 add decision branch for easier debugging commit cf4071bf3156356ae6ec3a9cb187c2cb541d1b17 Author: fyears <1142836+fyears@users.noreply.github.com> Date: Fri Feb 25 23:40:52 2022 +0800 change folder error commit 964493dd998699a1d53018a201637bda192c4baa Author: fyears <1142836+fyears@users.noreply.github.com> Date: Fri Feb 25 23:09:44 2022 +0800 finnaly remote remove should be working commit 2888e65452f9c0e1dde6005f012c3ee0a6313c3f Author: fyears <1142836+fyears@users.noreply.github.com> Date: Fri Feb 25 01:18:15 2022 +0800 optimize comparation commit 024936951d6180b1296c2a5d56c5bf5d468e9ae7 Author: fyears <1142836+fyears@users.noreply.github.com> Date: Fri Feb 25 01:14:44 2022 +0800 allow uploading extra meta commit 007006701d536da2b4b46389941980579bbc4e67 Author: fyears <1142836+fyears@users.noreply.github.com> Date: Thu Feb 24 01:08:58 2022 +0800 add logic to fetch extra meta commit c9d3a05ca1bf45c06f22233124670e5e45b5f5f1 Author: fyears <1142836+fyears@users.noreply.github.com> Date: Thu Feb 24 00:29:16 2022 +0800 another way to deal with trash commit 82d455f8bf60f7bac8eb4e299a2ca44c331a6d7f Author: fyears <1142836+fyears@users.noreply.github.com> Date: Thu Feb 24 00:28:51 2022 +0800 add return buffer for downloading commit b8e6b79bc078def2854bc73578b7f520cc39ab34 Author: fyears <1142836+fyears@users.noreply.github.com> Date: Wed Feb 23 00:16:06 2022 +0800 half way to actual sync commit 90cceb1411b46af9741f2caa3ab8beafaf69c1b2 Author: fyears <1142836+fyears@users.noreply.github.com> Date: Tue Feb 22 23:36:09 2022 +0800 cleaner way to remember the folder being kept commit c1afb763cc4e0f7905c83e0a8eb20f8ed969a279 Author: fyears <1142836+fyears@users.noreply.github.com> Date: Tue Feb 22 00:03:21 2022 +0800 simplified way to get plans for sync algo v2 commit 5c5ecce39eb3854900f1f5b79c7beb189e78a6a7 Author: fyears <1142836+fyears@users.noreply.github.com> Date: Mon Feb 21 23:13:58 2022 +0800 archive the old sync algo v1 doc commit 75cdfa1ee9834600f83ded6672b102de2c5f9616 Author: fyears <1142836+fyears@users.noreply.github.com> Date: Mon Feb 21 23:13:14 2022 +0800 simplify sync algo v2 commit dc9275835d961de07efcbaa81657e4745242e72a Author: fyears <1142836+fyears@users.noreply.github.com> Date: Mon Feb 21 22:58:57 2022 +0800 add way to skip recording removing commit f9712ef96021dfed4ae33e6c649f78e940b7e530 Author: fyears <1142836+fyears@users.noreply.github.com> Date: Mon Feb 21 09:38:09 2022 +0800 fix sync commit 9007dcf22ef317dde36ac4f1dd589d05cc8d5cf6 Author: fyears <1142836+fyears@users.noreply.github.com> Date: Mon Feb 21 00:54:21 2022 +0800 fix assignment commit 77abee6ad443b62353ed3913e0945ea7d1314f87 Author: fyears <1142836+fyears@users.noreply.github.com> Date: Mon Feb 21 00:28:43 2022 +0800 draft of sync v2 commit a0c26238bf60692e095cfd8527abf937255b56d4 Author: fyears <1142836+fyears@users.noreply.github.com> Date: Mon Feb 21 00:23:19 2022 +0800 how to deal with folders commit c10f92a7e8d3c4a4f4c585e39e0abad1a5376c02 Author: fyears <1142836+fyears@users.noreply.github.com> Date: Sun Feb 20 23:39:16 2022 +0800 helper func to get parents commit f903c98b3b7b9d1e785d04b9fc0cfcafdc6e5661 Author: fyears <1142836+fyears@users.noreply.github.com> Date: Sun Feb 20 23:31:21 2022 +0800 add optional ending slash to getFolderLevels commit 2d67c9b2b941e676588fa43ab289fab79f567e5e Author: fyears <1142836+fyears@users.noreply.github.com> Date: Sun Feb 20 14:44:44 2022 +0800 update sync algo v2 commit 491ed1bb85759df2411706fd02d740acb5598ce6 Author: fyears <1142836+fyears@users.noreply.github.com> Date: Sun Feb 20 14:34:51 2022 +0800 dry run mode commit dfd588dcef512ba7dfe760008bcf97138b97e339 Author: fyears <1142836+fyears@users.noreply.github.com> Date: Sat Feb 19 23:14:32 2022 +0800 prettier commit eae580f882a045ae9df799b816e68c3500704131 Author: fyears <1142836+fyears@users.noreply.github.com> Date: Sat Feb 19 23:12:29 2022 +0800 draft design for sync algo v2
2022-02-27 09:54:31 +00:00
- **To support deltions sync, extra metadata will also be uploaded.** See [Minimal Intrusive](./docs/minimal_intrusive_design.md).
2021-11-14 16:35:56 +00:00
- **No Conflict resolution. No content-diff-and-patch algorithm.** All files and folders are compared using their local and remote "last modified time" and those with later "last modified time" wins.
2022-03-18 14:00:08 +00:00
- **Cloud services cost you money.** Always be aware of the costs and pricing. Specifically, all the operations, including but not limited to downloading, uploading, listing all files, calling any api, storage sizes, may or may not cost you money.
2022-02-11 18:00:32 +00:00
- **Some limitations from the browser environment.** More technical details are [in the doc](./docs/browser_env.md).
2021-10-17 14:50:12 +00:00
2021-12-09 17:34:19 +00:00
## Questions, Suggestions, Or Bugs
You are greatly welcome to ask questions, post any suggestions, or report any bugs! The project is mainly maintained on GitHub:
- Questions: [GitHub repo Discussions](https://github.com/fyears/remotely-save/discussions)
- Suggestions: also in [GitHub repo Discussions](https://github.com/fyears/remotely-save/discussions)
- Bugs: [GitHub repo Issues](https://github.com/fyears/remotely-save/issues) (NOT Discussion)
Additionally, the plugin author may occasionally visit Obsidian official forum and official Discord server, and pay attention to this-plugin-related information there.
2021-11-14 16:35:56 +00:00
## Download and Install
2021-10-17 14:50:12 +00:00
2022-03-06 15:42:13 +00:00
- Option #1: Search in the official "community plugin list", or visit this: [https://obsidian.md/plugins?id=remotely-save](https://obsidian.md/plugins?id=remotely-save) (which should redirect you into Obsidian app), then install the plugin.
2021-12-17 16:31:04 +00:00
- Option #2: You can also use [Obsidian42 - BRAT](https://github.com/TfTHacker/obsidian42-brat) to install this plugin. Input `fyears/remotely-save` in the configuration of BRAT.
- Option #3: [![GitHub release (latest by SemVer and asset including pre-releases)](https://img.shields.io/github/downloads-pre/fyears/remotely-save/latest/main.js?sort=semver)](https://github.com/fyears/remotely-save/releases) Manually download assets (`main.js`, `manifest.json`, `styles.css`) from the latest release.
- Option #4: [![BuildCI](https://github.com/fyears/remotely-save/actions/workflows/auto-build.yml/badge.svg)](https://github.com/fyears/remotely-save/actions/workflows/auto-build.yml) Every artifacts are placed in the "Summary" under every successful builds. It's automatically generated by every commit, may break something.
2021-11-14 16:35:56 +00:00
## Usage
2021-10-17 14:50:12 +00:00
2021-12-09 17:34:19 +00:00
### S3
2021-11-21 16:06:50 +00:00
2021-11-14 16:35:56 +00:00
- 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.
2022-03-11 15:07:19 +00:00
- About CORS:
2022-03-23 02:01:08 +00:00
- If you are using Obsidian desktop >= 0.13.25 or mobile >= 1.1.1, you can skip this CORS part.
- If you are using Obsidian desktop < 0.13.25 or mobile < 1.1.1, you need to configure (enable) [CORS](https://docs.aws.amazon.com/AmazonS3/latest/userguide/enabling-cors-examples.html) for requests from `app://obsidian.md` and `capacitor://localhost` and `http://localhost`, and add at least `ETag` into exposed headers. Full example is [here](./docs/s3_cors_configure.md). It's unfortunately required, because the plugin sends requests from a browser-like envirement. And those addresses are tested and found on desktop and ios and android.
2021-11-14 16:35:56 +00:00
- Download and enable this plugin.
2021-12-11 16:02:41 +00:00
- Enter your information to the settings of this plugin.
2021-11-14 16:35:56 +00:00
- If you want to enable end-to-end encryption, also set a password in settings. If you do not specify a password, the files and folders are synced in plain, original content to the cloud.
2022-01-22 14:19:31 +00:00
- Click the new "circle arrow" icon on the ribbon (the left sidebar), **every time** you want to sync your vault between local and remote. (Or, you could configure auto sync in the settings panel (See next chapter).) While syncing, the icon becomes "two half-circle arrows". Besides clicking the icon on the sidebar ribbon, you can also activate the corresponding command in the command palette.
2021-11-14 16:35:56 +00:00
- **Be patient while syncing.** Especially in the first-time sync.
2021-11-21 16:06:50 +00:00
2021-11-29 16:41:41 +00:00
### Dropbox
- **This plugin is NOT an official Dropbox product.** The plugin just uses Dropbox's public API.
2022-01-01 10:44:14 +00:00
- After the authorization, the plugin can read your name and email (which cannot be unselected on Dropbox api), and read and write files in your Dropbox's `/Apps/remotely-save` folder.
2022-03-18 14:12:39 +00:00
- If you decide to authorize this plugin to connect to Dropbox, please go to plugin's settings, and choose Dropbox then follow the instructions. [More with screenshot is here](./docs/dropbox_review_material/README.md).
2021-12-11 15:13:55 +00:00
- Password-based end-to-end encryption is also supported. But please be aware that **the vault name itself is not encrypted**.
2021-11-29 16:41:41 +00:00
### OneDrive for personal
2022-01-01 10:44:14 +00:00
- **This plugin is NOT an official Microsoft / OneDrive product.** The plugin just uses Microsoft's [OneDrive's public API](https://docs.microsoft.com/en-us/onedrive/developer/rest-api).
- This plugin only works for "OneDrive for personal", and not works for "OneDrive for Business" (yet). See [#11](https://github.com/fyears/remotely-save/issues/11) to further details.
2022-01-01 10:44:14 +00:00
- After the authorization, the plugin can read your name and email, and read and write files in your OneDrive's `/Apps/remotely-save` folder.
- If you decide to authorize this plugin to connect to OneDrive, please go to plugin's settings, and choose OneDrive then follow the instructions.
- Password-based end-to-end encryption is also supported. But please be aware that **the vault name itself is not encrypted**.
2021-11-21 16:06:50 +00:00
### webdav
2022-03-11 15:07:19 +00:00
- About CORS:
2022-03-23 15:37:49 +00:00
- If you are using Obsidian desktop >= 0.13.25 or iOS >= 1.1.1, you can skip this CORS part.
- If you are using Obsidian desktop < 0.13.25 or iOS < 1.1.1 or any Android version:
2022-03-11 15:07:19 +00:00
- The webdav server has to be enabled CORS for requests from `app://obsidian.md` and `capacitor://localhost` and `http://localhost`, **AND** all webdav HTTP methods, **AND** all webdav headers. These are required, because Obsidian mobile works like a browser and mobile plugins are limited by CORS policies unless under a upgraded Obsidian version.
- Popular software NextCloud, OwnCloud, `rclone serve webdav` do **NOT** enable CORS by default. If you are using any of them, you should evaluate the risk, and find a way to enable CORS, before using this plugin, or use a upgraded Obsidian version.
- The plugin is tested successfully under python package [`wsgidav` (version 4.0)](https://github.com/mar10/wsgidav). See [this issue](https://github.com/mar10/wsgidav/issues/239) for some details.
2021-12-11 15:13:55 +00:00
- Your data would be synced to a `${vaultName}` sub folder on your webdav server.
- Password-based end-to-end encryption is also supported. But please be aware that **the vault name itself is not encrypted**.
2021-12-11 15:10:30 +00:00
2022-01-16 15:07:26 +00:00
## Scheduled Auto Sync
- You can configure auto syncing every N minutes in settings.
- In auto sync mode, if any error occurs, the plugin would **fail silently**.
- Auto sync only works when Obsidian is being opened. It's **technically impossible** to auto sync while Obsidian is in background, because the plugin just works in the browser environment provided by Obsidian.
2022-03-18 14:00:08 +00:00
## How To Deal With Hidden Files Or Folders
**By default, all files or folder starting with `.` (dot) or `_` (underscore) are treated as hidden files, and would NOT be synced.** It's useful if you have some files just staying locally. But this strategy also means that themes / other plugins / settings of this plugin would neither be synced.
In the latest version, you can change the settings to allow syncing `_` files or folders, as well as `.obsidian` special config folder (but not any other `.` files or folders).
2022-03-11 01:47:08 +00:00
## How To Debug
See [here](./docs/how_to_debug/README.md) for more details.
2022-01-16 15:10:59 +00:00
## Bonus: Import And Export Not-Oauth2 Plugin Settings By QR Code
2021-12-11 15:10:30 +00:00
2022-01-16 15:10:59 +00:00
See [here](./docs/import_export_some_settings.md) for more details.