Skip to content

Commit 3524764

Browse files
authored
Merge pull request SensorsIot#530 from Paraphraser/20220327-nextcloud-doco-master
20220327 NextCloud documentation
2 parents 7498d4b + 1f74ed2 commit 3524764

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

docs/Containers/NextCloud.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Nextcloud
22

3-
## Service definition
3+
## <a name="serviceDefinition"></a>Service definition
44

55
This is the **core** of the IOTstack Nextcloud service definition:
66

7-
```yml
7+
``` { .yaml linenums="1" }
88
nextcloud:
99
container_name: nextcloud
1010
image: nextcloud
@@ -54,45 +54,45 @@ Under new-menu, the menu can generate random passwords for you. You can either u
5454

5555
The passwords need to be set before you bring up the Nextcloud service for the first time but the following initialisation steps assume you might not have done that and always start over from a clean slate.
5656

57-
## Initialising Nextcloud
57+
## <a name="initialisation"></a>Initialising Nextcloud
5858

5959
1. Be in the correct directory:
6060

61-
```
61+
```console
6262
$ cd ~/IOTstack
6363
```
6464

6565
2. If the stack is running, take it down:
6666

67-
```
67+
```console
6868
$ docker-compose down
6969
```
7070

7171
3. Erase the persistent storage area for Nextcloud (double-check the command *before* you hit return):
7272

73-
```
73+
```console
7474
$ sudo rm -rf ./volumes/nextcloud
7575
```
7676

7777
This is done to force re-initialisation. In particular, it gives you assurance that the passwords in your `docker-compose.yml` are the ones that are actually in effect.
7878

7979
4. Bring up the stack:
8080

81-
```
81+
```console
8282
$ docker-compose up -d
8383
```
8484

8585
5. Check for errors:
8686

8787
Repeat the following command two or three times at 10-second intervals:
8888

89-
```
89+
```console
9090
$ docker ps
9191
```
9292

9393
You are looking for evidence that the `nextcloud` and `nextcloud_db` containers are up, stable, and not restarting. If you see any evidence of restarts, try to figure out why using:
9494

95-
```
95+
```console
9696
$ docker logs nextcloud
9797
```
9898

@@ -108,7 +108,7 @@ The passwords need to be set before you bring up the Nextcloud service for the f
108108

