feat: duplicati backup influxdb trace
This commit is contained in:
14
.gitignore
vendored
14
.gitignore
vendored
@@ -1,7 +1,7 @@
|
|||||||
**.env
|
**.env
|
||||||
_volumes
|
_volumes
|
||||||
_volumes
|
_volumes
|
||||||
.vscode
|
.vscode
|
||||||
*.env
|
*.env
|
||||||
*.env.d/*
|
*.env.d/*
|
||||||
localSettings/
|
localSettings/
|
||||||
|
|||||||
105
README.md
105
README.md
@@ -1,58 +1,47 @@
|
|||||||
# git.limbosolutions.com
|
# git.limbosolutions.com
|
||||||
|
|
||||||
Welcome to public repository of my [Git Server](https://git.limbosolutions.com)
|
Welcome to public repository of my [Git Server](https://git.limbosolutions.com)
|
||||||
|
|
||||||
Using [gitea](https://git.limbosolutions.com/kb/gitea) and [duplicati](https://git.limbosolutions.com/kb/duplicati) for backups.
|
Using [gitea](https://git.limbosolutions.com/kb/gitea) and [duplicati](https://git.limbosolutions.com/kb/duplicati) for backups.
|
||||||
|
|
||||||
[Check](doc/administration/README.md) for more information about admistration.
|
|
||||||
|
## Requirements
|
||||||
## Requirements
|
|
||||||
|
- Docker
|
||||||
- Docker
|
- Docker Compose
|
||||||
_Currently hosted on an ubuntu lxc container with docker and portainer [+ information](https://git.limbosolutions.com/kb/lxc)._
|
- Portainer (optional)
|
||||||
|
- [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 & 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: git
|
|
||||||
- Destination Server: backupsrv01.dev.lan
|
### Duplicati - Default Options
|
||||||
- Destination Path: /git.limbosolutions.com/duplicati/git
|
|
||||||
- Source Data : /git (check [Docker Compose File](docker-compose.yaml) for folder structure on /git)
|
Notify Influxdb.
|
||||||
- Schedule: every day at 1 am
|
|
||||||
- run-script-before-required:/duplicati-mysqlclient/scripts/backupdb.sh
|
--run-script-after=duplicati-influxdb-notify
|
||||||
|
|
||||||
### Settings
|
### Duplicati - git job Options
|
||||||
|
|
||||||
#### Default Options
|
Create db dump.
|
||||||
|
|
||||||
```bash
|
run-script-before-required:duplicati-mysql-backup
|
||||||
|
|
||||||
--send-mail-any-operation=true
|
### Restore Database
|
||||||
--send-mail-body=%RESULT%
|
|
||||||
--send-mail-level=all
|
```bash
|
||||||
--send-mail-subject=Duplicati %OPERATIONNAME% report for wiki.limbosolutions.com -> %backup-name%
|
#select a file to import
|
||||||
--send-mail-to=to@email
|
ls /db-dumps
|
||||||
--send-http-result-output-format=Duplicati
|
#select a file to import
|
||||||
--send-mail-url= smtp://serveraddress:25
|
DB_FILE= "file name to import"
|
||||||
--send-mail-password=username
|
mysql --host db -uroot -p ${MYSQL_DATABASE} < /db-dumps/$DB_FILE
|
||||||
--send-mail-username=pass
|
#root password (root password is the enviromnent variable ${MYSQL_ROOT_PASSWORD})
|
||||||
|
```
|
||||||
```
|
|
||||||
|
|
||||||
### 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,25 +0,0 @@
|
|||||||
# Administration
|
|
||||||
|
|
||||||
## HomeAssistant DashBoard
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
```yaml
|
|
||||||
type: vertical-stack
|
|
||||||
cards:
|
|
||||||
- type: entities
|
|
||||||
entities:
|
|
||||||
- type: weblink
|
|
||||||
name: Homepage
|
|
||||||
url: http://git.limbosolutions.com
|
|
||||||
- type: weblink
|
|
||||||
name: Backups
|
|
||||||
url: http://wansrv01.dev.lan:8200/
|
|
||||||
- type: weblink
|
|
||||||
name: Hosting
|
|
||||||
url: wansrv01
|
|
||||||
- type: weblink
|
|
||||||
name: Git
|
|
||||||
url: https://git.limbosolutions.com/limbosolutions.com/git.limbosolutions.com
|
|
||||||
title: git.limbosolutions.com
|
|
||||||
```
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 10 KiB |
@@ -1,61 +1,65 @@
|
|||||||
version: "3"
|
version: "3"
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: gitea/gitea:1.18
|
image: gitea/gitea:1.18
|
||||||
environment:
|
environment:
|
||||||
- GITEA__database__DB_TYPE=mysql
|
- GITEA__database__DB_TYPE=mysql
|
||||||
- GITEA__database__HOST=db:3306
|
- GITEA__database__HOST=db:3306
|
||||||
- GITEA__database__NAME=${DB_NAME}
|
- GITEA__database__NAME=${DB_NAME}
|
||||||
- GITEA__database__USER=${DB_USER}
|
- GITEA__database__USER=${DB_USER}
|
||||||
- GITEA__database__PASSWD=${DB_PASSWORD}
|
- GITEA__database__PASSWD=${DB_PASSWORD}
|
||||||
- DISABLE_SSH=true
|
- DISABLE_SSH=true
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- data:/data
|
- data:/data
|
||||||
- /etc/timezone:/etc/timezone:ro
|
- /etc/timezone:/etc/timezone:ro
|
||||||
- /etc/localtime:/etc/localtime:ro
|
- /etc/localtime:/etc/localtime:ro
|
||||||
ports:
|
ports:
|
||||||
- ${GITEA_PORT}:80
|
- ${GITEA_PORT}:80
|
||||||
networks:
|
networks:
|
||||||
- gitea
|
- gitea
|
||||||
db:
|
db:
|
||||||
image: mysql:8
|
image: mysql:8
|
||||||
networks:
|
networks:
|
||||||
- gitea
|
- gitea
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
|
- MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
|
||||||
- MYSQL_USER=${DB_USER}
|
- MYSQL_USER=${DB_USER}
|
||||||
- MYSQL_PASSWORD=${DB_PASSWORD}
|
- MYSQL_PASSWORD=${DB_PASSWORD}
|
||||||
- MYSQL_DATABASE=${DB_NAME}
|
- MYSQL_DATABASE=${DB_NAME}
|
||||||
volumes:
|
volumes:
|
||||||
- db:/var/lib/mysql
|
- db:/var/lib/mysql
|
||||||
- /etc/timezone:/etc/timezone:ro
|
- /etc/timezone:/etc/timezone:ro
|
||||||
- /etc/localtime:/etc/localtime:ro
|
- db-dumps:/db-dumps:ro
|
||||||
- db-dumps:/db-dumps:ro
|
duplicati:
|
||||||
duplicati:
|
image: duplicati-mysqlclient #https://git.limbosolutions.com/kb/duplicati/src/branch/main/docker/mysqlclient
|
||||||
image: duplicati-mysqlclient #https://git.limbosolutions.com/kb/duplicati/src/branch/main/docker/mysqlclient
|
networks:
|
||||||
networks:
|
- gitea
|
||||||
- gitea
|
environment:
|
||||||
environment:
|
- MYSQL_HOST=db
|
||||||
- MYSQL_HOST=db
|
- MYSQL_DATABASE=${DB_NAME}
|
||||||
- MYSQL_DATABASE=${DB_NAME}
|
- MYSQL_USER=${DB_USER}
|
||||||
- MYSQL_USER=${DB_USER}
|
- MYSQL_PASSWORD=${DB_PASSWORD}
|
||||||
- MYSQL_PASSWORD=${DB_PASSWORD}
|
- MYSQL_BACKUP_FOLDER=/bck/db-dumps
|
||||||
- DESTINATION=/git/db-dumps
|
- INFLUXDB_SERVER=${INFLUXDB_SERVER}
|
||||||
volumes:
|
- INFLUXDB_BUCKET=${INFLUXDB_BUCKET}
|
||||||
- duplicati-data:/data
|
- INFLUXDB_ORG=${INFLUXDB_ORG}
|
||||||
- duplicati-data:/git/duplicati-data:ro
|
- INFLUXDB_TOKEN=${INFLUXDB_TOKEN}
|
||||||
- data:/git/data:ro
|
- INFLUXDB_CLIENT_HOSTNAME=${INFLUXDB_CLIENT_HOSTNAME}
|
||||||
- db:/git/db:ro
|
volumes:
|
||||||
- db-dumps:/git/db-dumps
|
- duplicati-data:/data
|
||||||
ports:
|
- duplicati-data:/bck/duplicati-data:ro
|
||||||
- ${DUPLICATI_PORT}:8200
|
- data:/bck/data:ro
|
||||||
restart: unless-stopped
|
- db:/bck/db:ro
|
||||||
volumes:
|
- db-dumps:/bck/db-dumps
|
||||||
duplicati-data:
|
ports:
|
||||||
data:
|
- ${DUPLICATI_PORT}:8200
|
||||||
db:
|
restart: unless-stopped
|
||||||
db-dumps:
|
volumes:
|
||||||
networks:
|
duplicati-data:
|
||||||
gitea:
|
data:
|
||||||
|
db:
|
||||||
|
db-dumps:
|
||||||
|
networks:
|
||||||
|
gitea:
|
||||||
|
|||||||
Reference in New Issue
Block a user