mirror of
https://github.com/muerwre/muerwre.github.io.git
synced 2025-04-25 02:46:39 +07:00
vault backup: 2022-11-09 16:15:51
This commit is contained in:
parent
3246c87c51
commit
bf74240684
2 changed files with 110 additions and 5 deletions
|
@ -25,19 +25,35 @@
|
||||||
inkscape:deskcolor="#505050"
|
inkscape:deskcolor="#505050"
|
||||||
inkscape:document-units="px"
|
inkscape:document-units="px"
|
||||||
showgrid="false"
|
showgrid="false"
|
||||||
inkscape:zoom="1.6099906"
|
inkscape:zoom="1.4954284"
|
||||||
inkscape:cx="131.67779"
|
inkscape:cx="194.59307"
|
||||||
inkscape:cy="87.267591"
|
inkscape:cy="210.97633"
|
||||||
inkscape:window-width="1440"
|
inkscape:window-width="1440"
|
||||||
inkscape:window-height="847"
|
inkscape:window-height="847"
|
||||||
inkscape:window-x="0"
|
inkscape:window-x="0"
|
||||||
inkscape:window-y="25"
|
inkscape:window-y="25"
|
||||||
inkscape:window-maximized="1"
|
inkscape:window-maximized="1"
|
||||||
inkscape:current-layer="g409" /><defs
|
inkscape:current-layer="layer1" /><defs
|
||||||
id="defs520" /><g
|
id="defs520" /><g
|
||||||
inkscape:label="Слой 1"
|
inkscape:label="Слой 1"
|
||||||
inkscape:groupmode="layer"
|
inkscape:groupmode="layer"
|
||||||
id="layer1"><g
|
id="layer1"><rect
|
||||||
|
style="opacity:0.294393;fill:#000000;stroke:none;stroke-width:1.05833;stroke-linecap:round"
|
||||||
|
id="rect7078"
|
||||||
|
width="80.502289"
|
||||||
|
height="30.608562"
|
||||||
|
x="6.1924839"
|
||||||
|
y="40.597416"
|
||||||
|
rx="3.1066074"
|
||||||
|
ry="3.1066074" /><rect
|
||||||
|
style="opacity:0.294393;fill:#000000;stroke:none;stroke-width:1.05833;stroke-linecap:round"
|
||||||
|
id="rect9634"
|
||||||
|
width="80.502289"
|
||||||
|
height="30.608562"
|
||||||
|
x="22.067482"
|
||||||
|
y="5.1432528"
|
||||||
|
rx="3.1066074"
|
||||||
|
ry="3.1066074" /><g
|
||||||
id="g4098"
|
id="g4098"
|
||||||
transform="matrix(0.90821066,0,0,0.91196035,12.590479,26.557309)"
|
transform="matrix(0.90821066,0,0,0.91196035,12.590479,26.557309)"
|
||||||
style="stroke-width:1.0988"><rect
|
style="stroke-width:1.0988"><rect
|
||||||
|
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 24 KiB |
89
content/Obsidian/Self-hosted Obsidian sync with CouchDB.md
Normal file
89
content/Obsidian/Self-hosted Obsidian sync with CouchDB.md
Normal file
|
@ -0,0 +1,89 @@
|
||||||
|
- [Main documentation](https://github.com/vrtmrz/obsidian-livesync)
|
||||||
|
- [Setting up couchdb](https://github.com/vrtmrz/obsidian-livesync/blob/main/docs/setup_own_server.md)
|
||||||
|
|
||||||
|
## Setting up environment
|
||||||
|
|
||||||
|
First, you should create `docker-compose.yml` with the following contents:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
couchserver:
|
||||||
|
container_name: obsidian__database
|
||||||
|
image: couchdb
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "5984:5984"
|
||||||
|
environment:
|
||||||
|
- COUCHDB_USER=user
|
||||||
|
- COUCHDB_PASSWORD=somepassword
|
||||||
|
volumes:
|
||||||
|
- ./couchdb/dbdata:/opt/couchdb/data
|
||||||
|
- ./couchdb/local.ini:/opt/couchdb/etc/local.ini
|
||||||
|
```
|
||||||
|
|
||||||
|
Then create initial config at `./couchdb/local.ini`:
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[couchdb]
|
||||||
|
single_node=true
|
||||||
|
max_document_size=50000000
|
||||||
|
max_http_request_size=4294967296
|
||||||
|
|
||||||
|
[chttpd]
|
||||||
|
require_valid_user = true
|
||||||
|
|
||||||
|
[chttpd_auth]
|
||||||
|
require_valid_user = true
|
||||||
|
authentication_redirect = /_utils/session.html
|
||||||
|
|
||||||
|
[httpd]
|
||||||
|
WWW-Authenticate = Basic realm="couchdb"
|
||||||
|
enable_cors = true
|
||||||
|
|
||||||
|
[cors]
|
||||||
|
origins = app://obsidian.md,capacitor://localhost,http://localhost
|
||||||
|
credentials = true
|
||||||
|
headers = accept, authorization, content-type, origin, referer
|
||||||
|
methods = GET, PUT, POST, HEAD, DELETE
|
||||||
|
max_age = 3600
|
||||||
|
```
|
||||||
|
|
||||||
|
Then, in order to have sync on mobile devices, we will need a reverse proxy with nginx at `/etc/nginx/sites-enabled/obsidian-couchdb`:
|
||||||
|
|
||||||
|
```nginx
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
server_name couchdb.yourhost.com;
|
||||||
|
return 301 https://$host$request_uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 443 ssl http2;
|
||||||
|
listen [::]:443 ssl http2;
|
||||||
|
|
||||||
|
ssl_certificate /etc/letsencrypt/live/yourhost.com/fullchain.pem; # managed by Certbot
|
||||||
|
ssl_certificate_key /etc/letsencrypt/live/yourhost.com/privkey.pem; # managed by Certbot
|
||||||
|
ssl_trusted_certificate /etc/letsencrypt/live/yourhost.com/chain.pem;
|
||||||
|
|
||||||
|
server_name couchdb.yourhost.com;
|
||||||
|
client_max_body_size 200M;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_redirect off;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
|
||||||
|
proxy_pass http://127.0.0.1:5984;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Setting up Obsidian
|
||||||
|
|
||||||
|
1. Install `Self-hosted LiveSync` plugin
|
||||||
|
2. Change host to `https://yourhost.com`
|
||||||
|
3. Specify username and password
|
||||||
|
4. Press `test`, then `fetch database`
|
Loading…
Add table
Add a link
Reference in a new issue