feat: currently in production

This commit is contained in:
2023-06-11 09:33:09 +01:00
parent b3ba74e40e
commit f349c94465
6 changed files with 139 additions and 145 deletions

6
.gitignore vendored
View File

@@ -1,3 +1,3 @@
**.env.** **.env.**
.env .env
localSettings localSettings

View File

@@ -1,26 +1,60 @@
# cloud.limbosolutions.com # cloud.limbosolutions.com
Welcome to public repository of [https://cloud.limbosolutions.com](https://cloud.limbosolutions.com) Welcome to public repository of [https://cloud.limbosolutions.com](https://cloud.limbosolutions.com)
Using [NextCloud](https://nextcloud.com/) Using [NextCloud](https://nextcloud.com/)
## Setup
- Docker ## Requirements
_Currently hosted on an ubuntu lxc container with docker and portainer [+ information](https://git.limbosolutions.com/kb/lxc)._
- Docker
- [NextCloud Custom Docker Image](docker/Dockerfile) with smbclient extensions - Docker Compose
- [Duplicati Image with mySql client](https://git.limbosolutions.com/kb/duplicati/src/branch/main/docker/mysqlclient/README.md) - Portainer (optional)
- [NextCloud Custom Docker Image](docker/Dockerfile) with smbclient extensions
[Docker Compose File](docker-compose.yaml) - [Duplicati Image with mySql client](https://git.limbosolutions.com/kb/duplicati/src/branch/main/docker/mysqlclient/README.md)
[Check](doc/setup.md) for setup information.
## NextCloud CLI ## NextCloud CLI
``` bash ``` bash
#force file scan for specfic user #force file scan for specfic user
docker exec --user www-data nextcloud php occ files:scan USERNAME docker exec --user www-data nextcloud php occ files:scan USERNAME
``` ```
## Setup
[Docker Compose File](docker/ocker-compose.yaml)
## Backup and Restore
Using [custom duplicati image](https://git.limbosolutions.com/kb/duplicati) to daily backups files and databases. Every action (backup/restore) creates an measurement in influxdb for reporting and alerts.
### Duplicati - Default Options
Notify Influxdb.
--run-script-after=duplicati-influxdb-notify
### Duplicati - wiki job Options
Create db dump.
run-script-before-required:duplicati-mysql-backup
### Restore Database
```bash
#select a file to import
ls /db-dumps
#select a file to import
DB_FILE= "file name to import"
mysql --host db -uroot -p ${MYSQL_DATABASE} < /db-dumps/$DB_FILE
#root password (root password is the enviromnent variable ${MYSQL_ROOT_PASSWORD})
```

View File

@@ -1,2 +1,3 @@
FROM nextcloud:25.0 #image name : nextcloud-smbclient:25.0
FROM nextcloud:25.0
RUN apt update;apt install -y smbclient libsmbclient-dev;pecl install smbclient;echo "extension=smbclient.so" >> /usr/local/etc/php/conf.d/nextcloud.ini RUN apt update;apt install -y smbclient libsmbclient-dev;pecl install smbclient;echo "extension=smbclient.so" >> /usr/local/etc/php/conf.d/nextcloud.ini

View File

@@ -1,69 +1,74 @@
version: '2' version: '2'
services: services:
db: db:
image: mariadb:10.5 image: mariadb:10.5
restart: always restart: always
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
volumes: volumes:
- db:/var/lib/mysql - db:/var/lib/mysql
environment: environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_PASSWORD=${MYSQL_PASSWORD} - MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE} - MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_USER=${MYSQL_USER} - MYSQL_USER=${MYSQL_USER}
app: app:
image: nextcloud-smbclient:latest image: nextcloud-smbclient:25.0
restart: always restart: always
ports: ports:
- ${APP_PORT}:80 - ${APP_PORT}:80
links: links:
- db - db
volumes: volumes:
- html:/var/www/html - html:/var/www/html
environment: environment:
- MYSQL_PASSWORD=${MYSQL_PASSWORD} - MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE} - MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_USER=${MYSQL_USER} - MYSQL_USER=${MYSQL_USER}
- MYSQL_HOST=${MYSQL_HOST} - MYSQL_HOST=${MYSQL_HOST}
- PHP_MEMORY_LIMIT=2048M - PHP_MEMORY_LIMIT=2048M
duplicati: duplicati:
image: duplicati-mysqlclient:latest image: duplicati-mysqlclient:latest
environment: environment:
- DB_HOST=${MYSQL_HOST} - MYSQL_HOST=${MYSQL_HOST}
- DB_NAME=${MYSQL_DATABASE} - MYSQL_DATABASE=${MYSQL_DATABASE}
- DB_USER=${MYSQL_USER} - MYSQL_USER=${MYSQL_USER}
- DB_PASSWORD=${MYSQL_PASSWORD} - MYSQL_PASSWORD=${MYSQL_PASSWORD}
- DB_BACKUP_TARGETFOLDER=${DB_BACKUP_TARGETFOLDER} - INFLUXDB_SERVER=${INFLUXDB_SERVER}
volumes: - INFLUXDB_BUCKET=${INFLUXDB_BUCKET}
- duplicati_data:/data - INFLUXDB_ORG=${INFLUXDB_ORG}
- db:/backup/db_data:ro - INFLUXDB_TOKEN=${INFLUXDB_TOKEN}
- html:/backup/app_data:ro - INFLUXDB_CLIENT_HOSTNAME=${INFLUXDB_CLIENT_HOSTNAME}
- duplicati_data:/backup/duplicati_data:ro - DB_BACKUP_TARGETFOLDER=/bck/db_dumps
- db-dumps:${DB_BACKUP_TARGETFOLDER} volumes:
ports: - duplicati_data:/data
- ${DUPLICATI_PORT}:8200 - db:/bck/db_data:ro
restart: unless-stopped - html:/bck/app_data:ro
code-server: - duplicati_data:/bck/duplicati_data:ro
image: lscr.io/linuxserver/code-server:latest - db-dumps:/bck/db_dumps
environment: ports:
#- PUID=1000 - ${DUPLICATI_PORT}:8200
#- PGID=1000 restart: unless-stopped
- TZ=Europe/London code-server:
- PASSWORD=${ADMIN_PASSWORD} #optional image: lscr.io/linuxserver/code-server:latest
#- HASHED_PASSWORD= #optional environment:
- SUDO_PASSWORD=${ADMIN_PASSWORD} #optional #- PUID=1000
#- SUDO_PASSWORD_HASH= #optional #- PGID=1000
#- PROXY_DOMAIN=code-server.my.domain #optional - TZ=Europe/London
- DEFAULT_WORKSPACE=/config/workspace #optional - PASSWORD=${ADMIN_PASSWORD} #optional
volumes: #- HASHED_PASSWORD= #optional
- code-server_config:/config - SUDO_PASSWORD=${ADMIN_PASSWORD} #optional
- html:/data/nextcloud_html #- SUDO_PASSWORD_HASH= #optional
ports: #- PROXY_DOMAIN=code-server.my.domain #optional
- 8445:8443 - DEFAULT_WORKSPACE=/config/workspace #optional
restart: unless-stopped volumes:
volumes: - code-server_config:/config
html: - html:/data/nextcloud_html
db: ports:
duplicati_data: - 8445:8443
db-dumps: restart: unless-stopped
code-server_config: volumes:
html:
db:
duplicati_data:
db-dumps:
code-server_config:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

View File

@@ -1,46 +0,0 @@
# Setup
- Docker
_Currently hosted on an ubuntu lxc container with docker and portainer [+ information](https://git.limbosolutions.com/kb/lxc)._
- [NextCloud Custom Docker Image](../docker/Dockerfile) with smbclient extensions
- [Duplicati Image with mySql client](https://git.limbosolutions.com/kb/duplicati/src/branch/main/docker/mysqlclient/README.md)
[Docker Compose File](../docker/docker-compose.yaml)
## Backup & Restore
Using [duplicati](https://git.limbosolutions.com/kb/duplicati) to daily backups of files and databases.
### Restore Database
```bash
#select a file to import
ls /db-dumps
#select a file to import
DB_FILE= "file name to import"
mysql --host db -uroot -p ${MYSQL_DATABASE} < /db-dumps/$DB_FILE
#root password (root password is the enviromnent variable ${MYSQL_ROOT_PASSWORD})
```
## HomeAssistant DashBoard
![Home Assistant Dashboard](images/nextcloud-homessistant-dashboard.png "Home Assistant Dashboard")
```yaml
type: vertical-stack
cards:
- type: entities
entities:
- type: weblink
name: Homepage
url: http://cloud.limbosolutions.com
- type: weblink
name: Duplicati
url: http://wansrv01.dev.lan:8203
- type: weblink
name: Git
url: https://git.limbosolutions.com/marcio.fernandes/nextcloud/
title: cloud.limbosolutions.com
```