diff --git a/README.md b/README.md index 4967df5..33a013d 100644 --- a/README.md +++ b/README.md @@ -1 +1,23 @@ -# bridgehead \ No newline at end of file +# bridgehead + +This repository contains all tools to deploy a bridgehead with docker. If you have any questions about deploying a bridgehead, please contact us. + +There are some prerequisites, which need to be meet before starting a bridgehead. If you running a Windows or Mac OS machine you should read starting a bridgehead. If you running a Linux machine you can start or install a bridgehead. + +## Setup + +Clone this repository to /srv/docker/ + +The first step is to copy the site.conf. It contains some configuration and secrets for your bridgehead. + +With cp site.dev.conf site.conf you can clone the template. You need to set the project accoriding to the which bridgehead you want to start. It's either a GBN/BBMRI-ERIC, DKTK, DKTK-FED or C4 Bridgehead. + +Each Project needs a .env file where all the settings are located. Each Project has a template for it in their respective folder. We offer you to setup the file with and also to manage it. + +### DKTK-FED + +For the DKTK Federate Search put dkkt-fed as project in the site.conf. + +## Starting the bridgehead + +./install_bridgehead \ No newline at end of file diff --git a/auth/dktk b/auth/dktk new file mode 100644 index 0000000..e69de29 diff --git a/dktk-fed/docker-compose.yml b/dktk-fed/docker-compose.yml new file mode 100644 index 0000000..6d05715 --- /dev/null +++ b/dktk-fed/docker-compose.yml @@ -0,0 +1,52 @@ +version: "3.7" + +services: + traefik: + container_name: bridgehead_traefik + image: traefik:2.4 + command: + - --api.insecure=true + - --entrypoints.web.address=:80 + - --entrypoints.web-secure.address=:443 + - --providers.docker=true + ports: + - 80:80 + - 443:443 + - 8080:8080 + volumes: + - /var/run/docker.sock:/var/run/docker.sock:ro + - ../auth/:/auth + extra_hosts: + - "host.docker.internal:host-gateway" + + landing: + container_name: bridgehead_landingpage + image: nginx:stable + volumes: + - ../landing/:/usr/share/nginx/html + labels: + - "traefik.enable=true" + - "traefik.http.routers.landing.rule=PathPrefix(`/`)" + - "traefik.http.services.landing.loadbalancer.server.port=80" + + blaze: + image: "samply/blaze:0.15" + container_name: bridgehead_dktk_blaze + environment: + BASE_URL: "http://blaze:8080" + JAVA_TOOL_OPTIONS: "-Xmx4g" + LOG_LEVEL: "debug" + ENFORCE_REFERENTIAL_INTEGRITY: "false" + volumes: + - "blaze-data:/app/data" + labels: + - "traefik.enable=true" + - "traefik.http.middlewares.test-auth.basicauth.usersfile=/auth/dktk" + - "traefik.http.routers.blaze_dktk.rule=PathPrefix(`/dktk-localdatamanagement`)" + - "traefik.http.middlewares.dktk_b_strip.stripprefix.prefixes=/dktk-localdatamanagement" + - "traefik.http.services.blaze_dktk.loadbalancer.server.port=8080" + - "traefik.http.routers.blaze_dktk.middlewares=dktk_b_strip,test-auth" + + +volumes: + blaze-data: diff --git a/install-bridgehead.sh b/install-bridgehead.sh new file mode 100644 index 0000000..2f89526 --- /dev/null +++ b/install-bridgehead.sh @@ -0,0 +1,32 @@ +#!/bin/bash +### Note: Currently not complete, needs some features before useable for production + +source lib/functions.sh + +exitIfNotRoot + +if ! ./lib/prerequisites.sh; then + log "Prerequisites failed, exiting" + exit 1 +fi +source site.conf + +echo -e "\nInstalling systemd units ..." +cp -v \ + lib/systemd/bridgehead\@.service \ + lib/systemd/bridgehead-update\@.service \ + lib/systemd/bridgehead-update\@.timer \ + /etc/systemd/system/ + +systemctl daemon-reload + +echo + +if ! systemctl is-active --quiet bridgehead@"${project}"; then + echo "Enabling autostart of bridgehead@${project}.service" + systemctl enable bridgehead@"${project}" + echo "Enabling nightly updates for bridgehead@${project}.service ..." + systemctl enable --now bridgehead-update@"${project}".timer +fi + +echo -e "\nDone - now start your bridgehead by running\n\tsystemctl start bridgehead@${project}.service\nor by rebooting your machine." \ No newline at end of file diff --git a/landing/index.html b/landing/index.html new file mode 100644 index 0000000..e69de29 diff --git a/lib/functions.sh b/lib/functions.sh new file mode 100644 index 0000000..4dc30f5 --- /dev/null +++ b/lib/functions.sh @@ -0,0 +1,12 @@ +#!/bin/bash -e + +exitIfNotRoot() { + if [ "$EUID" -ne 0 ]; then + echo "Please run as root" + exit 1 + fi +} + +log() { + echo "$(date +'%Y-%m-%d %T')" "$1:" "$2" +} diff --git a/lib/generate.sh b/lib/generate.sh new file mode 100644 index 0000000..aed7704 --- /dev/null +++ b/lib/generate.sh @@ -0,0 +1,88 @@ +#!/bin/bash + +cat > ../landing/index.html < + + + + + + Bridgehead Overview + + + + + + + + + +