feat: Backups notifications (influxdb)
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,2 +1,2 @@
|
|||||||
.env
|
.env
|
||||||
localSettings/*
|
localSettings/*
|
||||||
109
README.md
109
README.md
@@ -1,61 +1,48 @@
|
|||||||
|
|
||||||
|
|
||||||
# wiki.limbosolutions.com
|
# 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
|
||||||
|
|
||||||
## Requirements
|
- Docker
|
||||||
|
- Docker Compose
|
||||||
- Docker
|
- Portainer (optional)
|
||||||
_Currently hosted on an ubuntu lxc container with docker and portainer [+ information](https://git.limbosolutions.com/kb/lxc)._
|
- [Duplicati Image with mySql client](https://git.limbosolutions.com/kb/duplicati/src/branch/main/docker/mysqlclient/README.md)
|
||||||
|
|
||||||
- [Duplicati Image with mySql client](https://git.limbosolutions.com/kb/duplicati/src/branch/main/docker/mysqlclient/README.md)
|
|
||||||
|
## Setup
|
||||||
## Setup
|
|
||||||
|
[Docker Compose File](docker-compose.yaml)
|
||||||
[Docker Compose File](docker-compose.yaml)
|
|
||||||
|
## Backup and Restore
|
||||||
## Backup & 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.
|
||||||
Using [duplicati](https://git.limbosolutions.com/kb/duplicati) to daily backups of files and databases.
|
|
||||||
|
|
||||||
- Backup Name: wiki
|
### Duplicati - Default Options
|
||||||
- Destination Server: backupsrv01.dev.lan
|
|
||||||
- Destination Path: /wiki.limbosolutions.com/duplicati/wiki
|
Notify Influxdb.
|
||||||
- Source Data : /wiki (check [Docker Compose File](docker-compose.yaml) for folder structure on /wiki)
|
|
||||||
- Schedule: every day at 1:15 am
|
--run-script-after=duplicati-influxdb-notify
|
||||||
- run-script-before-required:/duplicati-mysqlclient/scripts/backupdb.sh
|
|
||||||
|
### Duplicati - wiki job Options
|
||||||
### Settings
|
|
||||||
|
Create db dump.
|
||||||
#### Default Options
|
|
||||||
|
run-script-before-required:duplicati-mysql-backup
|
||||||
```bash
|
|
||||||
|
### Restore Database
|
||||||
--send-mail-any-operation=true
|
|
||||||
--send-mail-body=%RESULT%
|
```bash
|
||||||
--send-mail-level=all
|
#select a file to import
|
||||||
--send-mail-subject=Duplicati %OPERATIONNAME% report for wiki.limbosolutions.com -> %backup-name%
|
ls /db-dumps
|
||||||
--send-mail-to=to@email
|
#select a file to import
|
||||||
--send-http-result-output-format=Duplicati
|
DB_FILE= "file name to import"
|
||||||
--send-mail-url= smtp://serveraddress:25
|
mysql --host db -uroot -p ${MYSQL_DATABASE} < /db-dumps/$DB_FILE
|
||||||
--send-mail-password=username
|
#root password (root password is the enviromnent variable ${MYSQL_ROOT_PASSWORD})
|
||||||
--send-mail-username=pass
|
```
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
### 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})
|
|
||||||
```
|
|
||||||
|
|||||||
@@ -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 |
@@ -1,52 +1,56 @@
|
|||||||
version: '3.0'
|
version: '3.0'
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: mediawiki:1.39
|
image: mediawiki:1.39
|
||||||
container_name: limbowiki_app
|
links:
|
||||||
links:
|
- db
|
||||||
- db
|
ports:
|
||||||
ports:
|
- ${APP_PORT}:80
|
||||||
- ${APP_PORT}:80
|
volumes:
|
||||||
volumes:
|
- app_data:/mediawiki_data
|
||||||
- app_data:/mediawiki_data
|
command: >
|
||||||
command: >
|
sh -c "
|
||||||
sh -c "
|
rm /var/www/html/LocalSettings.php;
|
||||||
chown -R www-data:www-data /mediawiki_data;
|
rm /var/www/html/includes/PlatformSettings.php;
|
||||||
rm /var/www/html/LocalSettings.php;
|
rm -r /var/www/html/images;
|
||||||
rm /var/www/html/includes/PlatformSettings.php;
|
ln -s /mediawiki_data/config/LocalSettings.php /var/www/html/LocalSettings.php;
|
||||||
rm -r /var/www/html/images;
|
ln -s /mediawiki_data/config/PlatformSettings.php /var/www/html/includes/PlatformSettings.php;
|
||||||
ln -s /mediawiki_data/config/LocalSettings.php /var/www/html/LocalSettings.php;
|
ln -s /mediawiki_data/images /var/www/html/images;
|
||||||
ln -s /mediawiki_data/config/PlatformSettings.php /var/www/html/includes/PlatformSettings.php;
|
chown -R www-data:www-data /mediawiki_data;
|
||||||
ln -s /mediawiki_data/images /var/www/html/images;
|
chown -R www-data:www-data /var/www/html;
|
||||||
apache2-foreground;"
|
apache2-foreground;"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
db:
|
db:
|
||||||
image: mariadb:10.6.2
|
image: mariadb:10.6.2
|
||||||
container_name: limbowiki_db
|
restart: unless-stopped
|
||||||
restart: unless-stopped
|
environment:
|
||||||
environment:
|
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
|
||||||
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
|
volumes:
|
||||||
volumes:
|
- db_data:/var/lib/mysql
|
||||||
- db_data:/var/lib/mysql
|
duplicati:
|
||||||
duplicati:
|
image: duplicati-mysqlclient:latest
|
||||||
image: duplicati-mysqlclient:latest
|
environment:
|
||||||
container_name: limbowiki_duplicati
|
- MYSQL_HOST=db
|
||||||
environment:
|
- MYSQL_DATABASE=${MYSQL_DATABASE}
|
||||||
- MYSQL_HOST=db
|
- MYSQL_USER=${MYSQL_USER}
|
||||||
- MYSQL_DATABASE=${MYSQL_DATABASE}
|
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
|
||||||
- MYSQL_USER=${MYSQL_USER}
|
- MYSQL_BACKUP_FOLDER=/bck/db_dumps
|
||||||
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
|
- INFLUXDB_SERVER=${INFLUXDB_SERVER}
|
||||||
- DESTINATION=/wiki/db_dumps
|
- INFLUXDB_BUCKET=${INFLUXDB_BUCKET}
|
||||||
volumes:
|
- INFLUXDB_ORG=${INFLUXDB_ORG}
|
||||||
- duplicati_data:/data
|
- INFLUXDB_TOKEN=${INFLUXDB_TOKEN}
|
||||||
- db_data:/wiki/db_data:ro
|
- INFLUXDB_CLIENT_HOSTNAME=${INFLUXDB_CLIENT_HOSTNAME}
|
||||||
- app_data:/wiki/app_data:ro
|
volumes:
|
||||||
- db-dumps:/wiki/db_dumps
|
- duplicati_data:/data
|
||||||
ports:
|
- db_data:/bck/db_data:ro
|
||||||
- 8202:8200
|
- app_data:/bck/app_data:ro
|
||||||
restart: unless-stopped
|
- db-dumps:/bck/db_dumps
|
||||||
volumes:
|
- duplicati_data:/bck/duplicati_data:ro
|
||||||
db_data:
|
ports:
|
||||||
app_data:
|
- 8202:8200
|
||||||
duplicati_data:
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
db_data:
|
||||||
|
app_data:
|
||||||
|
duplicati_data:
|
||||||
db-dumps:
|
db-dumps:
|
||||||
Reference in New Issue
Block a user