Compare commits
11 Commits
main
...
9eb54fc4ca
| Author | SHA1 | Date | |
|---|---|---|---|
| 9eb54fc4ca | |||
| fffb6ddfa4 | |||
| d45a9c8d03 | |||
| dbf874fd7f | |||
| 874b2705ce | |||
| 5f28f2ef8a | |||
| 5513b14587 | |||
| 0e7c34489c | |||
| 10f7cf88d2 | |||
| 8628a12ec5 | |||
| dbe6acbf0e |
7
.gitignore
vendored
7
.gitignore
vendored
@@ -1,4 +1,3 @@
|
||||
**.env
|
||||
_volumes
|
||||
_volumes
|
||||
.vscode
|
||||
*.local/*
|
||||
*.env
|
||||
*.env.d/*
|
||||
18
README.md
18
README.md
@@ -1,10 +1,14 @@
|
||||
|
||||
# git.limbosolutions.com
|
||||
|
||||
* Arquitectura : armv7
|
||||
* docker
|
||||
[compose file](docker/docker-compose.armv7.yaml)
|
||||
## Setup
|
||||
|
||||
## Backup and Restore Strategy
|
||||
Duplicati
|
||||
(more info required)
|
||||
```bash
|
||||
git clone https://git.limbosolutions.com/limbosolutions.com/git.limbosolutions.com
|
||||
cd git.limbosolutions.com
|
||||
chmod +x /scripts
|
||||
./scripts/setup-lxc.sh
|
||||
```
|
||||
|
||||
## Backup Strategy
|
||||
|
||||
Duplicati running on docker.
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
# compose file
|
||||
## Requirements
|
||||
* [Docker Image](https://git.limbosolutions.com/marcio.fernandes/duplicati-utils/src/branch/main/docker/sqlclient.DockerFile)
|
||||
|
||||
|
||||
# old info
|
||||
## Backup
|
||||
/usr/bin/docker exec -u git -w /tmp/backups gitea bash -c "/app/gitea/gitea dump"
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
version: "3"
|
||||
services:
|
||||
server:
|
||||
image: kunde21/gitea-arm
|
||||
container_name: gitea
|
||||
environment:
|
||||
- GITEA__database__DB_TYPE=mysql
|
||||
- GITEA__database__HOST=db:3306
|
||||
- GITEA__database__NAME=${GITEA_DB_NAME}
|
||||
- GITEA__database__USER=${GITEA_DB_USER}
|
||||
- GITEA__database__PASSWD=${GITEA_DB_PASSWORD}
|
||||
- DISABLE_SSH=true
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- data:/data
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
#ports:
|
||||
#- "3000:3000" web ui
|
||||
#- "22:22" ssh
|
||||
depends_on:
|
||||
- db
|
||||
networks:
|
||||
macvlan:
|
||||
ipv4_address: ${GITEA_MACVLAN_IP}
|
||||
gitea_network:
|
||||
db:
|
||||
image: tobi312/rpi-mariadb:10.5-ubuntu
|
||||
container_name: gitea_mariadb
|
||||
restart: always
|
||||
environment:
|
||||
- MYSQL_ROOT_PASSWORD=${MARIADB_ROOT_PASSWORD}
|
||||
- MYSQL_USER=${GITEA_DB_USER}
|
||||
- MYSQL_PASSWORD=${GITEA_DB_PASSWORD}
|
||||
- MYSQL_DATABASE=${GITEA_DB_NAME}
|
||||
volumes:
|
||||
- db:/var/lib/mysql
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
networks:
|
||||
gitea_network:
|
||||
duplicati:
|
||||
container_name: gitea_duplicati
|
||||
image: duplicati-sqlclient
|
||||
environment:
|
||||
- GITEA_DB_HOST=db
|
||||
- GITEA_DB_NAME=${GITEA_DB_NAME}
|
||||
- GITEA_DB_USER=${GITEA_DB_USER}
|
||||
- GITEA_DB_PASSWORD=${GITEA_DB_PASSWORD}
|
||||
- GITEA_DB_BACKUP_TARGETFOLDER=${GITEA_DB_BACKUP_TARGETFOLDER}
|
||||
volumes:
|
||||
- duplicati-data:/data
|
||||
- duplicati-data:/git/duplicati-data:ro
|
||||
- data:/git/data:ro
|
||||
- db:/git/db:ro
|
||||
- db-dumps:/git/db-dumps
|
||||
ports:
|
||||
- 8202:8200
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
gitea_network:
|
||||
volumes:
|
||||
data:
|
||||
db:
|
||||
db-dumps:
|
||||
duplicati-data:
|
||||
networks:
|
||||
macvlan:
|
||||
external: true
|
||||
name: macvlan_pub_net
|
||||
gitea_network:
|
||||
55
docker/docker-compose.yaml
Normal file
55
docker/docker-compose.yaml
Normal file
@@ -0,0 +1,55 @@
|
||||
version: "3"
|
||||
services:
|
||||
server:
|
||||
image: gitea/gitea:1.17
|
||||
container_name: gitea
|
||||
environment:
|
||||
- GITEA__database__DB_TYPE=mysql
|
||||
- GITEA__database__HOST=db:3306
|
||||
- GITEA__database__NAME=${DB_NAME}
|
||||
- GITEA__database__USER=${DB_USER}
|
||||
- GITEA__database__PASSWD=${DB_PASSWORD}
|
||||
- DISABLE_SSH=true
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- data:/data
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
ports:
|
||||
- ${HTTP_PORT}:3000
|
||||
db:
|
||||
image: mysql:8
|
||||
container_name: gitea_db
|
||||
restart: always
|
||||
environment:
|
||||
- MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
|
||||
- MYSQL_USER=${DB_USER}
|
||||
- MYSQL_PASSWORD=${DB_PASSWORD}
|
||||
- MYSQL_DATABASE=${DB_NAME}
|
||||
volumes:
|
||||
- db:/var/lib/mysql
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
duplicati:
|
||||
container_name: gitea_duplicati
|
||||
image: duplicati-sqlclient # requirement https://git.limbosolutions.com/kb/duplicati/src/branch/main/docker/sqlclient.dockerfile
|
||||
environment:
|
||||
- DB_HOST=db
|
||||
- DB_NAME=${DB_NAME}
|
||||
- DB_USER=${DB_USER}
|
||||
- DB_PASSWORD=$DB_PASSWORD}
|
||||
- DB_TARGETFOLDER=/git/db-dumps
|
||||
volumes:
|
||||
- duplicati-data:/data
|
||||
- duplicati-data:/git/duplicati-data:ro
|
||||
- data:/git/data:ro
|
||||
- db:/git/db:ro
|
||||
- db-dumps:/git/db-dumps
|
||||
ports:
|
||||
- 8200:8200
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
data:
|
||||
db:
|
||||
db-dumps:
|
||||
duplicati-data:
|
||||
47
documentation/restore.md
Normal file
47
documentation/restore.md
Normal file
@@ -0,0 +1,47 @@
|
||||
# Restore
|
||||
|
||||
[TOC]
|
||||
|
||||
## Prerequisites
|
||||
- [Setup](setup.md)
|
||||
- Stop all containers except duplicati
|
||||
|
||||
## Storage Restore
|
||||
|
||||
Duplicati web UI - Import backup job
|
||||
note: disable schedules
|
||||
|
||||
### DB Engine is the same
|
||||
|
||||
Restore everything from backup to original folders
|
||||
|
||||
### DB Engine not the same
|
||||
|
||||
Restore everything except db_data folders (db_dumps must be included)
|
||||
|
||||
#### Restore Database
|
||||
- Confirm if DB container is running (only db and duplicati should be running)
|
||||
- Execute on duplication bash (using portainer)
|
||||
|
||||
execute:
|
||||
```bash
|
||||
#check last files db-dumps
|
||||
ls /git/db-dumps
|
||||
#pick file to import (maybe the last one :))
|
||||
```
|
||||
import file
|
||||
|
||||
```bash
|
||||
DB_FILE=filenametoimport
|
||||
# by default duplicati container dont have de enviroment varible ${DB_ROOT_PASSWORD}
|
||||
DB_ROOT_PASSWORD=youdbrootpassword
|
||||
mysql -uroot -p'${DB_ROOT_PASSWORD}' ${DB_NAME} < /git/db-dumps/$DB_FILE
|
||||
```
|
||||
|
||||
3) start all stop containers and check everyting is ok
|
||||
4) Execute backup on duplicati
|
||||
5) Check backup is restorable
|
||||
6) Re Enable schedule backups on duplication
|
||||
|
||||
|
||||
|
||||
19
documentation/setup.md
Normal file
19
documentation/setup.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# Setup
|
||||
|
||||
```bash
|
||||
git clone https://git.limbosolutions.com/limbosolutions.com/git.limbosolutions.com
|
||||
cd git.limbosolutions.com
|
||||
chmod +x /scripts
|
||||
./scripts/setup-lxc.sh
|
||||
```
|
||||
Setup using portainer [docker compose](docker/docker-compose.yaml).
|
||||
|
||||
|
||||
|
||||
# Remove
|
||||
|
||||
```bash
|
||||
lxc exec $containername -- bash -c "docker rm portainer --force"
|
||||
```
|
||||
|
||||
|
||||
3
scripts/setup-lxc.sh
Normal file
3
scripts/setup-lxc.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
lxc launch ubuntu $LXC_CONTAINER_NAME -p $LXC_PROFILE && \
|
||||
lxc config set $LXC_CONTAINER_NAME "security.nesting" "true" && \
|
||||
#executar o ficheiro sobre o container setup-ubuntu.sh
|
||||
8
scripts/setup-ubuntu.sh
Normal file
8
scripts/setup-ubuntu.sh
Normal file
@@ -0,0 +1,8 @@
|
||||
# setup docker
|
||||
curl -s "https://git.limbosolutions.com/kb/docker/raw/branch/main/scripts/host/ubuntu-fuse-setup.sh" | bash
|
||||
|
||||
#install portainer
|
||||
docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
|
||||
pause(3)
|
||||
docker container list
|
||||
|
||||
Reference in New Issue
Block a user