From 2bfc501395b42ea70c8f55e11c5579806cc46494 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rcio=20Fernandes?= Date: Tue, 4 Oct 2022 00:49:19 +0100 Subject: [PATCH] . --- README.md | 1 + documentation/setup.md | 65 ++++++++++++++++++++++++------------------ 2 files changed, 38 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 0cdabc2..930bba2 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ ## Setup ```bash +cd ~/ git clone https://git.limbosolutions.com/limbosolutions.com/git.limbosolutions.com cd git.limbosolutions.com chmod +x /scripts diff --git a/documentation/setup.md b/documentation/setup.md index 7d0914a..ba7fe65 100644 --- a/documentation/setup.md +++ b/documentation/setup.md @@ -1,51 +1,60 @@ # Setup -## Host LXC Container +## Create LXC Container ``` bash -#set vars +# set vars containername=gitsrv01 +lxc_profile=enxd0374555c1f8_macvlan ``` -### Create Container +## Setup Container ```bash -lxc launch ubuntu $containername -p enxd0374555c1f8_macvlan && \ -lxc config set $containername "security.nesting" "true" && \ -lxc exec $containername -- bash -c "apt update -y && apt upgrade -y && apt install --yes fuse-overlayfs" && \ -lxc exec $containername -- bash -c "cd ~/ && curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh" && \ - +lxc launch ubuntu $containername -p $lxc_profile +# Setup container for docker +lxc exec $containername -- bash -c "curl https://git.limbosolutions.com/kb/lxc/scripts/ubuntu-fuse-setup.sh | bash" ``` -For more information: +## Fresh Install -- [LXC/Docker](/kb/lxc/documentation/running-docker.md) - -#### Portainer - -##### Create +### Install Portainer ```bash -lxc exec $containername -- bash -c "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" && \ +lxc exec $containername -- bash -c "curl https://git.limbosolutions.com/kb/portainer/scripts/setup.sh | bash" lxc exec $containername -- bash -c "docker container list" ``` -##### Remove +### Setup -```bash -lxc exec $containername -- bash -c "docker rm portainer --force" -``` +1) Enter portainer (default port 9443) +2) Setup Credentials +3) Setup Custom Docker Images + - Duplicati with SqlClient + - Image Name : duplicati-sqlclient:latest + - [Docker File](https://git.limbosolutions.com/kb/duplicati/docker/sqlclient.dockerfile) +4) Create Stacks: + - [git.limbosolutions.com](../docker/docker-compose.yaml) + - requirements: + - Duplicati with sqlClient -For more information: +### Restore -- [Install Portainer](/kb/portainer/) +1) Execute Normal Setup +2)Check Every Container is ok and running +3)Stop Every Container (including portainer) except duplicati +4)Enter Duplicati +5)Import Backjob (if possible, if not possible next steps must be adapted) + - All Imported jobs schedules must be disabled (or disable write permissions on backup host) +6)Restore all files to original location + - If database engine is diferent do not restore db_data and check restore database before next steps +7)Start Container and check if everything is ok -### Remove +#### Database -```bash -lxc rm $containername --force -``` +Only required of database data files not recovarable (example: diferent databases engine) -## Setup Gitea - -Setup using [docker compose](docker/docker-compose.yaml). +1) Start Portainer container (stopped in restore process) +2) Start Database container (stopped in restore process) +3) Enter duplicati bash (by using portainer) +4) Execute Command \ No newline at end of file