diff --git a/questionnaire/index.html b/questionnaire/index.html index 1af411e..8062be5 100644 --- a/questionnaire/index.html +++ b/questionnaire/index.html @@ -72,22 +72,7 @@ typeof fieldId == "object" ? fieldId : document.getElementById(fieldId); - return field && field.checked == true; - }, - showHideMigrations: function () { - const labels = document.querySelectorAll( - 'label[for^="env.products-to-migrate."]' - ); - for (var i = 0; i < labels.length; ++i) { - var migration = labels[i].dataset.migration; - if (migration) { - if (view.state.migrate) { - view.show(labels[i]); - } else { - view.hide(labels[i]); - } - } - } + return field && (field.checked == true || field.selected); }, }; @@ -146,24 +131,9 @@ entry: "entry.569243513", }, { - name: "products-to-migrate.none", + name: "products-to-migrate.none.yes", entry: "entry.1803285821", - }, - { - name: "products-to-migrate.labfolder-labregister", - entry: "entry.907467583", - }, - { - name: "products-to-migrate.laboperator", - entry: "entry.48913136", - }, - { - name: "products-to-migrate.laboperator-workflow-editor", - entry: "entry.319096810", - }, - { - name: "products-to-migrate.connector-manager", - entry: "entry.2112004302", + default: "no" }, { name: "domain.use-customer-domain", @@ -173,6 +143,10 @@ name: "domain.use-labfoward-domain", entry: "entry.1714575381", }, + { + name: "domain.company-name", + entry: "entry.189162875", + }, { name: "identity-provider.use-labforward-identity-provider", entry: "entry.667719526", @@ -185,50 +159,6 @@ name: "cloud.aws.region", entry: "entry.1591949914", }, - { - name: "cloud.aws.account.name", - entry: "entry.1403459674", - }, - { - name: "domain.labfolder.primary.fqdn", - entry: "entry.1241608360", - }, - { - name: "domain.labregister.primary.fqdn", - entry: "entry.9357705", - }, - { - name: "domain.laboperator.primary.fqdn", - entry: "entry.904791097", - }, - { - name: "domain.laboperator-workflow-editor.primary.fqdn", - entry: "entry.130957067", - }, - { - name: "domain.connector-manager.primary.fqdn", - entry: "entry.717855287", - }, - { - name: "domain.labfolder.secondary.fqdn", - entry: "entry.1308652127", - }, - { - name: "domain.labregister.secondary.fqdn", - entry: "entry.142511199", - }, - { - name: "domain.laboperator.secondary.fqdn", - entry: "entry.1609277239", - }, - { - name: "domain.laboperator-workflow-editor.secondary.fqdn", - entry: "entry.1491024097", - }, - { - name: "domain.connector-manager.secondary.fqdn", - entry: "entry.1491866007", - }, ], }; @@ -264,35 +194,13 @@ if (view.isChecked("env.installation.cloud-based")) { view.state.cloud_based = true; - } else if (view.isChecked("env.installation.on-premise")) { - view.state.cloud_based = false; } else { view.state.cloud_based = null; } - if (view.isChecked("env.products-to-migrate.none")) { - view.state.migrate = false; - } else { - view.state.migrate = true; - } + view.state.labfolder_labregister = view.isChecked("env.products-to-install.labfolder-labregister") - if (view.isChecked("env.products-to-install.labfolder-labregister")) { - view.state.labfolder_labregister = true; - } else if ( - view.isChecked("env.products-to-migrate.labfolder-labregister") - ) { - view.state.labfolder_labregister = true; - } else { - view.state.labfolder_labregister = false; - } - - if (view.isChecked("env.products-to-install.laboperator")) { - view.state.laboperator = true; - } else if (view.isChecked("env.products-to-migrate.laboperator")) { - view.state.laboperator = true; - } else { - view.state.laboperator = false; - } + view.state.laboperator = view.isChecked("env.products-to-install.laboperator"); laq.render(); }, @@ -300,14 +208,12 @@ view.show("send"); if (view.isChecked("env.installation.cloud-based")) { - view.show("env.installation-plan.on-cloud"); view.show("env.cloud.aws"); view.hide("env.on-premise"); } if (view.isChecked("env.installation.on-premise")) { view.show("env.on-premise"); - view.hide("env.installation-plan.on-cloud"); view.hide("env.cloud.aws"); } @@ -325,82 +231,7 @@ ).checked = false; } - if ( - view.isChecked( - "env.products-to-install.laboperator-workflow-editor" - ) || - view.isChecked( - "env.products-to-migrate.laboperator-workflow-editor" - ) - ) { - view.show( - "env.domain.laboperator-workflow-editor.primary.fqdn.label" - ); - if (view.isChecked("env.regulation.no-special-requirements")) { - view.hide( - "env.domain.laboperator-workflow-editor.secondary.fqdn.label" - ); - } - if (view.isChecked("env.regulation.gxp-operation")) { - view.show( - "env.domain.laboperator-workflow-editor.secondary.fqdn.label" - ); - } - } else { - view.hide( - "env.domain.laboperator-workflow-editor.primary.fqdn.label" - ); - view.hide( - "env.domain.laboperator-workflow-editor.secondary.fqdn.label" - ); - } - - if ( - view.isChecked("env.products-to-install.connector-manager") || - view.isChecked("env.products-to-migrate.connector-manager") - ) { - view.show("env.domain.connector-manager.primary.fqdn.label"); - view.show("env.domain.connector-manager.secondary.fqdn.label"); - } else { - view.hide("env.domain.connector-manager.primary.fqdn.label"); - view.hide("env.domain.connector-manager.secondary.fqdn.label"); - } - - view.showHideMigrations(); - - if (view.state.regulation_requirements) { - view.show("env.domain.secondary.fqdns"); - } else { - view.hide("env.domain.secondary.fqdns"); - } - - if (view.state.laboperator) { - view.show("env.domain.laboperator.primary.fqdn.label"); - view.show("env.domain.laboperator.secondary.fqdn.label"); - } else { - view.hide("env.domain.laboperator.primary.fqdn.label"); - view.hide("env.domain.laboperator.secondary.fqdn.label"); - } - - if (view.state.labfolder_labregister) { - view.show("env.domain.labfolder.primary.fqdn.label"); - view.show("env.domain.labregister.primary.fqdn.label"); - view.show("env.domain.labfolder.secondary.fqdn.label"); - view.show("env.domain.labregister.secondary.fqdn.label"); - } else { - view.hide("env.domain.labfolder.primary.fqdn.label"); - view.hide("env.domain.labregister.primary.fqdn.label"); - view.hide("env.domain.labfolder.secondary.fqdn.label"); - view.hide("env.domain.labregister.secondary.fqdn.label"); - } - - if (view.state.labfolder_labregister || view.state.laboperator) { - view.show("env.domain.domain-strategy"); - view.show("env.domain.fqdn"); - } else { - view.hide("env.domain.domain-strategy"); - view.hide("env.domain.fqdn"); - } + view.show("env.domain.domain-strategy"); var products = ""; if (view.state.labfolder_labregister) { @@ -451,7 +282,7 @@ laq.prepareSubmit(); }, useField: function (field) { - if (typeof field != "object") { + if (typeof field != "object" || null == field) { return false; } var notHidden = !field.classList.contains("laq-hidden"); @@ -465,7 +296,11 @@ var google_field = google_form.map_fields[i]; var field = document.getElementById("env." + google_field.name); if (laq.useField(field)) { - payload += google_field.entry + "=" + field.value + "&"; + var value = field.value; + if (value == null){ + value = google_field.default; + } + payload += google_field.entry + "=" + value + "&"; } } return payload; @@ -527,11 +362,6 @@
Configuration
-
- - Installation plan - -
@@ -541,7 +371,7 @@

Questionnaire

Customer

- customer name: + Name: @@ -642,64 +472,26 @@

Products

Migration

-
@@ -756,175 +548,14 @@

Domain name

- - - - - - - - - - -
- - - - - - - - - -
-

Identity Provider

@@ -947,7 +578,7 @@

Identity Provider

type="checkbox" value="yes" id="env.identity-provider.use-customer-identity-provider" - />Use a custom identity providerUse a custom identity provider. E.g.: Shibboleth, LDAP, Google, Microsoft...
- -

Installation plan

-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
WorkpackageStep #TitleDescription
WP1Intrastucture - Provisioning and configuration of environment - infrastructure. -
WP11AWS account creation - Creation of the AWS account prerequisites for a new - dedicated cloud. -
WP12Primary EKS cluster provisioning - Creation of the primary cluster via our infrastructure - provisioning repository. -
WP13Secondary EKS cluster provisioning - Creation of the secondary cluster via our infrastructure - provisioning repository. -
WP14Network peering to customer networks - Setup of networking rules to connect the cluster to the - customer network. -
WP15Cluster DNS routing - Setup to DNS routing to make the cluster accessible via DNS. -
WP2InstallationInstallation of the Labforward Suite.
WP21Installation secondary environments - Installation of the Labforward Suite to environments of the - secondary cluster using Replicated. -
WP22Installation primary environment - Installation of the Labforward Suite to the primary cluster - using Replicated. -
WP3ConfigurationConfiguration of the Labforward Suite.
WP31Application configuration - Configuration of the Labforward applications via the Admin - Console. -
WP32Custom domain and certificate - Configuration of the customer-provided domain and - certificates. -
WP33Custom interface: EmailConfiguration of the customer-provided SMTP server.
WP34Custom interface: Identity Provider - Configuration of the customer-provided identity management. -
WP4Migration - Migration of application data from previous installations. -
WP41Migration of Laboperator data - Migration of application data from previous Laboperator, - Mender, and Workflow Editor installations. -
WP42Migration of Labfolder/Labregister data - Migration of application data from previous installations. -
WP5ValidationFormal environment validation.
WP51Completion of validation documentationFormal environment validation.
-
Information sent successfully! diff --git a/requirements-check.sh b/requirements-check.sh index ec4f286..c945e64 100755 --- a/requirements-check.sh +++ b/requirements-check.sh @@ -5,16 +5,19 @@ FAIL=0 export LANG=en -# many distros dont have sudo installed by default -#echo "Checking for superuser permission" -#TEST_SUDO=$(sudo -l || echo "User must have superuser privilege on target machine. FAIL.") -#echo "$TEST_SUDO" -# -#if [[ "$TEST_SUDO" == *"FAIL." ]]; then -# FAIL=1 -#fi -#builtin type -P docker > /dev/null || echo "We need docker installed and in the user PATH. FAIL."; \ -#builtin type -P kubectl > /dev/null || echo "We need kubectl installed and in the user PATH. FAIL."; \ +function validate() { + str_to_validate=$1 + echo "$str_to_validate" + if [[ "$str_to_validate" == *"FAIL." ]]; then + FAIL=1 + fi +} +function curl_request() { + URL=$1 + + response=$(curl -s -v -o /dev/null $URL 2>&1 | awk "/HTTP\/.+ (2[0-9][0-9]|3[0-9][0-9]).*/ {success=1} END { if (1 == success) { printf \"$URL safely reachable - OK. \n\"; } else printf \"$URL safely unreachable - FAIL.\n\"; }") + validate "$response" +} echo "Checking basic requirements" TESTS=$(builtin type -P awk > /dev/null || echo "We need awk command installed and in the user PATH. FAIL."; \ @@ -22,92 +25,39 @@ builtin type -P curl > /dev/null || echo "We need curl command installed and in builtin type -P free > /dev/null || echo "We need free command installed and in the user PATH. FAIL."; \ builtin type -P lscpu > /dev/null || echo "We need lscpu command installed and in the user PATH. FAIL." ) -echo $TESTS -if [[ "$TESTS" == *"FAIL"* ]]; then - FAIL=1 -else - echo "basic commands found. OK" -fi - -# 500GB = 524288000 kilobytes, 300GB = 314572800 kilobytes -TEST_AVAILABLE_SPACE=$(df -Pk /var /var/lib /var/lib/kubelet | tail -1 | awk -F ' ' 'BEGIN{kilobytes=0}{ if ($4+0>kilobytes) kilobytes=$4+0; source=$6;} END {if (kilobytes < 314572800) printf "Not enough disk space. There`s only %d (kilobytes) available. FAIL.", kilobytes; else printf "%s has enought disk space.", source}') - -echo $TEST_AVAILABLE_SPACE -if [[ "$TEST_AVAILABLE_SPACE" == *"FAIL." ]]; then - FAIL=1 -fi +validate "$TESTS" +# 150GB = 157286400 kilobytes +TEST_AVAILABLE_SPACE=$(df -Pk /var /var/lib /var/lib/kubelet 2> /dev/null | tail -1 | awk -F ' ' 'BEGIN{kilobytes=0}{ if ($4+0>kilobytes) kilobytes=$4+0; source=$6;} END {if (kilobytes 157286400 < 1) printf "Not enough disk space. There`s only %d (kilobytes) available. The installation requires at least 150 GB of diskspace. FAIL.", kilobytes; else printf "%s has enought disk space.", source}') +validate "$TEST_AVAILABLE_SPACE" echo "Checking hardware specs" TEST_CPU_CORES=$(lscpu 2>/dev/null| awk -F: 'IGNORECASE = 1;/^CPU\(s\):/{cores=$2} END { if (cores -2 < 0) print "Not enough cores. At least 2 cores needed. \n"; else printf "Enought cores: %i - OK. \n", cores; } ' | grep -i cores) -echo $TEST_CPU_CORES -if [[ "$TEST_CPU_CORES" == *"FAIL." ]]; then - FAIL=1 -fi +validate "$TEST_CPU_CORES" TEST_CPU_CLOCK=$(lscpu 2>/dev/null| awk -F: 'IGNORECASE = 1;/MHz:/ { mhz=$2 } IGNORECASE = 1;/max MHz:/ {max=$2 } END { if (max > mhz) mhz = max; if (mhz < 2600) printf "Not enough clock. Minimum required is 2600, measured: %d Mhz\n", mhz; else printf "Enough clock speed: %d Mhz - OK. \n", mhz } ' | grep -i Mhz) -echo $TEST_CPU_CLOCK -if [[ "$TEST_CPU_CLOCK" == *"FAIL." ]]; then - FAIL=1 -fi +validate "$TEST_CPU_CLOCK" -# pegar memoria disponivel TEST_MEM=$(free --giga | awk -F' ' '/^Mem:/ {total=$2} END { if (total < 16) printf "Not enough total memory. 16GB is the minimun requirement. Memory found: %d FAIL.\n", total; else printf "Total memory: %s - OK. \n", total ; exit total < 16}') -echo $TEST_MEM -if [[ "$TEST_MEM" == *"FAIL." ]]; then - FAIL=1 -fi +validate "$TEST_MEM" -echo "Network access" -TEST_EC2=$(curl -s -v -o /dev/null https://ec2.amazonaws.com 2>&1 | awk -F' ' '/\* TLSv.*TLS handshake.*Certificate.*/ {certificate=1} /\* TLSv.*TLS handshake.*Server key exchange.*/ {verify=1} /\* TLSv.*TLS handshake.*Finished.*/ {finished=1} END { if (3 == certificate + verify + finished ) { printf "https://ec2.amazonaws.com safely reachable - OK. \n"; } else printf "https://ec2.amazonaws.com safely unreachable - FAIL.\n"; }') -echo $TEST_EC2 -if [[ "$TEST_EC2" == *"FAIL." ]]; then - FAIL=1 -fi -TEST_KURL=$(curl -s -v -o /dev/null https://k8s.kurl.sh 2>&1 | awk -F' ' '/\* TLSv.*TLS handshake.*Certificate.*/ {certificate=1} /\* TLSv.*TLS handshake.*Server key exchange.*/ {verify=1} /\* TLSv.*TLS handshake.*Finished.*/ {finished=1} END { if (3 == certificate + verify + finished ) { printf "https://k8s.kurl.sh safely reachable - OK. \n"; } else printf "https://k8s.kurl.sh safely unreachable - FAIL.\n"; }') -echo $TEST_KURL -if [[ "$TEST_KURL" == *"FAIL." ]]; then - FAIL=1 -fi - -TEST_REPLICATED_PROXY=$(curl -s -v -o /dev/null https://proxy.replicated.com 2>&1 | awk -F' ' '/\* TLSv.*TLS handshake.*Certificate.*/ {certificate=1} /\* TLSv.*TLS handshake.*CERT verify.*/ {verify=1} /\* TLSv.*TLS handshake.*Finished.*/ {finished=1} /\* TLSv.*TLS handshake.*Newsession.*/ {session=1} END { if (4 == certificate + verify + finished + session) { printf "https://proxy.replicated.com safely reachable - OK. \n"; } else printf "https://proxy.replicated.com safely unreachable - FAIL.\n"; }') -echo $TEST_REPLICATED_PROXY -if [[ "$TEST_REPLICATED_PROXY" == *"FAIL." ]]; then - FAIL=1 -fi - -TEST_REPLICATED=$(curl -s -v -o /dev/null https://replicated.app 2>&1 | awk -F' ' '/\* TLSv.*TLS handshake.*Certificate.*/ {certificate=1} /\* TLSv.*TLS handshake.*CERT verify.*/ {verify=1} /\* TLSv.*TLS handshake.*Finished.*/ {finished=1} /\* TLSv.*TLS handshake.*Newsession.*/ {session=1} END { if (4 == certificate + verify + finished + session) { printf "https://replicated.app safely reachable - OK. \n"; } else printf "https://replicated.app safely unreachable - FAIL.\n"; }') -echo $TEST_REPLICATED -if [[ "$TEST_REPLICATED" == *"FAIL." ]]; then - FAIL=1 -fi - -TEST_KOTS=$(curl -s -v -o /dev/null https://kots.io 2>&1 | awk -F' ' '/\* TLSv.*TLS handshake.*Certificate.*/ {certificate=1} /\* TLSv.*TLS handshake.*CERT verify.*/ {verify=1} /\* TLSv.*TLS handshake.*Finished.*/ {finished=1} /\* TLSv.*TLS handshake.*Newsession.*/ {session=1} END { if (4 == certificate + verify + finished + session) { printf "https://kots.io safely reachable - OK. \n"; } else printf "https://kots.io safely unreachable - FAIL.\n"; }') -echo $TEST_KOTS -if [[ "$TEST_KOTS" == *"FAIL." ]]; then - FAIL=1 -fi - -TEST_GITHUB=$(curl -s -v -o /dev/null https://github.com 2>&1 | awk -F' ' '/\* TLSv.*TLS handshake.*Certificate.*/ {certificate=1} /\* TLSv.*TLS handshake.*CERT verify.*/ {verify=1} /\* TLSv.*TLS handshake.*Finished.*/ {finished=1} /\* TLSv.*TLS handshake.*Newsession.*/ {session=1} END { if (4 == certificate + verify + finished + session) { printf "https://github.com safely reachable - OK. \n"; } else printf "https://github.com safely unreachable - FAIL.\n"; }') -echo $TEST_GITHUB -if [[ "$TEST_GITHUB" == *"FAIL." ]]; then - FAIL=1 -fi +echo "Network access" -TEST_K8S_GCR=$(curl -s -v -o /dev/null https://k8s.gcr.io 2>&1 | awk -F' ' '/\* TLSv.*TLS handshake.*Certificate.*/ {certificate=1} /\* TLSv.*TLS handshake.*CERT verify.*/ {verify=1} /\* TLSv.*TLS handshake.*Finished.*/ {finished=1} /\* TLSv.*TLS handshake.*Newsession.*/ {session=1} END { if (4 == certificate + verify + finished + session) { printf "https://k8s.gcr.io safely reachable - OK. \n"; } else printf "https://k8s.gcr.io safely unreachable - FAIL.\n"; }') -echo $TEST_K8S_GCR -if [[ "TEST_K8S_GCR" == *"FAIL." ]]; then - FAIL=1 -fi +curl_request 'https://ec2.amazonaws.com' +curl_request 'https://k8s.kurl.sh' +curl_request 'https://replicated.app' +curl_request 'https://kots.io' +curl_request 'https://github.com' +curl_request 'https://k8s.gcr.io' -echo "DF" +echo "df -h" df -h [ -e /proc/version ] && echo "These are the contents of /proc/version:" && cat /proc/version [ -f /etc/os-release ] && echo "These are the contents of /etc/os-release:" && cat /etc/os-release [ -f /etc/issue ] && echo "These are the contents of /etc/issue:" && cat /etc/issue -echo "These are the contents of /etc/*release:" && cat /etc/*release +echo "These are the contents of /etc/*release:" && cat /etc/*release if test $FAIL -ne 0 then