feat: Backups notifications (influxdb)
This commit is contained in:
41
README.md
41
README.md
@@ -2,52 +2,38 @@
|
||||
|
||||
# wiki.limbosolutions.com
|
||||
|
||||
Welcome to public repository of my [wiki](https://wiki.limbosolutions.com)
|
||||
Welcome to public repository of my [wiki](https://wiki.limbosolutions.com).
|
||||
Using [media wiki](https://www.mediawiki.org/wiki/MediaWiki).
|
||||
|
||||
Using [media wiki](https://www.mediawiki.org/wiki/MediaWiki))
|
||||
|
||||
[Check](doc/administration/README.md) for more information about admistration.
|
||||
|
||||
## Requirements
|
||||
|
||||
- Docker
|
||||
_Currently hosted on an ubuntu lxc container with docker and portainer [+ information](https://git.limbosolutions.com/kb/lxc)._
|
||||
|
||||
- Docker Compose
|
||||
- Portainer (optional)
|
||||
- [Duplicati Image with mySql client](https://git.limbosolutions.com/kb/duplicati/src/branch/main/docker/mysqlclient/README.md)
|
||||
|
||||
|
||||
## Setup
|
||||
|
||||
[Docker Compose File](docker-compose.yaml)
|
||||
|
||||
## Backup & Restore
|
||||
## Backup and Restore
|
||||
|
||||
Using [duplicati](https://git.limbosolutions.com/kb/duplicati) to daily backups of files and databases.
|
||||
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.
|
||||
|
||||
- Backup Name: wiki
|
||||
- Destination Server: backupsrv01.dev.lan
|
||||
- Destination Path: /wiki.limbosolutions.com/duplicati/wiki
|
||||
- Source Data : /wiki (check [Docker Compose File](docker-compose.yaml) for folder structure on /wiki)
|
||||
- Schedule: every day at 1:15 am
|
||||
- run-script-before-required:/duplicati-mysqlclient/scripts/backupdb.sh
|
||||
|
||||
### Settings
|
||||
### Duplicati - Default Options
|
||||
|
||||
#### Default Options
|
||||
Notify Influxdb.
|
||||
|
||||
```bash
|
||||
--run-script-after=duplicati-influxdb-notify
|
||||
|
||||
--send-mail-any-operation=true
|
||||
--send-mail-body=%RESULT%
|
||||
--send-mail-level=all
|
||||
--send-mail-subject=Duplicati %OPERATIONNAME% report for wiki.limbosolutions.com -> %backup-name%
|
||||
--send-mail-to=to@email
|
||||
--send-http-result-output-format=Duplicati
|
||||
--send-mail-url= smtp://serveraddress:25
|
||||
--send-mail-password=username
|
||||
--send-mail-username=pass
|
||||
### Duplicati - wiki job Options
|
||||
|
||||
```
|
||||
Create db dump.
|
||||
|
||||
run-script-before-required:duplicati-mysql-backup
|
||||
|
||||
### Restore Database
|
||||
|
||||
@@ -59,3 +45,4 @@ 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})
|
||||
```
|
||||
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
# Administration
|
||||
|
||||
## HomeAssistant DashBoard
|
||||
|
||||

|
||||
|
||||
```yaml
|
||||
type: vertical-stack
|
||||
cards:
|
||||
- type: entities
|
||||
entities:
|
||||
- entity: sensor.limbowiki_info_status
|
||||
name: Status
|
||||
secondary_info: last-changed
|
||||
- entity: sensor.limbowiki_info_version
|
||||
name: Version
|
||||
- type: weblink
|
||||
name: Homepage
|
||||
url: http://wiki.limbosolutions.com
|
||||
- type: weblink
|
||||
name: Duplicati
|
||||
url: http://wansrv01.dev.lan:8202
|
||||
- type: weblink
|
||||
name: Hosting
|
||||
url: https://wansrv01.dev.lan:9443
|
||||
- type: weblink
|
||||
name: Git
|
||||
url: https://git.limbosolutions.com/limbosolutions.com/wiki.limbosolutions.com
|
||||
title: wiki.limbosolutions.com
|
||||
```
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 16 KiB |
@@ -2,7 +2,6 @@ version: '3.0'
|
||||
services:
|
||||
app:
|
||||
image: mediawiki:1.39
|
||||
container_name: limbowiki_app
|
||||
links:
|
||||
- db
|
||||
ports:
|
||||
@@ -11,18 +10,18 @@ services:
|
||||
- app_data:/mediawiki_data
|
||||
command: >
|
||||
sh -c "
|
||||
chown -R www-data:www-data /mediawiki_data;
|
||||
rm /var/www/html/LocalSettings.php;
|
||||
rm /var/www/html/includes/PlatformSettings.php;
|
||||
rm -r /var/www/html/images;
|
||||
ln -s /mediawiki_data/config/LocalSettings.php /var/www/html/LocalSettings.php;
|
||||
ln -s /mediawiki_data/config/PlatformSettings.php /var/www/html/includes/PlatformSettings.php;
|
||||
ln -s /mediawiki_data/images /var/www/html/images;
|
||||
chown -R www-data:www-data /mediawiki_data;
|
||||
chown -R www-data:www-data /var/www/html;
|
||||
apache2-foreground;"
|
||||
restart: unless-stopped
|
||||
db:
|
||||
image: mariadb:10.6.2
|
||||
container_name: limbowiki_db
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
|
||||
@@ -30,18 +29,23 @@ services:
|
||||
- db_data:/var/lib/mysql
|
||||
duplicati:
|
||||
image: duplicati-mysqlclient:latest
|
||||
container_name: limbowiki_duplicati
|
||||
environment:
|
||||
- MYSQL_HOST=db
|
||||
- MYSQL_DATABASE=${MYSQL_DATABASE}
|
||||
- MYSQL_USER=${MYSQL_USER}
|
||||
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
|
||||
- DESTINATION=/wiki/db_dumps
|
||||
- MYSQL_BACKUP_FOLDER=/bck/db_dumps
|
||||
- INFLUXDB_SERVER=${INFLUXDB_SERVER}
|
||||
- INFLUXDB_BUCKET=${INFLUXDB_BUCKET}
|
||||
- INFLUXDB_ORG=${INFLUXDB_ORG}
|
||||
- INFLUXDB_TOKEN=${INFLUXDB_TOKEN}
|
||||
- INFLUXDB_CLIENT_HOSTNAME=${INFLUXDB_CLIENT_HOSTNAME}
|
||||
volumes:
|
||||
- duplicati_data:/data
|
||||
- db_data:/wiki/db_data:ro
|
||||
- app_data:/wiki/app_data:ro
|
||||
- db-dumps:/wiki/db_dumps
|
||||
- db_data:/bck/db_data:ro
|
||||
- app_data:/bck/app_data:ro
|
||||
- db-dumps:/bck/db_dumps
|
||||
- duplicati_data:/bck/duplicati_data:ro
|
||||
ports:
|
||||
- 8202:8200
|
||||
restart: unless-stopped
|
||||
|
||||
Reference in New Issue
Block a user