Skip to content

Commit f57289d

Browse files
authored
Merge pull request #365 from Paraphraser/20210612-nextcloud-old-menu
Nextcloud - consistent service definition - old-menu - 2 of 3
2 parents 7c35590 + c78286f commit f57289d

File tree

2 files changed

+19
-72
lines changed

2 files changed

+19
-72
lines changed

.templates/nextcloud/service.yml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
11
nextcloud:
2-
image: nextcloud
32
container_name: nextcloud
3+
image: nextcloud
4+
restart: unless-stopped
5+
environment:
6+
- MYSQL_HOST=nextcloud_db
7+
- MYSQL_PASSWORD=user_password
8+
- MYSQL_DATABASE=nextcloud
9+
- MYSQL_USER=nextcloud
410
ports:
511
- "9321:80"
612
volumes:
713
- ./volumes/nextcloud/html:/var/www/html
8-
restart: unless-stopped
9-
depends_on:
10-
- nextcloud_db
11-
links:
14+
depends_on:
1215
- nextcloud_db
1316

1417
nextcloud_db:
15-
image: linuxserver/mariadb
1618
container_name: nextcloud_db
17-
volumes:
18-
- ./volumes/nextcloud/db:/config
19+
image: ghcr.io/linuxserver/mariadb
20+
restart: unless-stopped
1921
environment:
20-
- MYSQL_ROOT_PASSWORD=password
21-
- MYSQL_PASSWORD=password
22+
- TZ=Etc/UTC
23+
- PUID=1000
24+
- PGID=1000
25+
- MYSQL_ROOT_PASSWORD=root_password
26+
- MYSQL_PASSWORD=user_password
2227
- MYSQL_DATABASE=nextcloud
2328
- MYSQL_USER=nextcloud
24-
restart: unless-stopped
29+
volumes:
30+
- ./volumes/nextcloud/db:/config

docs/Containers/NextCloud.md

Lines changed: 2 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,4 @@
1-
# Next Cloud
2-
## DO NOT EXPOSE PORT 80 TO THE WEB
1+
# Nextcloud
32

4-
It is a very bad idea to expose unencrypted traffic to the web. You will need to use a reverse-proxy to ensure your password is not stolen and your account hacked.
3+
Please refer to the [documentation on the master branch](https://github.com/SensorsIot/IOTstack/blob/master/docs/Containers/NextCloud.md).
54

6-
I'm still working on getting a good encrypted reverse proxy working. However in the interim you can use a VPN tunnel like OpenVPN or Zerotier to securely connect to your private cloud
7-
8-
## Backups
9-
10-
Nextcloud has been excluded from the docker_backup script due to its potential size. Once I've found a better way of backing it up I will add a dedicated script for it.
11-
12-
## Setup
13-
14-
Next-Cloud recommends using MySQL/MariaDB for the accounts and file list. The alternative is to use SQLite however they strongly discourage using it
15-
16-
This is the service yml. Notice that there are in fact two containers, one for the db and the other for the cloud itself. You will need to change the passwords **before** starting the stack (remember to change the docker-compose.yml and ./services/nextcloud/service.yml), if you dont you will need to delete the volume directory and start again.
17-
18-
```yml
19-
nextcloud:
20-
image: nextcloud
21-
container_name: nextcloud
22-
ports:
23-
- 9321:80
24-
volumes:
25-
- ./volumes/nextcloud/html:/var/www/html
26-
restart: unless-stopped
27-
depends_on:
28-
- nextcloud_db
29-
30-
nextcloud_db:
31-
image: linuxserver/mariadb
32-
container_name: nextcloud_db
33-
volumes:
34-
- ./volumes/nextcloud/db:/config
35-
environment:
36-
- MYSQL_ROOT_PASSWORD=stronger_password
37-
- MYSQL_PASSWORD=strong_password
38-
- MYSQL_DATABASE=nextcloud
39-
- MYSQL_USER=nextcloud
40-
41-
```
42-
43-
The port is 9321
44-
45-
![image](https://user-images.githubusercontent.com/46672225/69730546-f2ede200-1130-11ea-97f4-0f4f81d08fad.png)
46-
47-
click on the storage options, select maraiadb/mysql and fill in the details as follows
48-
49-
![image](https://user-images.githubusercontent.com/46672225/69731273-46acfb00-1132-11ea-9b10-579bb8b3dd9a.png)
50-
51-
Note that you data will be stored in `./volumes/nextcloud/html/data/{account}`
52-
53-
![image](https://user-images.githubusercontent.com/46672225/69732101-b1ab0180-1133-11ea-95dc-8a2e6fb80536.png)
54-
55-
Also note that file permissions are "www-data" so you cant simply copy data into this folder directly, you should use the web interface or the app.
56-
57-
It would be a good idea to mount an external drive to store the data in rather than on your sd card. details to follow shortly. Something like:
58-
59-
![image](https://user-images.githubusercontent.com/46672225/69873297-a3d6b700-12c0-11ea-98c9-40f358137b77.png)
60-
61-
The external drive will have to be an ext4 formatted drive because smb, fat32 and NTFS can't handle linux file permissions. If the permissions aren't set to "www-data" then the container wont be able to write to the disk.
62-
63-
Just a warning: If your database gets corrupted then your nextcloud is pretty much stuffed

0 commit comments

Comments
 (0)