Skip to content

Commit

Permalink
Adding skip logs option to API and documents
Browse files Browse the repository at this point in the history
  • Loading branch information
sumesh-aot committed Mar 14, 2024
1 parent e2263cb commit a6b213f
Show file tree
Hide file tree
Showing 20 changed files with 66 additions and 38 deletions.
14 changes: 7 additions & 7 deletions deployment/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,15 +211,15 @@ services:
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_TOKEN_API: ${KEYCLOAK_URL}${KEYCLOAK_URL_HTTP_RELATIVE_PATH:-/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_WELL_KNOWN_CONFIG: ${KEYCLOAK_URL}${KEYCLOAK_URL_HTTP_RELATIVE_PATH:-/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_JWKS_URI: ${KEYCLOAK_URL}${KEYCLOAK_URL_HTTP_RELATIVE_PATH:-/auth}/realms/${KEYCLOAK_URL_REALM:-forms-flow-ai}/protocol/openid-connect/certs
JWT_OIDC_ISSUER: ${KEYCLOAK_URL}${KEYCLOAK_URL_HTTP_RELATIVE_PATH:-/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
Expand Down Expand Up @@ -255,9 +255,9 @@ services:
environment:
DATABASE_URL: ${FORMSFLOW_API_DB_URL:-postgresql://postgres:changeme@forms-flow-webapi-db:5432/webapi}
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_WELL_KNOWN_CONFIG: ${KEYCLOAK_URL}${KEYCLOAK_URL_HTTP_RELATIVE_PATH:-/auth}/realms/${KEYCLOAK_URL_REALM:-forms-flow-ai}/.well-known/openid-configuration
JWT_OIDC_JWKS_URI: ${KEYCLOAK_URL}${KEYCLOAK_URL_HTTP_RELATIVE_PATH:-/auth}/realms/${KEYCLOAK_URL_REALM:-forms-flow-ai}/protocol/openid-connect/certs
JWT_OIDC_ISSUER: ${KEYCLOAK_URL}${KEYCLOAK_URL_HTTP_RELATIVE_PATH:-/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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,15 @@ def getFilesToDelete(self):
return result


def register_log_handlers(app, log_file, when, interval, backupCount):
def register_log_handlers(app, log_file, when, interval, backupCount, configure_log_file: bool = True):
"""Configure console and file log handlers."""
logs = logging.StreamHandler()
logs.setFormatter(CustomFormatter())
log_dir = os.path.dirname(log_file)
if not os.path.exists(log_dir):
os.makedirs(log_dir)
file_handler = CustomTimedRotatingFileHandler(log_file, when, interval, backupCount)
app.logger.handlers = [logs, file_handler]
if configure_log_file:
log_dir = os.path.dirname(log_file)
if not os.path.exists(log_dir):
os.makedirs(log_dir)
file_handler = CustomTimedRotatingFileHandler(log_file, when, interval, backupCount)
app.logger.handlers = [logs, file_handler]
else:
app.logger.handlers = [logs]
8 changes: 4 additions & 4 deletions forms-flow-api/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ services:
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_TOKEN_API: ${KEYCLOAK_URL}${KEYCLOAK_URL_HTTP_RELATIVE_PATH:-/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_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_WELL_KNOWN_CONFIG: ${KEYCLOAK_URL}${KEYCLOAK_URL_HTTP_RELATIVE_PATH:-/auth}/realms/${KEYCLOAK_URL_REALM:-forms-flow-ai}/.well-known/openid-configuration
JWT_OIDC_JWKS_URI: ${KEYCLOAK_URL}${KEYCLOAK_URL_HTTP_RELATIVE_PATH:-/auth}/realms/${KEYCLOAK_URL_REALM:-forms-flow-ai}/protocol/openid-connect/certs
JWT_OIDC_ISSUER: ${KEYCLOAK_URL}${KEYCLOAK_URL_HTTP_RELATIVE_PATH:-/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}
Expand Down
2 changes: 1 addition & 1 deletion forms-flow-api/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ecdsa==0.18.0
flask-jwt-oidc==0.3.0
flask-marshmallow==0.15.0
flask-restx==1.1.0
formsflow-api-utils @ git+https://github.com/AOT-Technologies/forms-flow-ai.git@master#subdirectory=forms-flow-api-utils
formsflow-api-utils @ git+https://github.com/AOT-Technologies/forms-flow-ai.git@ignore-logs#subdirectory=forms-flow-api-utils
gunicorn==21.2.0
h11==0.14.0
h2==4.1.0
Expand Down
2 changes: 1 addition & 1 deletion forms-flow-api/requirements/prod.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ Werkzeug
sqlalchemy_utils
markupsafe
PyJWT
git+https://github.com/AOT-Technologies/forms-flow-ai.git@master#egg=formsflow_api_utils&subdirectory=forms-flow-api-utils
git+https://github.com/AOT-Technologies/forms-flow-ai.git@ignore-logs#egg=formsflow_api_utils&subdirectory=forms-flow-api-utils
3 changes: 2 additions & 1 deletion forms-flow-api/sample.env
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,11 @@ FORMIO_ROOT_PASSWORD=changeme
#FORM_EMBED_JWT_SECRET=f6a69a42-7f8a-11ed-a1eb-0242ac120002

##Log File Rotation Configuration for API Logs
##CONFIGURE_LOGS: Set to 'false' to disable log file rotation. Default value is true
##API_LOG_ROTATION_WHEN: Specifies the frequency of log file rotation - 'd' for days, 'h' for hours, 'm' for minutes.
##API_LOG_ROTATION_INTERVAL: Sets the time interval for log file rotation - '1' for every day.
##API_LOG_BACKUP_COUNT: Determines the number of backup log files to keep - '7' for logs from the past 7 day.

#API_LOG_ROTATION_WHEN=d
#API_LOG_ROTATION_INTERVAL=1
#API_LOG_BACKUP_COUNT=7
#API_LOG_BACKUP_COUNT=7
1 change: 1 addition & 0 deletions forms-flow-api/src/formsflow_api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def create_app(
when=os.getenv("API_LOG_ROTATION_WHEN", "d"),
interval=int(os.getenv("API_LOG_ROTATION_INTERVAL", "1")),
backupCount=int(os.getenv("API_LOG_BACKUP_COUNT", "7")),
configure_log_file=app.config["CONFIGURE_LOGS"]
)

app.logger.propagate = False
Expand Down
4 changes: 4 additions & 0 deletions forms-flow-api/src/formsflow_api/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class _Config: # pylint: disable=too-few-public-methods
# Keycloak Admin Service
KEYCLOAK_URL = os.getenv("KEYCLOAK_URL")
KEYCLOAK_URL_REALM = os.getenv("KEYCLOAK_URL_REALM")
KEYCLOAK_URL_HTTP_RELATIVE_PATH = os.getenv("KEYCLOAK_URL_HTTP_RELATIVE_PATH", "/auth")

# Web url
WEB_BASE_URL = os.getenv("WEB_BASE_URL")
Expand All @@ -110,6 +111,9 @@ class _Config: # pylint: disable=too-few-public-methods
"FORM_EMBED_JWT_SECRET", "f6a69a42-7f8a-11ed-a1eb-0242ac120002"
)

# Configure LOG
CONFIGURE_LOGS = str(os.getenv("CONFIGURE_LOGS", default="true")).lower() == "true"


class DevConfig(_Config): # pylint: disable=too-few-public-methods
"""Development environment configuration."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ def __init__(self):
}
)
self.base_url = (
f"{current_app.config.get('KEYCLOAK_URL')}/auth/admin/realms/"
f"{current_app.config.get('KEYCLOAK_URL')}{current_app.config.get('KEYCLOAK_URL_HTTP_RELATIVE_PATH')}"
f"/admin/realms/"
f"{current_app.config.get('KEYCLOAK_URL_REALM')}"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ keycloak.url: ${KEYCLOAK_URL}
keycloak.url.realm: ${KEYCLOAK_URL_REALM}
keycloak.clientId: ${KEYCLOAK_CLIENTID}
keycloak.clientSecret: ${KEYCLOAK_CLIENTSECRET}
keycloak.url.httpRelativePath: ${KEYCLOAK_URL_HTTP_RELATIVE_PATH:/auth}


server:
port: 8080
Expand Down Expand Up @@ -98,15 +100,15 @@ spring:
authorizationGrantType: client_credentials
provider:
keycloak:
authorization-uri: ${keycloak.url}/auth/realms/${keycloak.url.realm}/protocol/openid-connect/auth
token-uri: ${keycloak.url}/auth/realms/${keycloak.url.realm}/protocol/openid-connect/token
user-info-uri: ${keycloak.url}/auth/realms/${keycloak.url.realm}/protocol/openid-connect/userinfo
authorization-uri: ${keycloak.url}${keycloak.url.httpRelativePath}/realms/${keycloak.url.realm}/protocol/openid-connect/auth
token-uri: ${keycloak.url}${keycloak.url.httpRelativePath}/realms/${keycloak.url.realm}/protocol/openid-connect/token
user-info-uri: ${keycloak.url}${keycloak.url.httpRelativePath}/realms/${keycloak.url.realm}/protocol/openid-connect/userinfo
user-name-attribute: preferred_username
jwk-set-uri: ${keycloak.url}/auth/realms/${keycloak.url.realm}/protocol/openid-connect/certs
issuer-uri: ${keycloak.url}/auth/realms/${keycloak.url.realm}
jwk-set-uri: ${keycloak.url}${keycloak.url.httpRelativePath}/realms/${keycloak.url.realm}/protocol/openid-connect/certs
issuer-uri: ${keycloak.url}${keycloak.url.httpRelativePath}/realms/${keycloak.url.realm}
resource-server:
jwt:
issuer-uri: ${keycloak.url}/auth/realms/${keycloak.url.realm}
issuer-uri: ${keycloak.url}${keycloak.url.httpRelativePath}/realms/${keycloak.url.realm}
main:
allow-bean-definition-overriding: true

Expand All @@ -124,8 +126,8 @@ plugin.identity.keycloak.rest:
authorityAttributeName: groupIds

plugin.identity.keycloak:
keycloakIssuerUrl: ${keycloak.url}/auth/realms/${keycloak.url.realm}
keycloakAdminUrl: ${keycloak.url}/auth/admin/realms/${keycloak.url.realm}
keycloakIssuerUrl: ${keycloak.url}${keycloak.url.httpRelativePath}/realms/${keycloak.url.realm}
keycloakAdminUrl: ${keycloak.url}${keycloak.url.httpRelativePath}/admin/realms/${keycloak.url.realm}
clientId: ${keycloak.clientId}
clientSecret: ${keycloak.clientSecret}
useEmailAsCamundaUserId: false
Expand Down
6 changes: 3 additions & 3 deletions forms-flow-data-analysis-api/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ services:
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_WELL_KNOWN_CONFIG: ${KEYCLOAK_URL}${KEYCLOAK_URL_HTTP_RELATIVE_PATH:-/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_JWKS_URI: ${KEYCLOAK_URL}${KEYCLOAK_URL_HTTP_RELATIVE_PATH:-/auth}/realms/${KEYCLOAK_URL_REALM:-forms-flow-ai}/protocol/openid-connect/certs
JWT_OIDC_ISSUER: ${KEYCLOAK_URL}${KEYCLOAK_URL_HTTP_RELATIVE_PATH:-/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
Expand Down
6 changes: 3 additions & 3 deletions forms-flow-documents/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ services:
environment:
DATABASE_URL: ${FORMSFLOW_API_DB_URL:-postgresql://postgres:changeme@forms-flow-webapi-db:5432/webapi}
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_WELL_KNOWN_CONFIG: ${KEYCLOAK_URL}${KEYCLOAK_URL_HTTP_RELATIVE_PATH:-/auth}/realms/${KEYCLOAK_URL_REALM:-forms-flow-ai}/.well-known/openid-configuration
JWT_OIDC_JWKS_URI: ${KEYCLOAK_URL}${KEYCLOAK_URL_HTTP_RELATIVE_PATH:-/auth}/realms/${KEYCLOAK_URL_REALM:-forms-flow-ai}/protocol/openid-connect/certs
JWT_OIDC_ISSUER: ${KEYCLOAK_URL}${KEYCLOAK_URL_HTTP_RELATIVE_PATH:-/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}
Expand Down
2 changes: 1 addition & 1 deletion forms-flow-documents/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ecdsa==0.18.0
flask-jwt-oidc==0.3.0
flask-marshmallow==0.15.0
flask-restx==1.1.0
formsflow-api-utils @ git+https://github.com/AOT-Technologies/forms-flow-ai.git@master#subdirectory=forms-flow-api-utils
formsflow-api-utils @ git+https://github.com/AOT-Technologies/forms-flow-ai.git@ignore-logs#subdirectory=forms-flow-api-utils
gunicorn==21.2.0
h11==0.14.0
h2==4.1.0
Expand Down
2 changes: 1 addition & 1 deletion forms-flow-documents/requirements/prod.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ PyJWT
selenium
selenium-wire
nested-lookup
git+https://github.com/AOT-Technologies/forms-flow-ai.git@master#egg=formsflow_api_utils&subdirectory=forms-flow-api-utils
git+https://github.com/AOT-Technologies/forms-flow-ai.git@ignore-logs#egg=formsflow_api_utils&subdirectory=forms-flow-api-utils
1 change: 1 addition & 0 deletions forms-flow-documents/sample.env
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ CUSTOM_SUBMISSION_ENABLED=false
CUSTOM_SUBMISSION_URL=http://{your-ip-address}:6212

##Log File Rotation Configuration for API Logs
##CONFIGURE_LOGS: Set to 'false' to disable log file rotation. Default value is true
##API_LOG_ROTATION_WHEN: Specifies the frequency of log file rotation - 'd' for days, 'h' for hours, 'm' for minutes.
##API_LOG_ROTATION_INTERVAL: Sets the time interval for log file rotation - '1' for every day.
##API_LOG_BACKUP_COUNT: Determines the number of backup log files to keep - '7' for logs from the past 7 day.
Expand Down
3 changes: 3 additions & 0 deletions forms-flow-documents/src/formsflow_documents/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,18 @@ def create_app(
)
app.logger = flask_logger
app.logger = logging.getLogger("app")

register_log_handlers(
app,
log_file="logs/forms-flow-documents-api.log",
when=os.getenv("API_LOG_ROTATION_WHEN", "d"),
interval=int(os.getenv("API_LOG_ROTATION_INTERVAL", "1")),
backupCount=int(os.getenv("API_LOG_BACKUP_COUNT", "7")),
configure_log_file=app.config["CONFIGURE_LOGS"]
)
app.logger.propagate = False
logging.log.propagate = False

with open("logo.txt") as file: # pylint: disable=unspecified-encoding
contents = file.read()
print(contents)
Expand Down
3 changes: 3 additions & 0 deletions forms-flow-documents/src/formsflow_documents/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ class _Config: # pylint: disable=too-few-public-methods
str(os.getenv("MULTI_TENANCY_ENABLED", default="false")).lower() == "true"
)

# Configure LOG
CONFIGURE_LOGS = str(os.getenv("CONFIGURE_LOGS", default="true")).lower() == "true"


class DevConfig(_Config): # pylint: disable=too-few-public-methods
"""Development environment configuration."""
Expand Down
1 change: 1 addition & 0 deletions forms-flow-web-root-config/public/config/config.sample.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ window["_env_"] = {
REACT_APP_KEYCLOAK_URL_REALM: "forms-flow-ai",
// Keycloak URL, default: http://{your-ip-address}:8080
REACT_APP_KEYCLOAK_URL: "<Keycloak URL>",
REACT_APP_KEYCLOAK_URL_HTTP_RELATIVE_PATH: "/auth",

//// Environment Variables for forms-flow-bpm ////
// bpm base api, default: http://{your-ip-address}:8000/camunda
Expand Down
2 changes: 2 additions & 0 deletions forms-flow-web-root-config/public/config/config.template.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ window["_env_"] = {
// Keycloak URL
REACT_APP_KEYCLOAK_URL: "${REACT_APP_KEYCLOAK_URL}",

REACT_APP_KEYCLOAK_URL_HTTP_RELATIVE_PATH: "${REACT_APP_KEYCLOAK_URL_HTTP_RELATIVE_PATH}",

////Environment Variables for forms-flow-bpm////

//Insight Api End point
Expand Down
8 changes: 7 additions & 1 deletion forms-flow-web/src/constants/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,13 @@ export const KEYCLOAK_REALM =
export const KEYCLOAK_URL =
(window._env_ && window._env_.REACT_APP_KEYCLOAK_URL) ||
process.env.REACT_APP_KEYCLOAK_URL;
export const KEYCLOAK_AUTH_URL = `${KEYCLOAK_URL}/auth`;

export const KEYCLOAK_URL_HTTP_RELATIVE_PATH =
(window._env_ && window._env_.REACT_APP_KEYCLOAK_URL_HTTP_RELATIVE_PATH) ||
process.env.REACT_APP_KEYCLOAK_URL_HTTP_RELATIVE_PATH ||
'/auth';

export const KEYCLOAK_AUTH_URL = `${KEYCLOAK_URL}${KEYCLOAK_URL_HTTP_RELATIVE_PATH}`;

export const CLIENT = "formsflow-client";
export const STAFF_DESIGNER = "formsflow-designer";
Expand Down

0 comments on commit a6b213f

Please sign in to comment.