-
Notifications
You must be signed in to change notification settings - Fork 5
/
obsidian-livesync.yml
91 lines (80 loc) · 3.23 KB
/
obsidian-livesync.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
---
- hosts: homelab
vars:
application: obsidian-livesync
docker_network: "{{ networks.pub }}"
handlers:
- name: Restart
community.docker.docker_container:
name: "{{ application }}"
restart: true
comparisons:
'*': ignore
tasks:
- name: Create config folder
ansible.builtin.file:
path: "{{ config_directory }}"
state: directory
owner: "{{ common_user }}"
group: "{{ common_root_group }}"
mode: "0771"
- name: Create config
ansible.builtin.copy:
content: |
[couchdb]
single_node=true
max_document_size = 50000000
[chttpd]
require_valid_user = true
max_http_request_size = 4294967296
enable_cors = true
require_valid_user_except_for_up = true
[chttpd_auth]
require_valid_user = true
authentication_redirect = /_utils/session.html
[httpd]
enable_cors = true
WWW-Authenticate = Basic realm="couchdb"
bind_address = 0.0.0.0
[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
dest: "{{ config_directory }}/local.ini"
owner: "{{ common_user }}"
group: "{{ common_root_group }}"
mode: "0744"
- name: Create container
ansible.builtin.include_role:
name: docker_container
vars:
image: couchdb:3
env:
COUCHDB_USER: "{{ application }}"
COUCHDB_PASSWORD: !vault |
$ANSIBLE_VAULT;1.1;AES256
32366137623936373238383264666631333936616362323639326436623365363065386431313865
6138353136356430303034356264356331343163333064310a373363383464396338656336653933
37633130303637663464336363656230393036316266383431303632376637323266323639316465
3739303630363030320a356136613762643765643438396138306565323166663435366432643761
62323232313762353862356562353633633134666431633434313431316536633764
volumes:
- "{{ config_directory }}/data:/opt/couchdb/data"
- "{{ config_directory }}/local.ini:/opt/couchdb/etc/local.ini"
traefik:
- port: 5984
middlewares:
- "{{ application }}-cors"
blackbox:
path: /_up
labels:
'{
"traefik.http.middlewares.{{ application }}-cors.headers.accesscontrolallowmethods": "GET,PUT,POST,HEAD,DELETE",
"traefik.http.middlewares.{{ application }}-cors.headers.accesscontrolallowheaders": "accept,authorization,content-type,origin,referer",
"traefik.http.middlewares.{{ application }}-cors.headers.accesscontrolalloworiginlist": "app://obsidian.md,capacitor://localhost,http://localhost",
"traefik.http.middlewares.{{ application }}-cors.headers.accesscontrolmaxage": "3600",
"traefik.http.middlewares.{{ application }}-cors.headers.addvaryheader": "true",
"traefik.http.middlewares.{{ application }}-cors.headers.accessControlAllowCredentials": "true"
}'