Browse Source

README

tags/v1.0.0
Robin Thoni 5 years ago
parent
commit
4ac1b8a62c
1 changed files with 142 additions and 0 deletions
  1. 142
    0
      README.md

+ 142
- 0
README.md View File

@@ -0,0 +1,142 @@
1
+## Abstract
2
+
3
+This docker-compose allows to easily run a Nextcloud instance with Collabora.
4
+
5
+## Prerequisites for production use
6
+
7
+- Domain records:
8
+  - One record for Nextcloud (eg: `nextcloud.example.com`)
9
+  - One record for Collabora (eg: `collabora.example.com`)
10
+  - BOTH records must be (resolvable AND accessible) from (Nextcloud container AND Collabora container AND final users)
11
+- HTTPS for Nextcloud and Collabora (eg: [Let’s Encrypt](https://letsencrypt.org/))
12
+- Reverse proxy for SSL termination
13
+
14
+## Installation
15
+
16
+### Tweak files
17
+
18
+- `env`
19
+  - Set `TZ`
20
+    - The timezone to be used in the container (See [List_of_tz_database_time_zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones))
21
+    - Example: `Europe/Paris`
22
+  - Generate secure password for `POSTGRES_PASSWORD`
23
+    - Password to be set (and used) for the Nextcloud database user. It will only be set when postgres files (`./data/postgres/data/...`) are created. Any further change won't update it.
24
+    - Example: [passwordsgenerator.net](https://passwordsgenerator.net/)
25
+  - Generate secure password for `NEXTCLOUD_ADMIN_PASSWORD`
26
+    - Password to be set for Nextcloud `root` user. It will only be set when Nextcloud will install itself. Any further change won't update it.
27
+    - Example: [passwordsgenerator.net](https://passwordsgenerator.net/)
28
+
29
+- `env_collabora`
30
+  - Set `domain`
31
+    - Regexp for domain(s) allowed to used Collabora. It must match your Nextcloud domain.
32
+    - Example: `nextcloud\.example\.com` (Note the backslashes to escape the dots)
33
+  - Generate secure password for `password`
34
+    - Password to be set for Collabora admin panel (https://collabora.example.com/loleaflet/dist/admin/admin.html)
35
+    - Example: [passwordsgenerator.net](https://passwordsgenerator.net/)
36
+
37
+- `docker-compose.yml`
38
+  - Set restart policies
39
+    - Uncomment `restart` lines to allow docker to automatically start the containers on reboot.
40
+
41
+### Reverse proxy
42
+
43
+`/etc/apache2/sites-available/nextcloud.example.com.conf`:
44
+```
45
+<IfModule mod_ssl.c>
46
+    <VirtualHost *:80>
47
+        ServerName nextcloud.example.com
48
+        Redirect permanent / https://nextcloud.example.com/
49
+    </VirtualHost>
50
+    <VirtualHost *:443>
51
+        Include sites-available/nextcloud.example.com.include
52
+
53
+        SSLEngine on
54
+        SSLCertificateFile /etc/letsencrypt/live/example.com/cert.pem
55
+        SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
56
+        SSLCertificateChainFile /etc/letsencrypt/live/example.com/chain.pem
57
+    </VirtualHost>
58
+</IfModule>
59
+<IfModule !mod_ssl.c>
60
+    <VirtualHost *:80>
61
+        Include sites-available/nextcloud.example.com.include
62
+    </VirtualHost>
63
+</IfModule>
64
+```
65
+
66
+`/etc/apache2/sites-available/nextcloud.example.com.include`:
67
+```
68
+ServerName nextcloud.example.com
69
+ServerAlias nextcloud.example.com
70
+ProxyPreserveHost On
71
+ProxyRequests off
72
+ProxyPass / http://127.0.0.1:35081/
73
+ProxyPassReverse / http://127.0.0.1:35081/
74
+
75
+```
76
+
77
+`/etc/apache2/sites-available/collabora.example.com.conf`:
78
+```
79
+<IfModule mod_ssl.c>
80
+    <VirtualHost *:80>
81
+        ServerName collabora.example.com
82
+        Redirect permanent / https://collabora.example.com/
83
+    </VirtualHost>
84
+    <VirtualHost *:443>
85
+        Include sites-available/collabora.example.com.include
86
+
87
+        SSLEngine on
88
+        SSLCertificateFile /etc/letsencrypt/live/example.com/cert.pem
89
+        SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
90
+        SSLCertificateChainFile /etc/letsencrypt/live/example.com/chain.pem
91
+    </VirtualHost>
92
+</IfModule>
93
+<IfModule !mod_ssl.c>
94
+    <VirtualHost *:80>
95
+        Include sites-available/collabora.example.com.include
96
+    </VirtualHost>
97
+</IfModule>
98
+
99
+```
100
+
101
+`/etc/apache2/sites-available/collabora.example.com.include`:
102
+```
103
+ServerName collabora.example.com
104
+ServerAlias collabora.example.com
105
+ProxyPreserveHost On
106
+ProxyRequests off
107
+
108
+AllowEncodedSlashes NoDecode
109
+
110
+# Order of ProxyPass matters
111
+
112
+ProxyPassMatch "/lool/(.*)/ws$" ws://127.0.0.1:35082/lool/$1/ws nocanon
113
+ProxyPass   /lool/adminws ws://127.0.0.1:35082/lool/adminws
114
+
115
+ProxyPass / http://127.0.0.1:35082/
116
+ProxyPassReverse / http://127.0.0.1:35082/
117
+
118
+```
119
+
120
+### Run
121
+
122
+```
123
+docker-compose up --build -d
124
+```
125
+
126
+### Install Nextcloud integration app
127
+
128
+- Login on Nextcloud with `root` account
129
+- Go to Upper right `account picture` / `Apps` / Upper right `search` icon
130
+- Type `Collabora Online`
131
+- Click `Download and enable`
132
+- Wait for installation to finish
133
+- Go to Upper right `account picture` / `Settings` / Lower left `Collabora Online`
134
+- Set your Collabora URL (eg: `https://collabora.example.com`)
135
+- Click `Apply`
136
+- Go back to Files
137
+- Click `+`
138
+- Click `New Document`
139
+- Type a name
140
+- Validate
141
+- Click the newly created document
142
+- Enjoy

Loading…
Cancel
Save