From c9f837a0f8c7bb5e253cfe6a8d605d5fd62736d3 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 13 Sep 2023 17:25:59 +0200 Subject: [PATCH] wip #6269 @1.5 --- .gitattributes | 6 + .idea/.gitignore | 8 + .idea/deployment.xml | 420 +++++++++++++++++++++++ .idea/fluidbook-hosting-loadbalancer.iml | 9 + .idea/misc.xml | 9 + .idea/modules.xml | 8 + .idea/vcs.xml | 6 + Dockerfile | 8 + README.md | 11 + docker-compose.yml | 16 + update | 17 + updateall.bat | 11 + 12 files changed, 529 insertions(+) create mode 100644 .gitattributes create mode 100644 .idea/.gitignore create mode 100644 .idea/deployment.xml create mode 100644 .idea/fluidbook-hosting-loadbalancer.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 docker-compose.yml create mode 100644 update create mode 100644 updateall.bat diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..fc87a42 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,6 @@ +* text=auto +*.sh text eol=lf +update text eol=lf +backup text eol=lf +*_key text eol=lf +*.bat text eol=crlf diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/deployment.xml b/.idea/deployment.xml new file mode 100644 index 0000000..9bc0f3d --- /dev/null +++ b/.idea/deployment.xml @@ -0,0 +1,420 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/fluidbook-hosting-loadbalancer.iml b/.idea/fluidbook-hosting-loadbalancer.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/.idea/fluidbook-hosting-loadbalancer.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..b658e95 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..d8b53d2 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..28c98cd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM ubuntu/apache2 + +ENV TERM=linux + +# Ensure apt doesn't ask questions when installing stuff +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt update && apt -y --no-install-recommends rsync \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..8615269 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# Installation + +On the servers : + +If docker is not installed : `wget https://get.docker.com -O get-docker.sh && sh get-docker.sh` + +`apt install -y git;mkdir -p /docker/fluidbook-hosting-loadbalancer;cd /docker/fluidbook-hosting-loadbalancer;git clone git://git.cubedesigners.com/fluidbook-hosting-loadbalancer.git .;chmod 755 update;./update` + +edit env file to set the right hostname + +Setup the firewall of alphaville server to whitelist this server \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..fb1ea5e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,16 @@ +version: '3.3' +services: + backup: + network_mode: bridge + container_name: fluidbook-hosting-loadbalancer + volumes: + - './ssh/id_rsa:/home/user/.ssh/id_rsa:ro' + - './ssh/id_rsa.pub:/home/user/.ssh/id_rsa.pub:ro' + - './ssh/id_rsa:/root/.ssh/id_rsa:ro' + - './ssh/id_rsa.pub:/root/.ssh/id_rsa.pub:ro' + restart: unless-stopped + build: . + env_file: env + environment: + - TZ=Europe/Paris + command: client diff --git a/update b/update new file mode 100644 index 0000000..29842ce --- /dev/null +++ b/update @@ -0,0 +1,17 @@ +#!/bin/bash +cd /docker/fluidbook-hosting-loadbalancer +if [ ! -f ./env ] +then + echo "VIRTUAL_HOST=s1.lb.fluidbook.com\nLETSENCRYPT_HOST=s1.lb.fluidbook.com" > ./env +fi +git config --global --add safe.directory /docker/fluidbook-hosting-loadbalancer +git fetch --all +git reset --hard origin/master +git stash +git pull origin master +chmod 755 ./ssh +chmod 600 ./ssh/id_rsa +DOCKER_BUILDKIT=1 docker compose build +docker compose down +docker compose up -d +/docker/nginxproxy/update \ No newline at end of file diff --git a/updateall.bat b/updateall.bat new file mode 100644 index 0000000..0626853 --- /dev/null +++ b/updateall.bat @@ -0,0 +1,11 @@ +ssh root@alphaville.cubedesigners.com "/docker/server-backup/update" +ssh root@brazil.cubedesigners.com "/docker/server-backup/update" +ssh root@clockwork.cubedesigners.com "/docker/server-backup/update" +ssh root@dracula.cubedesigners.com "/docker/server-backup/update" +ssh root@192.168.10.5 -p 22822 "/docker/server-backup/update" +ssh root@fastandfurious.cubedesigners.com -p 22822 "/docker/server-backup/update" +ssh root@godzilla.cubedesigners.com "/docker/server-backup/update" +ssh root@her2.cubedesigners.com "/docker/server-backup/update" +ssh root@192.168.10.16 "/docker/server-backup/update" +ssh root@192.168.10.167 "/docker/server-backup/update" +REM ssh root@kingkong.cubedesigners.com "/docker/server-backup/update" \ No newline at end of file -- 2.39.5