mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2024-12-12 09:04:06 +02:00
make more clear documents.
This commit is contained in:
parent
5d9baec5e4
commit
d22716bef0
66
README.md
66
README.md
@ -1,4 +1,4 @@
|
|||||||
<!-- For translation: 20240206r0 -->
|
<!-- For translation: 20240209r0 -->
|
||||||
# Self-hosted LiveSync
|
# Self-hosted LiveSync
|
||||||
[Japanese docs](./README_ja.md) - [Chinese docs](./README_cn.md).
|
[Japanese docs](./README_ja.md) - [Chinese docs](./README_cn.md).
|
||||||
|
|
||||||
@ -6,22 +6,18 @@ Self-hosted LiveSync is a community-implemented synchronization plugin, availabl
|
|||||||
|
|
||||||
![obsidian_live_sync_demo](https://user-images.githubusercontent.com/45774780/137355323-f57a8b09-abf2-4501-836c-8cb7d2ff24a3.gif)
|
![obsidian_live_sync_demo](https://user-images.githubusercontent.com/45774780/137355323-f57a8b09-abf2-4501-836c-8cb7d2ff24a3.gif)
|
||||||
|
|
||||||
Note:
|
Note: This plugin cannot synchronise with the official "Obsidian Sync".
|
||||||
- Not compatible with official "Obsidian Sync".
|
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- Synchronize vaults very efficiently with less traffic.
|
- Synchronize vaults very efficiently with less traffic.
|
||||||
- We can synchronize in live, periodic, or on events, as we need.
|
|
||||||
- Good at conflicted modification.
|
- Good at conflicted modification.
|
||||||
- Automatic merging for simple conflicts.
|
- Automatic merging for simple conflicts.
|
||||||
- If it cannot be automated, do not worry! we can use a visual conflict resolver.
|
|
||||||
- Using OSS solution for the server.
|
- Using OSS solution for the server.
|
||||||
- We do not have to suspect the server side, at least.
|
|
||||||
- Compatible solutions can be used.
|
- Compatible solutions can be used.
|
||||||
- End-to-end encryption is supported.
|
- Supporting End-to-end encryption.
|
||||||
- We can synchronize settings, snippets, themes, and plug-ins, via [Customization sync(Beta)](#customization-sync) or [Hidden File Sync](#hiddenfilesync)
|
- Synchronisation of settings, snippets, themes, and plug-ins, via [Customization sync(Beta)](#customization-sync) or [Hidden File Sync](#hiddenfilesync)
|
||||||
- Receive WebClip from [obsidian-livesync-webclip](https://chrome.google.com/webstore/detail/obsidian-livesync-webclip/jfpaflmpckblieefkegjncjoceapakdf)
|
- WebClip from [obsidian-livesync-webclip](https://chrome.google.com/webstore/detail/obsidian-livesync-webclip/jfpaflmpckblieefkegjncjoceapakdf)
|
||||||
|
|
||||||
This plug-in might be useful for researchers, engineers, and developers with a need to keep their notes fully self-hosted for security reasons. Or just anyone who would like the peace of mind of knowing that their notes are fully private.
|
This plug-in might be useful for researchers, engineers, and developers with a need to keep their notes fully self-hosted for security reasons. Or just anyone who would like the peace of mind of knowing that their notes are fully private.
|
||||||
|
|
||||||
@ -29,35 +25,26 @@ This plug-in might be useful for researchers, engineers, and developers with a n
|
|||||||
|
|
||||||
- Before installing or upgrading this plug-in, please back your vault up.
|
- Before installing or upgrading this plug-in, please back your vault up.
|
||||||
- Do not enable this plugin with another synchronization solution at the same time (including iCloud and Obsidian Sync).
|
- Do not enable this plugin with another synchronization solution at the same time (including iCloud and Obsidian Sync).
|
||||||
- Before enabling this plugin, make sure to disable all the other synchronization methods to avoid content corruption or duplication.
|
|
||||||
- If you want to synchronize with two or more services, do them one by one, and never enable two synchronization methods at the same time.
|
|
||||||
- This includes not putting your vault inside a cloud-synchronized folder (eg. an iCloud folder or Dropbox folder)
|
|
||||||
- This is a synchronization plugin. Not a backup solution. Do not rely on this for backup.
|
- This is a synchronization plugin. Not a backup solution. Do not rely on this for backup.
|
||||||
|
|
||||||
## How to use
|
## How to use
|
||||||
|
|
||||||
### Get your database ready.
|
### 3-minute setup - CouchDB on fly.io
|
||||||
|
|
||||||
First, let us make our database ready. fly.io is preferred for testing. Or you can use your own server with CouchDB.
|
**Recommended for beginners**
|
||||||
|
|
||||||
For more information, refer below:
|
[![LiveSync Setup onto Fly.io SpeedRun 2024 using Google Colab](https://img.youtube.com/vi/7sa_I1832Xc/0.jpg)](https://www.youtube.com/watch?v=7sa_I1832Xc)
|
||||||
1. [Setup fly.io](docs/setup_flyio.md)
|
|
||||||
2. [Setup IBM Cloudant](docs/setup_cloudant.md)
|
|
||||||
3. [Setup your CouchDB](docs/setup_own_server.md)
|
|
||||||
|
|
||||||
### Configure the plugin
|
- [Setup CouchDB on fly.io](docs/setup_flyio.md)
|
||||||
|
|
||||||
See [Quick setup guide](doccs/../docs/quick_setup.md)
|
### Manually Setup
|
||||||
|
|
||||||
## Something looks corrupted...
|
1. [Setup your CouchDB](docs/setup_own_server.md)
|
||||||
|
2. [Configure plug-in](docs/quick_setup.md)
|
||||||
|
|
||||||
Please open the configuration link again and Answer below:
|
> **Tip**
|
||||||
- If your local database looks corrupted (in other words, when your Obsidian getting weird even standalone.)
|
> We are still able to use IBM Cloudant. However, it is not recommended for several reasons nowadays. Here is [Setup IBM Cloudant](docs/setup_cloudant.md)
|
||||||
- Answer `No` to `Keep local DB?`
|
|
||||||
- If your remote database looks corrupted (in other words, when something happens while replicating)
|
|
||||||
- Answer `No` to `Keep remote DB?`
|
|
||||||
|
|
||||||
If you answered `No` to both, your databases will be rebuilt by the content on your device. And the remote database will lock out other devices. You have to synchronize all your devices again. (When this time, almost all your files should be synchronized with a timestamp. So you can use an existing vault).
|
|
||||||
|
|
||||||
## Information in StatusBar
|
## Information in StatusBar
|
||||||
|
|
||||||
@ -79,31 +66,14 @@ Synchronization status is shown in statusbar.
|
|||||||
- 🛫 Pending read storage processes
|
- 🛫 Pending read storage processes
|
||||||
- ⚙️ Working or pending storage processes of hidden files
|
- ⚙️ Working or pending storage processes of hidden files
|
||||||
- 🧩 Waiting chunks
|
- 🧩 Waiting chunks
|
||||||
- 🔌 Working Customisation items (Configuration, snippets and plug-ins)
|
- 🔌 Working Customisation items (Configuration, snippets, and plug-ins)
|
||||||
|
|
||||||
To prevent file and database corruption, please wait until all progress indicators have disappeared. Especially in case of if you have deleted or renamed files.
|
To prevent file and database corruption, please wait until all progress indicators have disappeared. Especially in case of if you have deleted or renamed files.
|
||||||
|
|
||||||
|
|
||||||
## Hints
|
|
||||||
- If a folder becomes empty after a replication, it will be deleted by default. But you can toggle this behaviour. Check the [Settings](docs/settings.md).
|
|
||||||
- LiveSync mode drains more batteries in mobile devices. Periodic sync with some automatic sync is recommended.
|
|
||||||
- Mobile Obsidian can not connect to non-secure (HTTP) or locally-signed servers, even if the root certificate is installed on the device.
|
|
||||||
- There are no 'exclude_folders' like configurations.
|
|
||||||
- While synchronizing, files are compared by their modification time and the older ones will be overwritten by the newer ones. Then plugin checks for conflicts and if a merge is needed, a dialog will open.
|
|
||||||
- Rarely, a file in the database could be corrupted. The plugin will not write to local storage when a file looks corrupted. If a local version of the file is on your device, the corruption could be fixed by editing the local file and synchronizing it. But if the file does not exist on any of your devices, then it can not be rescued. In this case, you can delete these items from the settings dialog.
|
|
||||||
- To stop the boot-up sequence (eg. for fixing problems on databases), you can put a `redflag.md` file (or directory) at the root of your vault.
|
|
||||||
Tip for iOS: a redflag directory can be created at the root of the vault using the File application.
|
|
||||||
- Also, with `redflag2.md` placed, we can automatically rebuild both the local and the remote databases during the boot-up sequence. With `redflag3.md`, we can discard only the local database and fetch from the remote again.
|
|
||||||
- Q: The database is growing, how can I shrink it down?
|
|
||||||
A: each of the docs is saved with their past 100 revisions for detecting and resolving conflicts. Picturing that one device has been offline for a while, and comes online again. The device has to compare its notes with the remotely saved ones. If there exists a historic revision in which the note used to be identical, it could be updated safely (like git fast-forward). Even if that is not in revision histories, we only have to check the differences after the revision that both devices commonly have. This is like git's conflict-resolving method. So, We have to make the database again like an enlarged git repo if you want to solve the root of the problem.
|
|
||||||
- And more technical Information is in the [Technical Information](docs/tech_info.md)
|
|
||||||
- If you want to synchronize files without obsidian, you can use [filesystem-livesync](https://github.com/vrtmrz/filesystem-livesync).
|
|
||||||
- WebClipper is also available on Chrome Web Store:[obsidian-livesync-webclip](https://chrome.google.com/webstore/detail/obsidian-livesync-webclip/jfpaflmpckblieefkegjncjoceapakdf)
|
|
||||||
|
|
||||||
Repo is here: [obsidian-livesync-webclip](https://github.com/vrtmrz/obsidian-livesync-webclip). (Docs are a work in progress.)
|
## Tips and Troubleshooting
|
||||||
|
If you are having problems getting the plugin working see: [Tips and Troubleshooting](docs/troubleshooting.md)
|
||||||
## Troubleshooting
|
|
||||||
If you are having problems getting the plugin working see: [Troubleshooting](docs/troubleshooting.md)
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
@ -1,24 +1,50 @@
|
|||||||
|
<!-- For translation: 20240209r0 -->
|
||||||
# Setup CouchDB on fly.io
|
# Setup CouchDB on fly.io
|
||||||
|
|
||||||
In some cases, the use of IBM Cloudant was found to be hard. We looked for alternatives, but there were no services available. Therefore, we have to build our own servers, which is quite a challenge. In this situation, with fly.io, most of the processes are simplified and only CouchDB needs to be configured.
|
|
||||||
|
|
||||||
This is how to configure fly.io and CouchDB on it for Self-hosted LiveSync.
|
This is how to configure fly.io and CouchDB on it for Self-hosted LiveSync.
|
||||||
|
|
||||||
It generally falls within the `Free Allowances` range in most cases.
|
> [!WARNING]
|
||||||
|
> It is **your** instance. In Obsidian, we have files locally. Hence, do not hesitate to destroy the remote database if you feel something have got weird. We can launch and switch to the new CouchDB instance anytime[^1].
|
||||||
|
>
|
||||||
|
[^1]: Actually, I am always building the database for reproduction of the issue like so.
|
||||||
|
|
||||||
**[Automatic setup using Colaboratory](#automatic-setup-using-colaboratory) is recommended, after reading this document through. It is reproducible and hard to fail.**
|
> [!TIP] What and why is the Fly.io
|
||||||
|
> At some point, we started to experience problems related to our IBM Cloudant account. At the same time, Self-hosted LiveSync started to improve its functionality, requiring CouchDB in a more natural state to use all its features.
|
||||||
|
>
|
||||||
|
> Then we found Fly.io. Fly.io is the PaaS Platform, which can be useable for a very reasonable price. It generally falls within the `Free Allowances` range in most cases.
|
||||||
|
|
||||||
## Required materials
|
## Required materials
|
||||||
|
|
||||||
- A valid credit or debit card.
|
- A valid credit or debit card.
|
||||||
|
|
||||||
## Warning
|
## Setup CouchDB instance
|
||||||
|
|
||||||
- It will be `your` instance. Check the log regularly.
|
### A. Very automated setup
|
||||||
|
|
||||||
## Prerequisites
|
[![LiveSync Setup onto Fly.io SpeedRun 2024 using Google Colab](https://img.youtube.com/vi/7sa_I1832Xc/0.jpg)](https://www.youtube.com/watch?v=7sa_I1832Xc)
|
||||||
|
|
||||||
For simplicity, the following description assumes that the settings are as shown in the table below. Please read it in accordance with the actual settings you wish to make.
|
1. Open [setup-flyio-on-the-fly-v2.ipynb](../setup-flyio-on-the-fly-v2.ipynb).
|
||||||
|
2. Press the `Open in Colab` button.
|
||||||
|
3. Choose a region and run all blocks (Refer to video).
|
||||||
|
1. If you do not have the account yet, the sign-up page will be shown, please follow the instructions. The [Official document is here](https://fly.io/docs/hands-on/sign-up/).
|
||||||
|
4. Copy the Setup-URI and open it in the Obsidian.
|
||||||
|
5. You have been synchronised. Open the Setup-URI in subsequent devices.
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> Your automatically configured configurations will be shown on the result in the Colab note like below, and **it will not be saved**. Please make a note of it somewhere.
|
||||||
|
> ```
|
||||||
|
> -- YOUR CONFIGURATION --
|
||||||
|
> URL : https://billowing-dawn-6619.fly.dev
|
||||||
|
> username: billowing-cherry-22580
|
||||||
|
> password: misty-dew-13571
|
||||||
|
> region : nrt
|
||||||
|
> ```
|
||||||
|
|
||||||
|
### B. Scripted Setup
|
||||||
|
|
||||||
|
Please refer to the document of [deploy-server.sh](../utils/readme.md#deploy-serversh).
|
||||||
|
|
||||||
|
### C. Manual Setup
|
||||||
|
|
||||||
| Used in the text | Meaning and where to use | Memo |
|
| Used in the text | Meaning and where to use | Memo |
|
||||||
| ---------------- | --------------------------- | ------------------------------------------------------------------------ |
|
| ---------------- | --------------------------- | ------------------------------------------------------------------------ |
|
||||||
@ -26,11 +52,7 @@ For simplicity, the following description assumes that the settings are as shown
|
|||||||
| dfusiuada9suy | Password | |
|
| dfusiuada9suy | Password | |
|
||||||
| nrt | Region to make the instance | We can use any [region](https://fly.io/docs/reference/regions/) near us. |
|
| nrt | Region to make the instance | We can use any [region](https://fly.io/docs/reference/regions/) near us. |
|
||||||
|
|
||||||
## Steps with your computer
|
#### 1. Install flyctl
|
||||||
|
|
||||||
If you want to avoid installing anything, please skip to [Automatic setup using Colaboratory](#automatic-setup-using-colaboratory).
|
|
||||||
|
|
||||||
### 1. Install flyctl
|
|
||||||
|
|
||||||
- Mac or Linux
|
- Mac or Linux
|
||||||
|
|
||||||
@ -44,7 +66,7 @@ $ curl -L https://fly.io/install.sh | sh
|
|||||||
$ iwr https://fly.io/install.ps1 -useb | iex
|
$ iwr https://fly.io/install.ps1 -useb | iex
|
||||||
```
|
```
|
||||||
|
|
||||||
### 2. Sign up or Sign in to fly.io
|
#### 2. Sign up or Sign in to fly.io
|
||||||
|
|
||||||
- Sign up
|
- Sign up
|
||||||
|
|
||||||
@ -58,148 +80,90 @@ $ fly auth signup
|
|||||||
$ fly auth login
|
$ fly auth login
|
||||||
```
|
```
|
||||||
|
|
||||||
For more information, please refer [Sign up](https://fly.io/docs/hands-on/sign-up/) and [Sign in](https://fly.io/docs/hands-on/sign-in/).
|
For more information, please refer to [Sign up](https://fly.io/docs/hands-on/sign-up/) and [Sign in](https://fly.io/docs/hands-on/sign-in/).
|
||||||
|
|
||||||
### 3. Make configuration files
|
#### 3. Make a configuration file
|
||||||
|
|
||||||
Please be careful, `nrt` is the region where near to Japan. Please use your preferred region.
|
1. Make `fly.toml` from template `fly.template.toml`.
|
||||||
|
We can simply copy and rename the file. The template is on [utils/flyio/fly.template.toml](../utils/flyio/fly.template.toml)
|
||||||
|
2. Decide the instance name, initialize the App, and set credentials.
|
||||||
|
|
||||||
1. Make fly.toml
|
>[!TIP]
|
||||||
|
> - The name `billowing-dawn-6619` is randomly decided name, and it will be a part of the CouchDB URL. It should be globally unique. Therefore, it is recommended to use something random for this name.
|
||||||
|
> - Explicit naming is very good for humans. However, we do not often get the chance to actually enter this manually (have designed so). This database may contain important information for you. The needle should be hidden in the haystack.
|
||||||
|
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ fly launch --name=billowing-dawn-6619 --env="COUCHDB_USER=campanella" --copy-config=true --detach --no-deploy --region nrt --yes
|
||||||
|
$ fly secrets set COUCHDB_PASSWORD=dfusiuada9suy
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 4. Deploy
|
||||||
|
|
||||||
```
|
```
|
||||||
$ flyctl launch --generate-name --detach --no-deploy --region nrt
|
$ flyctl deploy
|
||||||
Creating app in /home/vrtmrz/dev/fly/demo
|
An existing fly.toml file was found
|
||||||
Scanning source code
|
Using build strategies '[the "couchdb:latest" docker image]'. Remove [build] from fly.toml to force a rescan
|
||||||
Could not find a Dockerfile, nor detect a runtime or framework from source code. Continuing with a blank app.
|
Creating app in /home/vorotamoroz/dev/obsidian-livesync/utils/flyio
|
||||||
automatically selected personal organization: vorotamoroz
|
We're about to launch your app on Fly.io. Here's what you're getting:
|
||||||
App will use 'nrt' region as primary
|
|
||||||
|
Organization: vorotamoroz (fly launch defaults to the personal org)
|
||||||
|
Name: billowing-dawn-6619 (specified on the command line)
|
||||||
|
Region: Tokyo, Japan (specified on the command line)
|
||||||
|
App Machines: shared-cpu-1x, 256MB RAM (specified on the command line)
|
||||||
|
Postgres: <none> (not requested)
|
||||||
|
Redis: <none> (not requested)
|
||||||
|
|
||||||
Created app 'billowing-dawn-6619' in organization 'personal'
|
Created app 'billowing-dawn-6619' in organization 'personal'
|
||||||
Admin URL: https://fly.io/apps/billowing-dawn-6619
|
Admin URL: https://fly.io/apps/billowing-dawn-6619
|
||||||
Hostname: billowing-dawn-6619.fly.dev
|
Hostname: billowing-dawn-6619.fly.dev
|
||||||
Wrote config file fly.toml
|
Wrote config file fly.toml
|
||||||
```
|
Validating /home/vorotamoroz/dev/obsidian-livesync/utils/flyio/fly.toml
|
||||||
|
Platform: machines
|
||||||
`billowing-dawn-6619` is an automatically generated name. It is used as the hostname. Please note it in something.
|
✓ Configuration is valid
|
||||||
Note: we can specify this without `--generate-name`, but does not recommend in the trial phases.
|
Your app is ready! Deploy with `flyctl deploy`
|
||||||
|
Secrets are staged for the first deployment
|
||||||
1. Make volume
|
|
||||||
|
|
||||||
```
|
|
||||||
$ flyctl volumes create --region nrt couchdata --size 2 --yes
|
|
||||||
ID: vol_g67340kxgmmvydxw
|
|
||||||
Name: couchdata
|
|
||||||
App: billowing-dawn-6619
|
|
||||||
Region: nrt
|
|
||||||
Zone: 35b7
|
|
||||||
Size GB: 2
|
|
||||||
Encrypted: true
|
|
||||||
Created at: 02 Jun 23 01:19 UTC
|
|
||||||
```
|
|
||||||
|
|
||||||
3. Edit fly.toml
|
|
||||||
Changes:
|
|
||||||
- Change exposing port from `8080` to `5984`
|
|
||||||
- Mounting the volume `couchdata` created in step 2 under `/opt/couchdb/data`
|
|
||||||
- Set `campanella` for the administrator of CouchDB
|
|
||||||
- Customise CouchDB to use persistent ini-file; which is located under the data directory.
|
|
||||||
- To use Dockerfile
|
|
||||||
|
|
||||||
```diff
|
|
||||||
# fly.toml app configuration file generated for billowing-dawn-6619 on 2023-06-02T10:18:59+09:00
|
|
||||||
#
|
|
||||||
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
|
|
||||||
#
|
|
||||||
|
|
||||||
app = "billowing-dawn-6619"
|
|
||||||
primary_region = "nrt"
|
|
||||||
|
|
||||||
[http_service]
|
|
||||||
- internal_port = 8080
|
|
||||||
+ internal_port = 5984
|
|
||||||
force_https = true
|
|
||||||
auto_stop_machines = true
|
|
||||||
auto_start_machines = true
|
|
||||||
min_machines_running = 0
|
|
||||||
|
|
||||||
+[mounts]
|
|
||||||
+ source="couchdata"
|
|
||||||
+ destination="/opt/couchdb/data"
|
|
||||||
+
|
|
||||||
+[env]
|
|
||||||
+ COUCHDB_USER = "campanella"
|
|
||||||
+ ERL_FLAGS="-couch_ini /opt/couchdb/etc/default.ini /opt/couchdb/etc/default.d/ /opt/couchdb/etc/local.d /opt/couchdb/etc/local.ini /opt/couchdb/data/persistence.ini"
|
|
||||||
+
|
|
||||||
+[build]
|
|
||||||
+ dockerfile = "./Dockerfile"
|
|
||||||
```
|
|
||||||
|
|
||||||
4. Make `Dockerfile`
|
|
||||||
Create a Dockerfile that patches the start-up script to fix ini file permissions.
|
|
||||||
|
|
||||||
```dockerfile
|
|
||||||
FROM couchdb:latest
|
|
||||||
RUN sed -i '2itouch /opt/couchdb/data/persistence.ini && chmod +w /opt/couchdb/data/persistence.ini' /docker-entrypoint.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
5. Set credential
|
|
||||||
|
|
||||||
```
|
|
||||||
flyctl secrets set COUCHDB_PASSWORD=dfusiuada9suy
|
|
||||||
```
|
|
||||||
|
|
||||||
### 4. Deploy
|
|
||||||
|
|
||||||
```
|
|
||||||
$ flyctl deploy --detach --remote-only
|
|
||||||
==> Verifying app config
|
==> Verifying app config
|
||||||
Validating /home/vrtmrz/dev/fly/demo/fly.toml
|
Validating /home/vorotamoroz/dev/obsidian-livesync/utils/flyio/fly.toml
|
||||||
Platform: machines
|
Platform: machines
|
||||||
✓ Configuration is valid
|
✓ Configuration is valid
|
||||||
--> Verified app config
|
--> Verified app config
|
||||||
==> Building image
|
==> Building image
|
||||||
Remote builder fly-builder-bold-sky-4515 ready
|
Searching for image 'couchdb:latest' remotely...
|
||||||
==> Creating build context
|
image found: img_ox20prk63084j1zq
|
||||||
--> Creating build context done
|
|
||||||
==> Building image with Docker
|
|
||||||
--> docker host: 20.10.12 linux x86_64
|
|
||||||
|
|
||||||
-------------:SNIPPED:-------------
|
Watch your deployment at https://fly.io/apps/billowing-dawn-6619/monitoring
|
||||||
|
|
||||||
Watch your app at https://fly.io/apps/billowing-dawn-6619/monitoring
|
|
||||||
|
|
||||||
Provisioning ips for billowing-dawn-6619
|
Provisioning ips for billowing-dawn-6619
|
||||||
Dedicated ipv6: 2a09:8280:1::2d:240f
|
Dedicated ipv6: 2a09:8280:1::37:fde9
|
||||||
Shared ipv4: 66.241.125.213
|
Shared ipv4: 66.241.124.163
|
||||||
Add a dedicated ipv4 with: fly ips allocate-v4
|
Add a dedicated ipv4 with: fly ips allocate-v4
|
||||||
|
|
||||||
|
Creating a 1 GB volume named 'couchdata' for process group 'app'. Use 'fly vol extend' to increase its size
|
||||||
This deployment will:
|
This deployment will:
|
||||||
* create 1 "app" machine
|
* create 1 "app" machine
|
||||||
|
|
||||||
No machines in group app, launching a new machine
|
No machines in group app, launching a new machine
|
||||||
Machine e7845d1f297183 [app] has state: started
|
|
||||||
|
WARNING The app is not listening on the expected address and will not be reachable by fly-proxy.
|
||||||
|
You can fix this by configuring your app to listen on the following addresses:
|
||||||
|
- 0.0.0.0:5984
|
||||||
|
Found these processes inside the machine with open listening sockets:
|
||||||
|
PROCESS | ADDRESSES
|
||||||
|
-----------------*---------------------------------------
|
||||||
|
/.fly/hallpass | [fdaa:0:73b9:a7b:22e:3851:7f28:2]:22
|
||||||
|
|
||||||
Finished launching new machines
|
Finished launching new machines
|
||||||
|
|
||||||
NOTE: The machines for [app] have services with 'auto_stop_machines = true' that will be stopped when idling
|
NOTE: The machines for [app] have services with 'auto_stop_machines = true' that will be stopped when idling
|
||||||
|
|
||||||
|
-------
|
||||||
|
Checking DNS configuration for billowing-dawn-6619.fly.dev
|
||||||
|
|
||||||
|
Visit your newly deployed app at https://billowing-dawn-6619.fly.dev/
|
||||||
```
|
```
|
||||||
|
|
||||||
Now your CouchDB has been launched. (Do not forget to delete it if no longer need).
|
#### 5. Apply CouchDB configuration
|
||||||
If failed, please check by `flyctl doctor`. Failure of remote build may be resolved by `flyctl` wireguard reset` or something.
|
|
||||||
|
|
||||||
```
|
|
||||||
$ flyctl status
|
|
||||||
App
|
|
||||||
Name = billowing-dawn-6619
|
|
||||||
Owner = personal
|
|
||||||
Hostname = billowing-dawn-6619.fly.dev
|
|
||||||
Image = billowing-dawn-6619:deployment-01H1WWB3CK5Z9ZX71KHBSDGHF1
|
|
||||||
Platform = machines
|
|
||||||
|
|
||||||
Machines
|
|
||||||
PROCESS ID VERSION REGION STATE CHECKS LAST UPDATED
|
|
||||||
app e7845d1f297183 1 nrt started 2023-06-02T01:43:34Z
|
|
||||||
```
|
|
||||||
|
|
||||||
### 5. Apply CouchDB configuration
|
|
||||||
|
|
||||||
After the initial setup, CouchDB needs some more customisations to be used from Self-hosted LiveSync. It can be configured in browsers or by HTTP-REST APIs.
|
After the initial setup, CouchDB needs some more customisations to be used from Self-hosted LiveSync. It can be configured in browsers or by HTTP-REST APIs.
|
||||||
|
|
||||||
@ -273,15 +237,13 @@ iwr -UseBasicParsing -Method 'PUT' -ContentType 'application/json; charset=utf-8
|
|||||||
|
|
||||||
Note: Each of these should also be repeated until finished in 200.
|
Note: Each of these should also be repeated until finished in 200.
|
||||||
|
|
||||||
### 6. Use it from Self-hosted LiveSync
|
#### 6. Use it from Self-hosted LiveSync
|
||||||
|
|
||||||
Now the CouchDB is ready to use from Self-hosted LiveSync. We can use `https://billowing-dawn-6619.fly.dev` in URI, `campanella` in `Username` and `dfusiuada9suy` in `Password` on Self-hosted LiveSync. `Database name` could be anything you want.
|
Now the CouchDB is ready to use from Self-hosted LiveSync. We can use `https://billowing-dawn-6619.fly.dev` in URI, `campanella` in `Username` and `dfusiuada9suy` in `Password` on Self-hosted LiveSync. `Database name` could be anything you want.
|
||||||
`Enhance chunk size` could be up to around `100`.
|
`Enhance chunk size` could be up to around `100`.
|
||||||
|
|
||||||
## Automatic setup using Colaboratory
|
## Delete the Instance
|
||||||
|
|
||||||
We can perform all these steps by using [this Colaboratory notebook](/deploy_couchdb_to_flyio_v2_with_swap.ipynb) without installing anything.
|
If you want to delete the CouchDB instance, you can do that in [fly.io Dashboard](https://fly.io/dashboard/personal)
|
||||||
|
|
||||||
## After testing / before creating a new instance
|
If you have done with [B. Scripted Setup](#b-scripted-setup), we can use [delete-server.sh](../utils/readme.md#delete-serversh).
|
||||||
|
|
||||||
**Be sure to delete the instance. We can check instances on the [Dashboard](https://fly.io/dashboard/personal)**
|
|
@ -1,12 +1,25 @@
|
|||||||
# Info
|
<!-- -->
|
||||||
In this document some tips for solving issues will be given.
|
# Tips and Troubleshooting
|
||||||
|
|
||||||
|
## Tips
|
||||||
|
- If a folder becomes empty after a replication, it will be deleted by default. But you can toggle this behaviour. Check the [Settings](docs/settings.md).
|
||||||
|
- LiveSync mode drains more batteries in mobile devices. Periodic sync with some automatic sync is recommended.
|
||||||
|
- Mobile Obsidian can not connect to non-secure (HTTP) or locally-signed servers, even if the root certificate is installed on the device.
|
||||||
|
- There are no 'exclude_folders' like configurations.
|
||||||
|
- While synchronizing, files are compared by their modification time and the older ones will be overwritten by the newer ones. Then plugin checks for conflicts and if a merge is needed, a dialog will open.
|
||||||
|
- Rarely, a file in the database could be corrupted. The plugin will not write to local storage when a file looks corrupted. If a local version of the file is on your device, the corruption could be fixed by editing the local file and synchronizing it. But if the file does not exist on any of your devices, then it can not be rescued. In this case, you can delete these items from the settings dialog.
|
||||||
|
- To stop the boot-up sequence (eg. for fixing problems on databases), you can put a `redflag.md` file (or directory) at the root of your vault.
|
||||||
|
Tip for iOS: a redflag directory can be created at the root of the vault using the File application.
|
||||||
|
- Also, with `redflag2.md` placed, we can automatically rebuild both the local and the remote databases during the boot-up sequence. With `redflag3.md`, we can discard only the local database and fetch from the remote again.
|
||||||
|
- Q: The database is growing, how can I shrink it down?
|
||||||
|
A: each of the docs is saved with their past 100 revisions for detecting and resolving conflicts. Picturing that one device has been offline for a while, and comes online again. The device has to compare its notes with the remotely saved ones. If there exists a historic revision in which the note used to be identical, it could be updated safely (like git fast-forward). Even if that is not in revision histories, we only have to check the differences after the revision that both devices commonly have. This is like git's conflict-resolving method. So, We have to make the database again like an enlarged git repo if you want to solve the root of the problem.
|
||||||
|
- And more technical Information is in the [Technical Information](docs/tech_info.md)
|
||||||
|
- If you want to synchronize files without obsidian, you can use [filesystem-livesync](https://github.com/vrtmrz/filesystem-livesync).
|
||||||
|
- WebClipper is also available on Chrome Web Store:[obsidian-livesync-webclip](https://chrome.google.com/webstore/detail/obsidian-livesync-webclip/jfpaflmpckblieefkegjncjoceapakdf)
|
||||||
|
|
||||||
|
Repo is here: [obsidian-livesync-webclip](https://github.com/vrtmrz/obsidian-livesync-webclip). (Docs are a work in progress.)
|
||||||
|
|
||||||
|
|
||||||
# Issue with syncing with mobile device
|
## Troubleshooting
|
||||||
- If you are getting problem like could not sync files when doing initial sync. Try lower batch size
|
|
||||||
- Open setting
|
**Work in progress**
|
||||||
- Open Live Sync settings
|
|
||||||
- Go to sync settings
|
|
||||||
- Go down to Advanced settings.
|
|
||||||
- Lower "Batch size" and "Batch limit" and try to sync again.
|
|
||||||
- If you keep getting error keep lowering until you find the sweet spot.
|
|
Loading…
Reference in New Issue
Block a user