From fb2276ea02c3e3b950d1afd80d4949ff9a626019 Mon Sep 17 00:00:00 2001 From: Alan Raju <94040192+alanraju-aot@users.noreply.github.com> Date: Mon, 27 Nov 2023 21:36:45 -0800 Subject: [PATCH] Release 5.3.0 (#55) --------- Co-authored-by: Kiran K A --- CHANGELOG.md | 22 +- docker-compose/docker-compose-arm64.yml | 20 +- docker-compose/docker-compose-ee.yml | 312 ++++++++++++++++++ docker-compose/docker-compose.yml | 50 ++- docker-compose/sample.env | 10 +- scripts/install.bash | 409 +++++++++++------------- scripts/install.bat | 60 +++- 7 files changed, 640 insertions(+), 243 deletions(-) create mode 100644 docker-compose/docker-compose-ee.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 26be8e1..b32c701 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,26 @@ Mark items as `Added`, `Changed`, `Fixed`, `Removed`, `Untested Features`, `Upcoming Features`, `Known Issues` +## 5.3.0 - 2023-11-24 + +`Added` + +* Added `Data-analysis-api` service into docker-compose file. +* Added IP confirmation check to confirm the user IP. +* Added `Docker engine` versions that are tested and working fine. +* Added `docker-compose` file for Enterprise edition. + +`Modified` + +* Updated batch script by adding tested docker-versions +* Updated shell script for better understanding. +* Modified the environment variables. + +`Upcoming Features` + +* An update will be introduced to provide users with the option to run the data analysis API, making it an optional feature. +* An update in the script to enable a quick installation process specifically tailored for enterprise edition users. + ## 5.2.0 - 2023-07-07 `Added` @@ -38,4 +58,4 @@ Mark items as `Added`, `Changed`, `Fixed`, `Removed`, `Untested Features`, `Upc `Modified` * Reduced script size -* Fixed versions for databases \ No newline at end of file +* Fixed versions for databases diff --git a/docker-compose/docker-compose-arm64.yml b/docker-compose/docker-compose-arm64.yml index 714f82a..97585dd 100644 --- a/docker-compose/docker-compose-arm64.yml +++ b/docker-compose/docker-compose-arm64.yml @@ -53,17 +53,17 @@ services: - formsflow forms-flow-web: - image: formsflow/forms-flow-web:v5.2.0 + image: formsflow/forms-flow-web:v5.3.0 platform: linux/arm64/v8 links: - forms-flow-webapi entrypoint: /bin/sh -c "/usr/share/nginx/html/config/env.sh && nginx -g 'daemon off;'" environment: - # - MF_FORMSFLOW_WEB_URL=${MF_FORMSFLOW_WEB_URL:-https://forms-flow-microfrontends.aot-technologies.com/forms-flow-web@v5.2.0/forms-flow-web.gz.js} - # - MF_FORMSFLOW_NAV_URL=${MF_FORMSFLOW_NAV_URL:-https://forms-flow-microfrontends.aot-technologies.com/forms-flow-nav@v5.2.0/forms-flow-nav.gz.js} - # - MF_FORMSFLOW_SERVICE_URL=${MF_FORMSFLOW_SERVICE_URL:-https://forms-flow-microfrontends.aot-technologies.com/forms-flow-service@v5.2.0/forms-flow-service.gz.js} - # - MF_FORMSFLOW_ADMIN_URL=${MF_FORMSFLOW_ADMIN_URL:-https://forms-flow-microfrontends.aot-technologies.com/forms-flow-admin@v5.2.0/forms-flow-admin.gz.js} - # - MF_FORMSFLOW_THEME_URL=${MF_FORMSFLOW_THEME_URL:-https://forms-flow-microfrontends.aot-technologies.com/forms-flow-theme@v5.2.0/forms-flow-theme.gz.js} + # - MF_FORMSFLOW_WEB_URL=${MF_FORMSFLOW_WEB_URL:-https://forms-flow-microfrontends.aot-technologies.com/forms-flow-web@v5.3.0/forms-flow-web.gz.js} + # - MF_FORMSFLOW_NAV_URL=${MF_FORMSFLOW_NAV_URL:-https://forms-flow-microfrontends.aot-technologies.com/forms-flow-nav@v5.3.0/forms-flow-nav.gz.js} + # - MF_FORMSFLOW_SERVICE_URL=${MF_FORMSFLOW_SERVICE_URL:-https://forms-flow-microfrontends.aot-technologies.com/forms-flow-service@v5.3.0/forms-flow-service.gz.js} + # - MF_FORMSFLOW_ADMIN_URL=${MF_FORMSFLOW_ADMIN_URL:-https://forms-flow-microfrontends.aot-technologies.com/forms-flow-admin@v5.3.0/forms-flow-admin.gz.js} + # - MF_FORMSFLOW_THEME_URL=${MF_FORMSFLOW_THEME_URL:-https://forms-flow-microfrontends.aot-technologies.com/forms-flow-theme@v5.3.0/forms-flow-theme.gz.js} - NODE_ENV=${NODE_ENV:-production} - REACT_APP_API_SERVER_URL=${FORMIO_DEFAULT_PROJECT_URL} - REACT_APP_API_PROJECT_URL=${FORMIO_DEFAULT_PROJECT_URL} @@ -100,7 +100,7 @@ services: - formsflow forms-flow-forms: - image: formsflow/forms-flow-forms:v5.2.0 + image: formsflow/forms-flow-forms:v5.3.0 restart: always environment: DEBUG: formio:* @@ -131,7 +131,7 @@ services: - formsflow forms-flow-bpm: - image: formsflow/forms-flow-bpm:v5.2.0-arm64 + image: formsflow/forms-flow-bpm:v5.3.0-arm64 restart: always environment: - KEYCLOAK_URL=${KEYCLOAK_URL} @@ -186,7 +186,7 @@ services: - formsflow forms-flow-webapi: - image: formsflow/forms-flow-webapi:v5.2.0 + image: formsflow/forms-flow-webapi:v5.3.0 restart: always links: - forms-flow-webapi-db @@ -226,7 +226,7 @@ services: - formsflow forms-flow-documents: - image: formsflow/forms-flow-documents-api:v5.2.0-arm64 + image: formsflow/forms-flow-documents-api:v5.3.0-arm64 restart: always volumes: - ./:/app:rw diff --git a/docker-compose/docker-compose-ee.yml b/docker-compose/docker-compose-ee.yml new file mode 100644 index 0000000..ee4a017 --- /dev/null +++ b/docker-compose/docker-compose-ee.yml @@ -0,0 +1,312 @@ +version: '3.7' + +services: + keycloak-db: + image: postgres:14 + volumes: + - ./postgres/keycloak:/var/lib/postgresql/data 777 + environment: + POSTGRES_DB: ${KEYCLOAK_JDBC_DB:-keycloak} + POSTGRES_USER: ${KEYCLOAK_JDBC_USER:-admin} + POSTGRES_PASSWORD: ${KEYCLOAK_JDBC_PASSWORD:-changeme} + PGDATA: /var/lib/postgresql/data + networks: + - formsflow + + keycloak: + image: quay.io/keycloak/keycloak:14.0.0 + volumes: + - ./configuration/imports:/opt/jboss/keycloak/imports + command: + - "-b 0.0.0.0 -Dkeycloak.import=/opt/jboss/keycloak/imports/formsflow-ai-realm.json -Dkeycloak.migration.strategy=OVERWRITE_EXISTING" + environment: + - DB_VENDOR=POSTGRES + - DB_ADDR=keycloak-db + - DB_PORT=5432 + - DB_DATABASE=${KEYCLOAK_JDBC_DB:-keycloak} + - DB_USER=${KEYCLOAK_JDBC_USER-admin} + - DB_PASSWORD=${KEYCLOAK_JDBC_PASSWORD:-changeme} + - KEYCLOAK_USER=${KEYCLOAK_ADMIN_USER:-admin} + - KEYCLOAK_PASSWORD=${KEYCLOAK_ADMIN_PASSWORD:-changeme} + ports: + - "8080:8080" + links: + - keycloak-db + networks: + - formsflow + + forms-flow-forms-db: + image: mongo:5.0 + restart: always + environment: + MONGO_INITDB_ROOT_USERNAME: ${FORMIO_DB_USERNAME:-admin} + MONGO_INITDB_ROOT_PASSWORD: ${FORMIO_DB_PASSWORD:-changeme} + MONGO_INITDB_DATABASE: ${FORMIO_DB_NAME:-formio} + volumes: + - ./../../formsflow-forms/mongo_entrypoint/001_user.js:/docker-entrypoint-initdb.d/001_user.js:ro + - ./mongodb/data/db/:/data/db/ + - ./mongodb/data/log/:/var/log/mongodb/ + - ./mongodb/mongod.conf:/etc/mongod.conf + ports: + - "27018:27017" + networks: + - formsflow + + forms-flow-web: + image: formsflow/forms-flow-web-ee:v5.3.0 + links: + - forms-flow-webapi + entrypoint: /bin/sh -c "/usr/share/nginx/html/config/env.sh && nginx -g 'daemon off;'" + environment: + - NODE_ENV=${NODE_ENV:-production} + - REACT_APP_API_SERVER_URL=${FORMIO_DEFAULT_PROJECT_URL} + - REACT_APP_API_PROJECT_URL=${FORMIO_DEFAULT_PROJECT_URL} + - REACT_APP_KEYCLOAK_CLIENT=${KEYCLOAK_WEB_CLIENT_ID:-forms-flow-web} + - REACT_APP_WEB_BASE_URL=${FORMSFLOW_API_URL} + - REACT_APP_BPM_URL=${BPM_API_URL} + - REACT_APP_WEBSOCKET_ENCRYPT_KEY=${WEBSOCKET_ENCRYPT_KEY:-giert989jkwrgb@DR55} + - REACT_APP_KEYCLOAK_URL_REALM=${KEYCLOAK_URL_REALM:-forms-flow-ai} + - REACT_APP_KEYCLOAK_URL=${KEYCLOAK_URL} + - REACT_APP_APPLICATION_NAME=${APPLICATION_NAME:-formsflow.ai} + - REACT_APP_ENABLE_APPLICATION_ACCESS_PERMISSION_CHECK=${ENABLE_APPLICATION_ACCESS_PERMISSION_CHECK:-false} + - REACT_APP_WEB_BASE_CUSTOM_URL=${WEB_BASE_CUSTOM_URL} + - REACT_APP_MULTI_TENANCY_ENABLED=${MULTI_TENANCY_ENABLED:-false} + - REACT_APP_MT_ADMIN_BASE_URL=${MT_ADMIN_BASE_URL} + - REACT_APP_MT_ADMIN_BASE_URL_VERSION=${MT_ADMIN_BASE_URL_VERSION} + - REACT_APP_CUSTOM_SUBMISSION_URL=${CUSTOM_SUBMISSION_URL} + - REACT_APP_CUSTOM_SUBMISSION_ENABLED=${CUSTOM_SUBMISSION_ENABLED:-false} + - REACT_APP_DRAFT_ENABLED=${DRAFT_ENABLED:-false} + - REACT_APP_DRAFT_POLLING_RATE=${DRAFT_POLLING_RATE:-15000} + - REACT_APP_EXPORT_PDF_ENABLED=${EXPORT_PDF_ENABLED:-false} + - REACT_APP_PUBLIC_WORKFLOW_ENABLED=${PUBLIC_WORKFLOW_ENABLED:-false} + - REACT_APP_DOCUMENT_SERVICE_URL=${DOCUMENT_SERVICE_URL} + - REACT_APP_CUSTOM_THEME_URL=${CUSTOM_THEME_URL} + - REACT_APP_KEYCLOAK_ENABLE_CLIENT_AUTH=${KEYCLOAK_ENABLE_CLIENT_AUTH:-false} + - REACT_APP_ENABLE_FORMS_MODULE=${ENABLE_FORMS_MODULE:-true} + - REACT_APP_ENABLE_TASKS_MODULE=${ENABLE_TASKS_MODULE:-true} + - REACT_APP_ENABLE_DASHBOARDS_MODULE=${ENABLE_DASHBOARDS_MODULE:-true} + - REACT_APP_ENABLE_PROCESSES_MODULE=${ENABLE_PROCESSES_MODULE:-true} + - REACT_APP_ENABLE_APPLICATIONS_MODULE=${ENABLE_APPLICATIONS_MODULE:-true} + + ports: + - "3000:8080" + networks: + - formsflow + + forms-flow-forms: + image: formsflow/forms-flow-forms-ee:v5.3.0 + restart: always + environment: + DEBUG: formio:* + NODE_CONFIG: "{\"mongo\":\"mongodb://${FORMIO_DB_USERNAME:-admin}:${FORMIO_DB_PASSWORD:-changeme}@forms-flow-forms-db:27017/${FORMIO_DB_NAME:-formio}?authMechanism=SCRAM-SHA-1&authSource=admin\"}" + ROOT_EMAIL: ${FORMIO_ROOT_EMAIL:-admin@example.com} + ROOT_PASSWORD: ${FORMIO_ROOT_PASSWORD:-changeme} + FORMIO_DOMAIN: ${FORMIO_DEFAULT_PROJECT_URL} + FORMIO_JWT_SECRET: ${FORMIO_JWT_SECRET} + NO_INSTALL: ${NO_INSTALL:-1} + ports: + - "3001:3001" + links: + - forms-flow-forms-db + networks: + - formsflow + + forms-flow-bpm-db: + image: postgres:14 + environment: + POSTGRES_USER: ${CAMUNDA_JDBC_USER:-admin} + POSTGRES_PASSWORD: ${CAMUNDA_JDBC_PASSWORD:-changeme} + POSTGRES_DB: ${CAMUNDA_JDBC_DB_NAME:-formsflow-bpm} + volumes: + - ./postgres/camunda:/var/lib/postgresql/data 777 + ports: + - "5432:5432" + networks: + - formsflow + + forms-flow-bpm: + image: formsflow/forms-flow-bpm-ee:v5.3.0 + restart: always + environment: + - KEYCLOAK_URL=${KEYCLOAK_URL} + - KEYCLOAK_URL_REALM=${KEYCLOAK_URL_REALM:-forms-flow-ai} + - KEYCLOAK_CLIENTID=${KEYCLOAK_BPM_CLIENT_ID:-forms-flow-bpm} + - KEYCLOAK_CLIENTSECRET=${KEYCLOAK_BPM_CLIENT_SECRET:-e4bdbd25-1467-4f7f-b993-bc4b1944c943} + - CAMUNDA_JDBC_URL=${CAMUNDA_JDBC_URL:-jdbc:postgresql://forms-flow-bpm-db:5432/formsflow-bpm} + - CAMUNDA_JDBC_USER=${CAMUNDA_JDBC_USER:-admin} + - CAMUNDA_JDBC_PASSWORD=${CAMUNDA_JDBC_PASSWORD:-changeme} + - CAMUNDA_JDBC_DRIVER=${CAMUNDA_JDBC_DRIVER:-org.postgresql.Driver} + - CAMUNDA_APP_ROOT_LOG_FLAG=${CAMUNDA_APP_ROOT_LOG_FLAG:-error} + - FORMSFLOW_API_URL=${FORMSFLOW_API_URL} + - FORMIO_URL=${FORMIO_DEFAULT_PROJECT_URL} + - FORMIO_ROOT_EMAIL=${FORMIO_ROOT_EMAIL:-admin@example.com} + - FORMIO_ROOT_PASSWORD=${FORMIO_ROOT_PASSWORD:-changeme} + - APP_SECURITY_ORIGIN=${APP_SECURITY_ORIGIN:-*} + - WEBSOCKET_SECURITY_ORIGIN=${WEBSOCKET_SECURITY_ORIGIN} + - WEBSOCKET_MESSAGE_TYPE=${WEBSOCKET_MESSAGE_TYPE:-TASK_EVENT} + - WEBSOCKET_ENCRYPT_KEY=${WEBSOCKET_ENCRYPT_KEY:-giert989jkwrgb@DR55} + - DATA_BUFFER_SIZE=${DATA_BUFFER_SIZE:-2} + - IDENTITY_PROVIDER_MAX_RESULT_SIZE=${IDENTITY_PROVIDER_MAX_RESULT_SIZE:-250} + - DATA_ANALYSIS_URL=${DATA_ANALYSIS_API_BASE_URL}/analysis + - CUSTOM_SUBMISSION_URL=${CUSTOM_SUBMISSION_URL} + - CUSTOM_SUBMISSION_ENABLED=${CUSTOM_SUBMISSION_ENABLED:-false} + - MULTI_TENANCY_ENABLED=${MULTI_TENANCY_ENABLED:-false} + - FORMSFLOW_ADMIN_URL=${FORMSFLOW_ADMIN_URL:-} + - REDIS_ENABLED=${REDIS_ENABLED:-false} + - REDIS_HOST=${REDIS_HOST} + - REDIS_PORT=${REDIS_PORT:-6379} + - REDIS_PASSCODE=${REDIS_PASSCODE:-changeme} + - SESSION_COOKIE_SECURE=${SESSION_COOKIE_SECURE:-true} + ports: + - "8000:8080" + links: + - forms-flow-bpm-db + - keycloak + networks: + - formsflow + + forms-flow-webapi-db: + image: postgres:14 + restart: always + environment: + POSTGRES_USER: ${FORMSFLOW_API_DB_USER:-postgres} + POSTGRES_PASSWORD: ${FORMSFLOW_API_DB_PASSWORD:-changeme} + POSTGRES_DB: ${FORMSFLOW_API_DB_NAME:-webapi} + volumes: + - ./postgres/webapi:/var/lib/postgresql/data 777 + ports: + - "6432:5432" + networks: + - formsflow + + forms-flow-webapi: + image: formsflow/forms-flow-webapi-ee:v5.3.0 + restart: always + links: + - forms-flow-webapi-db + - forms-flow-forms + entrypoint: "/wait-for-service.sh forms-flow-webapi-db:5432 -s -- /wait-for-service.sh keycloak:8080 -s -- /wait-for-service.sh forms-flow-forms:3001 -s -- ./entrypoint.sh " + volumes: + - ./:/app:rw + environment: + INSIGHT_API_KEY: ${INSIGHT_API_KEY} + INSIGHT_API_URL: ${INSIGHT_API_URL} + DATABASE_URL: ${FORMSFLOW_API_DB_URL:-postgresql://postgres:changeme@forms-flow-webapi-db:5432/webapi} + BPM_TOKEN_API: ${KEYCLOAK_URL}/auth/realms/${KEYCLOAK_URL_REALM:-forms-flow-ai}/protocol/openid-connect/token + BPM_CLIENT_ID: ${KEYCLOAK_BPM_CLIENT_ID:-forms-flow-bpm} + BPM_CLIENT_SECRET: ${KEYCLOAK_BPM_CLIENT_SECRET:-e4bdbd25-1467-4f7f-b993-bc4b1944c943} + BPM_API_URL: ${BPM_API_URL} + FORMSFLOW_API_CORS_ORIGINS: ${FORMSFLOW_API_CORS_ORIGINS:-*} + JWT_OIDC_WELL_KNOWN_CONFIG: ${KEYCLOAK_URL}/auth/realms/${KEYCLOAK_URL_REALM:-forms-flow-ai}/.well-known/openid-configuration + JWT_OIDC_ALGORITHMS: 'RS256' + JWT_OIDC_JWKS_URI: ${KEYCLOAK_URL}/auth/realms/${KEYCLOAK_URL_REALM:-forms-flow-ai}/protocol/openid-connect/certs + JWT_OIDC_ISSUER: ${KEYCLOAK_URL}/auth/realms/${KEYCLOAK_URL_REALM:-forms-flow-ai} + JWT_OIDC_AUDIENCE: ${KEYCLOAK_WEB_CLIENT_ID:-forms-flow-web} + JWT_OIDC_CACHING_ENABLED: 'True' + JWT_OIDC_JWKS_CACHE_TIMEOUT: 300 + KEYCLOAK_URL: ${KEYCLOAK_URL} + KEYCLOAK_URL_REALM: ${KEYCLOAK_URL_REALM:-forms-flow-ai} + WEB_API_BASE_URL: ${FORMSFLOW_API_URL} + FORMIO_URL: ${FORMIO_DEFAULT_PROJECT_URL} + FORMIO_ROOT_EMAIL: ${FORMIO_ROOT_EMAIL:-admin@example.com} + FORMIO_ROOT_PASSWORD: ${FORMIO_ROOT_PASSWORD:-changeme} + CHROME_DRIVER_PATH: ${CHROME_DRIVER_PATH} + CUSTOM_SUBMISSION_URL: ${CUSTOM_SUBMISSION_URL} + CUSTOM_SUBMISSION_ENABLED: ${CUSTOM_SUBMISSION_ENABLED} + FORMIO_JWT_SECRET: ${FORMIO_JWT_SECRET:---- change me now ---} + ports: + - "5001:5000" + networks: + - formsflow + + forms-flow-documents-api: + image: formsflow/forms-flow-documents-api-ee:v5.3.0 + restart: always + links: + - forms-flow-forms + environment: + FORMSFLOW_API_CORS_ORIGINS: ${FORMSFLOW_API_CORS_ORIGINS:-*} + JWT_OIDC_WELL_KNOWN_CONFIG: ${KEYCLOAK_URL}/auth/realms/${KEYCLOAK_URL_REALM:-forms-flow-ai}/.well-known/openid-configuration + JWT_OIDC_JWKS_URI: ${KEYCLOAK_URL}/auth/realms/${KEYCLOAK_URL_REALM:-forms-flow-ai}/protocol/openid-connect/certs + JWT_OIDC_ISSUER: ${KEYCLOAK_URL}/auth/realms/${KEYCLOAK_URL_REALM:-forms-flow-ai} + JWT_OIDC_AUDIENCE: ${KEYCLOAK_WEB_CLIENT_ID:-forms-flow-web} + JWT_OIDC_CACHING_ENABLED: 'True' + KEYCLOAK_URL: ${KEYCLOAK_URL} + KEYCLOAK_URL_REALM: ${KEYCLOAK_URL_REALM:-forms-flow-ai} + FORMSFLOW_API_URL: ${FORMSFLOW_API_URL} + FORMSFLOW_DOC_API_URL: ${DOCUMENT_SERVICE_URL} + FORMIO_URL: ${FORMIO_DEFAULT_PROJECT_URL} + FORMIO_ROOT_EMAIL: ${FORMIO_ROOT_EMAIL:-admin@example.com} + FORMIO_ROOT_PASSWORD: ${FORMIO_ROOT_PASSWORD:-changeme} + CHROME_DRIVER_PATH: ${CHROME_DRIVER_PATH} + CUSTOM_SUBMISSION_URL: ${CUSTOM_SUBMISSION_URL} + CUSTOM_SUBMISSION_ENABLED: ${CUSTOM_SUBMISSION_ENABLED} + FORMIO_JWT_SECRET: ${FORMIO_JWT_SECRET:---- change me now ---} + MULTI_TENANCY_ENABLED: ${MULTI_TENANCY_ENABLED:-false} + KEYCLOAK_ENABLE_CLIENT_AUTH: ${KEYCLOAK_ENABLE_CLIENT_AUTH:-false} + ports: + - '5006:5006' + networks: + - formsflow + + forms-flow-data-analysis-db: + image: postgres:14 + environment: + POSTGRES_USER: ${DATA_ANALYSIS_DB_USER} + POSTGRES_PASSWORD: ${DATA_ANALYSIS_DB_PASSWORD} + POSTGRES_DB: ${DATA_ANALYSIS_DB_NAME} + POSTGRES_HOST_AUTH_METHOD: "trust" + volumes: + - ./postgres/data-analysis-api/:/var/lib/postgresql/data 777 + networks: + - formsflow + ports: + - '5430:5432' + + forms-flow-data-analysis-api: + image: formsflow/forms-flow-data-analysis-api:v5.3.0 + restart: always + links: + - forms-flow-data-analysis-db + volumes: + - ./:/app:rw + environment: + POSTGRES_USER: ${DATA_ANALYSIS_DB_USER:-general} + POSTGRES_PASSWORD: ${DATA_ANALYSIS_DB_PASSWORD:-changeme} + POSTGRES_DB: ${DATA_ANALYSIS_DB_NAME:-dataanalysis} + JWT_OIDC_WELL_KNOWN_CONFIG: ${KEYCLOAK_URL}/auth/realms/${KEYCLOAK_URL_REALM:-forms-flow-ai}/.well-known/openid-configuration + JWT_OIDC_ALGORITHMS: 'RS256' + JWT_OIDC_JWKS_URI: ${KEYCLOAK_URL}/auth/realms/${KEYCLOAK_URL_REALM:-forms-flow-ai}/protocol/openid-connect/certs + JWT_OIDC_ISSUER: ${KEYCLOAK_URL}/auth/realms/${KEYCLOAK_URL_REALM:-forms-flow-ai} + JWT_OIDC_AUDIENCE: ${KEYCLOAK_WEB_CLIENT_ID:-forms-flow-web} + JWT_OIDC_CACHING_ENABLED: 'True' + JWT_OIDC_JWKS_CACHE_TIMEOUT: 300 + DATA_ANALYSIS_API_BASE_URL: ${DATA_ANALYSIS_API_BASE_URL} + MODEL_ID: ${MODEL_ID:-Seethal/sentiment_analysis_generic_dataset} + DATABASE_SUPPORT: ${DATABASE_SUPPORT:-DISABLED} + ports: + - '6000:5001' + networks: + - formsflow + + proxy: + image: nginx:stable-alpine + volumes: + - ./configuration/conf.d/nginx.conf:/etc/nginx/nginx.conf + restart: unless-stopped + links: + - forms-flow-bpm + - forms-flow-web + - forms-flow-webapi + - forms-flow-forms + ports: + - "8081:8081" + networks: + - formsflow + +volumes: + postgres: + mongodb: +networks: + formsflow: + driver: bridge diff --git a/docker-compose/docker-compose.yml b/docker-compose/docker-compose.yml index 9f08580..6efcee3 100644 --- a/docker-compose/docker-compose.yml +++ b/docker-compose/docker-compose.yml @@ -53,7 +53,7 @@ services: - formsflow forms-flow-web: - image: formsflow/forms-flow-web:v5.2.0 + image: formsflow/forms-flow-web:v5.3.0 links: - forms-flow-webapi entrypoint: /bin/sh -c "/usr/share/nginx/html/config/env.sh && nginx -g 'daemon off;'" @@ -94,7 +94,7 @@ services: - formsflow forms-flow-forms: - image: formsflow/forms-flow-forms:v5.2.0 + image: formsflow/forms-flow-forms:v5.3.0 restart: always environment: DEBUG: formio:* @@ -125,7 +125,7 @@ services: - formsflow forms-flow-bpm: - image: formsflow/forms-flow-bpm:v5.2.0 + image: formsflow/forms-flow-bpm:v5.3.0 restart: always environment: - KEYCLOAK_URL=${KEYCLOAK_URL} @@ -180,7 +180,7 @@ services: - formsflow forms-flow-webapi: - image: formsflow/forms-flow-webapi:v5.2.0 + image: formsflow/forms-flow-webapi:v5.3.0 restart: always links: - forms-flow-webapi-db @@ -220,7 +220,7 @@ services: - formsflow forms-flow-documents-api: - image: formsflow/forms-flow-documents-api:v5.2.0 + image: formsflow/forms-flow-documents-api:v5.3.0 restart: always links: - forms-flow-forms @@ -249,6 +249,46 @@ services: networks: - formsflow + forms-flow-data-analysis-db: + image: postgres:14 + environment: + POSTGRES_USER: ${DATA_ANALYSIS_DB_USER} + POSTGRES_PASSWORD: ${DATA_ANALYSIS_DB_PASSWORD} + POSTGRES_DB: ${DATA_ANALYSIS_DB_NAME} + POSTGRES_HOST_AUTH_METHOD: "trust" + volumes: + - ./postgres/data-analysis-api/:/var/lib/postgresql/data 777 + networks: + - formsflow + ports: + - '5430:5432' + + forms-flow-data-analysis-api: + image: formsflow/forms-flow-data-analysis-api:v5.3.0 + restart: always + links: + - forms-flow-data-analysis-db + volumes: + - ./:/app:rw + environment: + POSTGRES_USER: ${DATA_ANALYSIS_DB_USER:-general} + POSTGRES_PASSWORD: ${DATA_ANALYSIS_DB_PASSWORD:-changeme} + POSTGRES_DB: ${DATA_ANALYSIS_DB_NAME:-dataanalysis} + JWT_OIDC_WELL_KNOWN_CONFIG: ${KEYCLOAK_URL}/auth/realms/${KEYCLOAK_URL_REALM:-forms-flow-ai}/.well-known/openid-configuration + JWT_OIDC_ALGORITHMS: 'RS256' + JWT_OIDC_JWKS_URI: ${KEYCLOAK_URL}/auth/realms/${KEYCLOAK_URL_REALM:-forms-flow-ai}/protocol/openid-connect/certs + JWT_OIDC_ISSUER: ${KEYCLOAK_URL}/auth/realms/${KEYCLOAK_URL_REALM:-forms-flow-ai} + JWT_OIDC_AUDIENCE: ${KEYCLOAK_WEB_CLIENT_ID:-forms-flow-web} + JWT_OIDC_CACHING_ENABLED: 'True' + JWT_OIDC_JWKS_CACHE_TIMEOUT: 300 + DATA_ANALYSIS_API_BASE_URL: ${DATA_ANALYSIS_API_BASE_URL} + MODEL_ID: ${MODEL_ID:-Seethal/sentiment_analysis_generic_dataset} + DATABASE_SUPPORT: ${DATABASE_SUPPORT:-DISABLED} + ports: + - '6001:5000' + networks: + - formsflow + proxy: image: nginx:stable-alpine volumes: diff --git a/docker-compose/sample.env b/docker-compose/sample.env index 07b8a8e..0ce3d67 100644 --- a/docker-compose/sample.env +++ b/docker-compose/sample.env @@ -199,13 +199,13 @@ CUSTOM_SUBMISSION_URL=http://{your-ip-address}:{port} #The MF Variables below are used to get MicroFrontend Components Created ##For running locally or if have custom changes then change the url to the one forms-flow-web folder content is running -#MF_FORMSFLOW_WEB_URL=https://s3.ap-northeast-1.amazonaws.com/formsflow.ai-micro-front-ends/forms-flow-web@v5.2.0/single-spa-build.gz.js +#MF_FORMSFLOW_WEB_URL=https://s3.ap-northeast-1.amazonaws.com/formsflow.ai-micro-front-ends/forms-flow-web@v5.3.0/single-spa-build.gz.js ## Refer Github Repo https://github.com/AOT-Technologies/forms-flow-ai-micro-front-ends and update to your own custom implementation for the Components here -#MF_FORMSFLOW_NAV_URL=https://s3.ap-northeast-1.amazonaws.com/formsflow.ai-micro-front-ends/forms-flow-nav@v5.2.0/forms-flow-nav.gz.js -#MF_FORMSFLOW_SERVICE_URL=https://s3.ap-northeast-1.amazonaws.com/formsflow.ai-micro-front-ends/forms-flow-service@v5.2.0/forms-flow-service.gz.js -#MF_FORMSFLOW_ADMIN_URL=https://s3.ap-northeast-1.amazonaws.com/formsflow.ai-micro-front-ends/forms-flow-admin@v5.2.0/forms-flow-admin.gz.js -#MF_FORMSFLOW_THEME_URL=https://s3.ap-northeast-1.amazonaws.com/formsflow.ai-micro-front-ends/forms-flow-theme@v5.2.0/forms-flow-theme.gz.js +#MF_FORMSFLOW_NAV_URL=https://s3.ap-northeast-1.amazonaws.com/formsflow.ai-micro-front-ends/forms-flow-nav@v5.3.0/forms-flow-nav.gz.js +#MF_FORMSFLOW_SERVICE_URL=https://s3.ap-northeast-1.amazonaws.com/formsflow.ai-micro-front-ends/forms-flow-service@v5.3.0/forms-flow-service.gz.js +#MF_FORMSFLOW_ADMIN_URL=https://s3.ap-northeast-1.amazonaws.com/formsflow.ai-micro-front-ends/forms-flow-admin@v5.3.0/forms-flow-admin.gz.js +#MF_FORMSFLOW_THEME_URL=https://s3.ap-northeast-1.amazonaws.com/formsflow.ai-micro-front-ends/forms-flow-theme@v5.3.0/forms-flow-theme.gz.js #++++++++++++++++--- formsflow.ai Web Microfrontend components ENV Variables - STOP ---+++++++++++++++++++++++++# diff --git a/scripts/install.bash b/scripts/install.bash index 6fdad9c..b7ad8f8 100755 --- a/scripts/install.bash +++ b/scripts/install.bash @@ -1,253 +1,222 @@ #!/bin/bash -ipadd=$(hostname -I | awk '{print $1}') -webapi_port=5001 -if [ "$(uname)" == "Darwin" ]; then - ipadd=$(ipconfig getifaddr en0) -fi - -docker_compose_file='docker-compose.yml' -if [ "$(uname -m)" == "arm64" ]; then - docker_compose_file='docker-compose-arm64.yml' -fi - -echo "Do you wish to continue installation that include ANALYTICS? [y/n]" -read choice -if [[ $choice == "y" ]]; then - ANALYTICS=1 -elif [[ $choice == "n" ]]; then - ANALYTICS=0 -fi -echo "Confirm that your IPv4 address is $ipadd [y/n]" -read choice -if [[ $choice == "y" ]]; then - ipadd=$ipadd - echo "$ipadd" -elif [[ $choice == "n" ]]; then - read -p "Enter your IP Adress: " ipadd - echo "$ipadd" -fi - -KEYCLOAK_BPM_CLIENT_SECRET="e4bdbd25-1467-4f7f-b993-bc4b1944c943" -KEYCLOAK_URL="http://$ipadd:8080" -KEYCLOAK_URL_REALM="forms-flow-ai" - -############################################################# -######################### main function ##################### -############################################################# - -function main -{ - keycloak - if [[ $ANALYTICS == 1 ]]; then - formsFlowAnalytics - formsFlowForms - elif [[ $ANALYTICS == 0 ]]; then - formsFlowForms - fi - - formsFlowBpm - installconfig - formsFlowApi - formsFlowDocuments - formsFlowWeb +# Function to determine the IP address +get_ip_address() { + ipadd=$(hostname -I | awk '{print $1}') + if [ "$(uname)" == "Darwin" ]; then + ipadd=$(ipconfig getifaddr en0) + fi } -function isUp -{ - # Check if the web api is up - api_status="$(curl -LI http://$ipadd:$webapi_port -o /dev/null -w '%{http_code}\n' -s)" - if [[ $api_status == 200 ]]; then - echo "********************** formsflow.ai is successfully installed ****************************" - else - echo "Finishing setup" - sleep 5 - isUp +# Function to set the appropriate Docker Compose file based on the architecture +set_docker_compose_file() { + docker_compose_file='docker-compose.yml' + if [ "$(uname -m)" == "arm64" ]; then + docker_compose_file='docker-compose-arm64.yml' fi - } -############################################################# -######################## creating config.js ################# -############################################################# +# Define the array of valid Docker versions +validVersions=("24.0.6" "24.0.5" "24.0.4" "24.0.3" "24.0.2" "24.0.1" "24.0.0" "23.0.6" "23.0.5" "23.0.4" "23.0.3" "23.0.2" "23.0.1" "23.0.0" "20.10.24" "20.10.23") -function installconfig -{ -# cd configuration/ -# pwd -# if [[ -f config.js ]]; then -# rm config.js -# fi +# Run the docker -v command and capture its output +docker_info=$(docker -v 2>&1) - NODE_ENV="development" - DRAFT_ENABLED=true - EXPORT_PDF_ENABLED=true - DOCUMENT_SERVICE_URL="http://$ipadd:5006" +# Extract the Docker version using string manipulation +docker_version=$(echo "$docker_info" | awk '{print $3}' | tr -d ,) +# Display the extracted Docker version +echo "Docker version: $docker_version" - echo NODE_ENV=$NODE_ENV>>.env - echo DRAFT_ENABLED=$DRAFT_ENABLED>>.env - echo DOCUMENT_SERVICE_URL=$DOCUMENT_SERVICE_URL>>.env - echo EXPORT_PDF_ENABLED=$EXPORT_PDF_ENABLED>>.env +# Check if the user's version is in the list +versionFound=false +for version in "${validVersions[@]}"; do + if [ "$docker_version" == "$version" ]; then + versionFound=true + break + fi +done + +# If the user's version is not found, display a warning and prompt for continuation +if [ "$versionFound" == false ]; then + echo "This Docker version is not tested!" + read -p "Do you want to continue? [y/n]: " continue + if [ "$continue" != "y" ]; then + exit + fi +fi +# Function to check if the web API is up +isUp() { + while true; do + HTTP=$(curl -LI "http://$ip_add:5001" -o /dev/null -w "%{http_code}" -s) + if [ "$HTTP" == "200" ]; then + echo "formsflow.ai is successfully installed." + exit 0 + else + echo "Finishing setup." + sleep 6 + fi + done } -############################################################# -###################### forms-flow-Analytics ################# -############################################################# - -function formsFlowAnalytics -{ - REDASH_HOST=http://$ipadd:7001 - PYTHONUNBUFFERED=0 - REDASH_LOG_LEVEL=INFO - REDASH_REDIS_URL=redis://redis:6379/0 - POSTGRES_USER=postgres - POSTGRES_PASSWORD=changeme - POSTGRES_DB=postgres - REDASH_COOKIE_SECRET=redash-selfhosted - REDASH_SECRET_KEY=redash-selfhosted - REDASH_DATABASE_URL=postgresql://postgres:changeme@postgres/postgres - REDASH_CORS_ACCESS_CONTROL_ALLOW_ORIGIN=* - REDASH_REFERRER_POLICY=no-referrer-when-downgrade - REDASH_CORS_ACCESS_CONTROL_ALLOW_HEADERS=Content-Type,Authorization - - echo REDASH_HOST=$REDASH_HOST>>.env - echo PYTHONUNBUFFERED=$PYTHONUNBUFFERED>>.env - echo REDASH_LOG_LEVEL=$REDASH_LOG_LEVEL>>.env - echo REDASH_REDIS_URL=$REDASH_REDIS_URL>>.env - echo POSTGRES_USER=$POSTGRES_USER>>.env - echo POSTGRES_PASSWORD=$POSTGRES_PASSWORD>>.env - echo POSTGRES_DB=$POSTGRES_DB>>.env - echo REDASH_COOKIE_SECRET=$REDASH_COOKIE_SECRET>>.env - echo REDASH_SECRET_KEY=$REDASH_SECRET_KEY>>.env - echo REDASH_DATABASE_URL=$REDASH_DATABASE_URL>>.env - echo REDASH_CORS_ACCESS_CONTROL_ALLOW_ORIGIN=$REDASH_CORS_ACCESS_CONTROL_ALLOW_ORIGIN>>.env - echo REDASH_REFERRER_POLICY=$REDASH_REFERRER_POLICY>>.env - echo REDASH_CORS_ACCESS_CONTROL_ALLOW_HEADERS=$REDASH_CORS_ACCESS_CONTROL_ALLOW_HEADERS>>.env - - docker-compose -p formsflow-ai -f analytics-docker-compose.yml run --rm server create_db - docker-compose -p formsflow-ai -f analytics-docker-compose.yml up --build -d +# Function to find the IPv4 address +find_my_ip() { + ipadd=$(hostname -I | awk '{print $1}') + ip_add=$ipadd + read -p "Confirm that your IPv4 address is $ip_add? [y/n]: " choice + if [ "$choice" != "y" ]; then + read -p "What is your IPv4 address? " ip_add + fi } -############################################################# -######################## forms-flow-bpm ##################### -############################################################# - -function formsFlowBpm -{ - FORMSFLOW_API_URL=http://$ipadd:$webapi_port - WEBSOCKET_SECURITY_ORIGIN=http://$ipadd:3000 - SESSION_COOKIE_SECURE=false - - echo KEYCLOAK_URL=$KEYCLOAK_URL >> .env - echo KEYCLOAK_BPM_CLIENT_SECRET=$KEYCLOAK_BPM_CLIENT_SECRET >>.env - echo FORMSFLOW_API_URL=$FORMSFLOW_API_URL >>.env - echo WEBSOCKET_SECURITY_ORIGIN=$WEBSOCKET_SECURITY_ORIGIN >> .env - echo SESSION_COOKIE_SECURE=${SESSION_COOKIE_SECURE} >> .env - docker-compose -p formsflow-ai -f $docker_compose_file up --build -d forms-flow-bpm +# Function to set common properties +set_common_properties() { + WEBSOCKET_ENCRYPT_KEY="giert989jkwrgb@DR55" + KEYCLOAK_BPM_CLIENT_SECRET="e4bdbd25-1467-4f7f-b993-bc4b1944c943" + export WEBSOCKET_ENCRYPT_KEY + export KEYCLOAK_BPM_CLIENT_SECRET } -############################################################# -######################## forms-flow-webapi ################## -############################################################# - -function formsFlowApi -{ - BPM_API_URL=http://$ipadd:8000/camunda - echo BPM_API_URL=$BPM_API_URL >> .env - if [[ $ANALYTICS == 1 ]]; then ( - echo What is your Redash API key? - read INSIGHT_API_KEY - INSIGHT_API_URL=http://$ipadd:7001 - echo INSIGHT_API_URL=$INSIGHT_API_URL >> .env - echo INSIGHT_API_KEY=$INSIGHT_API_KEY >> .env - ) +# Function to start Keycloak +keycloak() { + cd ../docker-compose/ + if [ -f "$1/.env" ]; then + rm "$1/.env" fi - - docker-compose -p formsflow-ai -f $docker_compose_file up --build -d forms-flow-webapi -} - -############################################################# -######################## forms-flow-documents ################## -############################################################# - -function formsFlowDocuments -{ - FORMSFLOW_DOC_API_URL=http://$ipadd:5006 - echo DOCUMENT_SERVICE_URL=$DOCUMENT_SERVICE_URL >>.env - - docker-compose -p formsflow-ai -f $docker_compose_file up --build -d forms-flow-documents + docker-compose -p formsflow-ai -f "$1/docker-compose.yml" up --build -d keycloak + sleep 5 + KEYCLOAK_URL="http://$ip_add:8080" + export KEYCLOAK_URL } -############################################################# -######################## forms-flow-forms ################### -############################################################# +# Function to start forms-flow-forms +forms_flow_forms() { + FORMIO_DEFAULT_PROJECT_URL="http://$ip_add:3001" + echo "FORMIO_DEFAULT_PROJECT_URL=$FORMIO_DEFAULT_PROJECT_URL" >> "$1/.env" + docker-compose -p formsflow-ai -f "$1/docker-compose.yml" up --build -d forms-flow-forms + sleep 5 +} -function formsFlowForms -{ - cd ../docker-compose - FORMIO_DEFAULT_PROJECT_URL=http://$ipadd:3001 +# Function to start forms-flow-web +forms_flow_web() { + BPM_API_URL="http://$ip_add:8000/camunda" + echo "BPM_API_URL=$BPM_API_URL" >> "$1/.env" + docker-compose -p formsflow-ai -f "$1/docker-compose.yml" up --build -d forms-flow-web +} - echo FORMIO_DEFAULT_PROJECT_URL=$FORMIO_DEFAULT_PROJECT_URL>>.env +# Function to start forms-flow-bpm +forms_flow_bpm() { + FORMSFLOW_API_URL="http://$ip_add:5001" + WEBSOCKET_SECURITY_ORIGIN="http://$ip_add:3000" + SESSION_COOKIE_SECURE="false" + echo "FORMSFLOW_API_URL=$FORMSFLOW_API_URL" >> "$1/.env" + echo "WEBSOCKET_SECURITY_ORIGIN=$WEBSOCKET_SECURITY_ORIGIN" >> "$1/.env" + echo "SESSION_COOKIE_SECURE=$SESSION_COOKIE_SECURE" >> "$1/.env" + docker-compose -p formsflow-ai -f "$1/docker-compose.yml" up --build -d forms-flow-bpm + sleep 6 +} - docker-compose -p formsflow-ai -f $docker_compose_file up --build -d forms-flow-forms +# Function to start forms-flow-analytics +forms_flow_analytics() { + REDASH_HOST="http://$ip_add:7001" + PYTHONUNBUFFERED="0" + REDASH_LOG_LEVEL="INFO" + REDASH_REDIS_URL="redis://redis:6379/0" + POSTGRES_USER="postgres" + POSTGRES_PASSWORD="changeme" + POSTGRES_DB="postgres" + REDASH_COOKIE_SECRET="redash-selfhosted" + REDASH_SECRET_KEY="redash-selfhosted" + REDASH_DATABASE_URL="postgresql://postgres:changeme@postgres/postgres" + REDASH_CORS_ACCESS_CONTROL_ALLOW_ORIGIN="*" + REDASH_REFERRER_POLICY="no-referrer-when-downgrade" + REDASH_CORS_ACCESS_CONTROL_ALLOW_HEADERS="Content-Type, Authorization" + echo "REDASH_HOST=$REDASH_HOST" >> "$1/.env" + echo "PYTHONUNBUFFERED=$PYTHONUNBUFFERED" >> "$1/.env" + echo "REDASH_LOG_LEVEL=$REDASH_LOG_LEVEL" >> "$1/.env" + echo "REDASH_REDIS_URL=$REDASH_REDIS_URL" >> "$1/.env" + echo "POSTGRES_USER=$POSTGRES_USER" >> "$1/.env" + echo "POSTGRES_PASSWORD=$POSTGRES_PASSWORD" >> "$1/.env" + echo "POSTGRES_DB=$POSTGRES_DB" >> "$1/.env" + echo "REDASH_COOKIE_SECRET=$REDASH_COOKIE_SECRET" >> "$1/.env" + echo "REDASH_SECRET_KEY=$REDASH_SECRET_KEY" >> "$1/.env" + echo "REDASH_DATABASE_URL=$REDASH_DATABASE_URL" >> "$1/.env" + echo "REDASH_CORS_ACCESS_CONTROL_ALLOW_ORIGIN=$REDASH_CORS_ACCESS_CONTROL_ALLOW_ORIGIN" >> "$1/.env" + echo "REDASH_REFERRER_POLICY=$REDASH_REFERRER_POLICY" >> "$1/.env" + echo "REDASH_CORS_ACCESS_CONTROL_ALLOW_HEADERS=$REDASH_CORS_ACCESS_CONTROL_ALLOW_HEADERS" >> "$1/.env" + docker-compose -p formsflow-ai -f "$1/analytics-docker-compose.yml" run --rm server create_db + docker-compose -p formsflow-ai -f "$1/analytics-docker-compose.yml" up --build -d + sleep 5 +} +# Function to start forms-flow-webapi +forms_flow_api() { + if [ "$2" == "1" ]; then + read -p "What is your Redash API key? " INSIGHT_API_KEY + INSIGHT_API_URL="http://$ip_add:7001" + echo "INSIGHT_API_URL=$INSIGHT_API_URL" >> "$1/.env" + echo "INSIGHT_API_KEY=$INSIGHT_API_KEY" >> "$1/.env" + fi + docker-compose -p formsflow-ai -f "$1/docker-compose.yml" up --build -d forms-flow-webapi } -function formsFlowWeb -{ -cd ../docker-compose/ -docker-compose -p formsflow-ai -f $docker_compose_file up --build -d forms-flow-web -isUp + +# Function to start forms-flow-documents-api +forms_flow_documents() { + DOCUMENT_SERVICE_URL="http://$ip_add:5006" + echo "DOCUMENT_SERVICE_URL=$DOCUMENT_SERVICE_URL" >> "$1/.env" + docker-compose -p formsflow-ai -f "$1/docker-compose.yml" up --build -d forms-flow-documents-api + sleep 5 } -############################################################# -########################### Keycloak ######################## -############################################################# +# Function to start forms-flow-data-analysis-api +forms_flow_data_analysis() { + DATA_ANALYSIS_API_BASE_URL="http://$ip_add:6001" + DATA_ANALYSIS_DB_URL="postgresql://general:changeme@forms-flow-data-analysis-db:5432/dataanalysis" + echo "DATA_ANALYSIS_API_BASE_URL=$DATA_ANALYSIS_API_BASE_URL" >> "$1/.env" + echo "DATA_ANALYSIS_DB_URL=$DATA_ANALYSIS_DB_URL" >> "$1/.env" + docker-compose -p formsflow-ai -f "$1/docker-compose.yml" up --build -d forms-flow-data-analysis-api + sleep 5 +} -function keycloak -{ - cd ../docker-compose/ - if [[ -f .env ]]; then - rm .env +# Main function +main() { + set_common_properties + find_my_ip + keycloak "$1" + forms_flow_forms "$1" + forms_flow_web "$1" + forms_flow_bpm "$1" + forms_flow_analytics "$1" + if [ "$1" == "1" ]; then + forms_flow_api "$1" "$2" fi - function defaultinstallation - { - echo WE ARE SETING UP OUR DEFAULT KEYCLOCK FOR YOU - printf "%s " "Press enter to continue" - read that - echo Please wait, keycloak is setting up! - docker-compose -p formsflow-ai -f $docker_compose_file up --build -d keycloak - } + forms_flow_documents "$1" + forms_flow_data_analysis "$1" + isUp + echo "********************** formsflow.ai is successfully installed ****************************" + exit 0 } -function orderwithanalytics -{ - echo installation will be completed in the following order: - echo 1. keycloak - echo 2. analytics - echo 3. forms - echo 4. camunda - echo 5. webapi - echo 6. web - printf "%s " "Press enter to continue" - read that - main -} -function withoutanalytics -{ - echo installation will be completed in the following order: - echo 1. keycloak - echo 2. forms - echo 3. camunda - echo 4. webapi - echo 5. web - printf "%s " "Press enter to continue" - read that - main -} -if [[ $ANALYTICS == 1 ]]; then - orderwithanalytics -elif [[ $ANALYTICS == 0 ]]; then - withoutanalytics + +# Check if Docker is installed and running +if ! command -v docker &> /dev/null; then + echo "Docker is not installed or not running. Please install and start Docker before running this script." + exit 1 +fi + +# Check if Docker Compose is installed +if ! command -v docker-compose &> /dev/null; then + echo "Docker Compose is not installed. Please install Docker Compose before running this script." + exit 1 +fi + +# Start the installation process +read -p "Do you want analytics to include in the installation? [y/n]: " choice +if [ "$choice" == "y" ]; then + analytics=1 +else + analytics=0 fi + +main "." "$analytics" diff --git a/scripts/install.bat b/scripts/install.bat index 14605c0..a4d578c 100644 --- a/scripts/install.bat +++ b/scripts/install.bat @@ -1,5 +1,49 @@ @echo off +setlocal EnableDelayedExpansion + +:: Define the array of valid Docker versions +set "validVersions=24.0.6 24.0.5 24.0.4 24.0.3 24.0.2 24.0.1 24.0.0 23.0.6 23.0.5 23.0.4 23.0.3 23.0.2 23.0.1 23.0.0 20.10.24 20.10.23" + +:: Run the docker -v command and capture its output +for /f "tokens=*" %%A in ('docker -v 2^>^&1') do ( + set "docker_info=%%A" +) + +:: Extract the Docker version using string manipulation +for /f "tokens=3" %%B in ("!docker_info!") do ( + set "docker_version=%%B" + set "docker_version=!docker_version:,=!" +) +:: Display the extracted Docker version +echo Docker version: %docker_version% + +:: Check if the user's version is in the list +set "versionFound=" +for %%B in (%validVersions%) do ( + if "!docker_version!" equ "%%B" ( + set "versionFound=true" + goto :VersionFound + ) +) + +:: If the user's version is not found, display a warning +echo This Docker version is not tested! +set /p continue=Do you want to continue? [y/n] +if %continue%== y ( + goto :start +) else ( + exit +) + +:VersionFound +:: Display a success message if the version is found +echo Your Docker version (%docker_version%) is tested and working! + +goto :start + +:start + set /p choice=Do you want analytics to include in the installation? [y/n] if %choice%==y ( set /a analytics=1 @@ -33,6 +77,7 @@ EXIT /B %ERRORLEVEL% call:forms-flow-web ..\docker-compose call:forms-flow-api ..\docker-compose %~1 call:forms-flow-documents ..\docker-compose + call:forms-flow-data-analysis-api ..\docker-compose call:isUp EXIT /B 0 @@ -180,12 +225,10 @@ EXIT /B %ERRORLEVEL% SETLOCAL - set BPM_API_URL=http://%ip-add%:8000/camunda if %~2==1 ( set /p INSIGHT_API_KEY="What is your Redash API key?" set INSIGHT_API_URL=http://%ip-add%:7001 ) - echo BPM_API_URL=%BPM_API_URL%>>%~1\.env if %~2==1 ( echo INSIGHT_API_URL=%INSIGHT_API_URL%>>%~1\.env echo INSIGHT_API_KEY=%INSIGHT_API_KEY%>>%~1\.env @@ -208,3 +251,16 @@ EXIT /B %ERRORLEVEL% timeout 5 EXIT /B 0 +:forms-flow-data-analysis-api + + SETLOCAL + set DATA_ANALYSIS_API_BASE_URL=http://%ip-add%:6001 + set DATA_ANALYSIS_DB_URL=postgresql://general:changeme@forms-flow-data-analysis-db:5432/dataanalysis + + echo DATA_ANALYSIS_API_BASE_URL=%DATA_ANALYSIS_API_BASE_URL%>>%~1\.env + echo DATA_ANALYSIS_DB_URL=%DATA_ANALYSIS_DB_URL%>>%~1\.env + + docker-compose -p formsflow-ai -f %~1\docker-compose.yml up --build -d forms-flow-data-analysis-api + timeout 5 + EXIT /B 0 +