109109
* You **can't** use a multicast domain name (eg `myrpi.local`). An mDNS name will not work until Nextcloud has been initialised!
110110
* Once you have picked a connection method, **STICK TO IT**.
111-
* You are only stuck with this restriction until Nextcloud has been initialised. You **can** (and should) fix it later by completing the steps in ["Access through untrusted domain"](#access-through-untrusted-domain).
111+
* You are only stuck with this restriction until Nextcloud has been initialised. You **can** (and should) fix it later by completing the steps in ["Access through untrusted domain"](#untrustedDomain).
112112

113113
7. On a computer that is **not** the Raspberry Pi running Nextcloud, launch a browser and point to the Raspberry Pi running Nextcloud using your chosen connection method. Examples:
114114

@@ -174,7 +174,7 @@ The passwords need to be set before you bring up the Nextcloud service for the f
174174

175175
![Dashboard](./images/nextcloud-dashboard.png)
176176

177-
## <a name="untrustedDomain">"Access through untrusted domain"</a>
177+
## <a name="untrustedDomain"></a>"Access through untrusted domain"
178178

179179
During Nextcloud initialisation you had to choose between an IP address, a domain name or a host name. Now that Nextcloud is running, you have the opportunity to expand your connection options.
180180

@@ -211,7 +211,7 @@ Hint:
211211

212212
* It is a good idea to make a backup of any file before you edit it. For example:
213213

214-
```
214+
```console
215215
$ cd ~/IOTstack/volumes/nextcloud/html/config/
216216
$ sudo cp config.php config.php.bak
217217
```
@@ -232,7 +232,7 @@ Search for "trusted_domains". To tell Nextcloud to trust **all** of the URLs abo
232232
233233
Once you have finished editing the file, save your work then restart Nextcloud:
234234

235-
```
235+
```console
236236
$ cd ~/IOTstack
237237
$ docker-compose restart nextcloud
238238
```
@@ -243,7 +243,7 @@ See also:
243243

244244
* [Nextcloud documentation - trusted domains](https://docs.nextcloud.com/server/21/admin_manual/installation/installation_wizard.html#trusted-domains).
245245

246-
### Using a DNS alias for your Nextcloud service
246+
### <a name="dnsAlias"></a>Using a DNS alias for your Nextcloud service
247247

248248
The examples above include using a DNS alias (a CNAME record) for your Nextcloud service. If you decide to do that, you may see this warning in the log:
249249

@@ -253,25 +253,25 @@ Could not reliably determine the server's fully qualified domain name
253253

254254
You can silence the warning by editing the Nextcloud service definition in `docker-compose.yml` to add your fully-qualified DNS alias to at `hostname` directive. For example:
255255

256-
```
256+
```yaml
257257
hostname: nextcloud.mydomain.com
258258
```
259259
260-
## <a name="security"> Security considerations</a>
260+
## <a name="security"></a>Security considerations
261261
262262
Nextcloud traffic is not encrypted. Do **not** expose it to the web by opening a port on your home router. Instead, use a VPN like Wireguard to provide secure access to your home network, and let your remote clients access Nextcloud over the VPN tunnel.
263263
264-
## Container health check
264+
## <a name="healthCheck"></a>Container health check
265265
266266
A script , or "agent", to assess the health of the MariaDB container has been added to the *local image* via the *Dockerfile*. In other words, the script is specific to IOTstack.
267267
268268
Because it is an instance of MariaDB, Nextcloud_DB inherits the health-check agent. See the [IOTstack MariaDB](MariaDB.md) documentation for more information.
269269
270-
## Keeping Nextcloud up-to-date
270+
## <a name="updatingNextcloud"></a>Keeping Nextcloud up-to-date
271271
272272
To update the `nextcloud` container:
273273

274-
```
274+
```console
275275
$ cd ~/IOTstack
276276
$ docker-compose pull nextcloud
277277
$ docker-compose up -d nextcloud
@@ -280,7 +280,7 @@ $ docker system prune
280280

281281
To update the `nextcloud_db` container:
282282

283-
```
283+
```console
284284
$ cd ~/IOTstack
285285
$ docker-compose build --no-cache --pull nextcloud_db
286286
$ docker-compose up -d nextcloud_db
@@ -290,15 +290,15 @@ $ docker system prune
290290

291291
The first "prune" removes the old *local* image, the second removes the old *base* image. Whether an old *base image* exists depends on the version of `docker-compose` you are using and how your version of `docker-compose` builds local images.
292292

293-
## Backups
293+
## <a name="backups"></a>Backups
294294

295295
Nextcloud is currently excluded from the IOTstack-supplied backup scripts due to its potential size.
296296

297297
> This is also true for [Paraphraser/IOTstackBackup](https://github.com/Paraphraser/IOTstackBackup).
298298

299299
If you want to take a backup, something like the following will get the job done:
300300

301-
```
301+
```console
302302
$ cd ~/IOTstack
303303
$ BACKUP_TAR_GZ=$PWD/backups/$(date +"%Y-%m-%d_%H%M").$HOSTNAME.nextcloud-backup.tar.gz
304304
$ touch "$BACKUP_TAR_GZ"
@@ -314,7 +314,7 @@ Notes:
314314

315315
To restore, you first need to identify the name of the backup file by looking in the `backups` directory. Then:
316316

317-
```
317+
```console
318318
$ cd ~/IOTstack
319319
$ RESTORE_TAR_GZ=$PWD/backups/2021-06-12_1321.sec-dev.nextcloud-backup.tar.gz
320320
$ docker-compose rm --force --stop -v nextcloud nextcloud_db

0 commit comments

Comments
 (0)