From 112e16287369cfc4dcb713eeb08f61c906770098 Mon Sep 17 00:00:00 2001 From: pmacius Date: Fri, 9 Aug 2024 12:34:20 +0200 Subject: [PATCH] Add Alfresco Connector MSTeams Docker image --- connector/msteams/Dockerfile | 19 +++++++++++++++++ connector/msteams/README.md | 31 ++++++++++++++++++++++++++++ connector/msteams/artifacts.json | 14 +++++++++++++ connector/msteams/entrypoint.sh | 2 ++ docker-bake.hcl | 35 +++++++++++++++++++++++++++++++- 5 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 connector/msteams/Dockerfile create mode 100644 connector/msteams/README.md create mode 100644 connector/msteams/artifacts.json create mode 100755 connector/msteams/entrypoint.sh diff --git a/connector/msteams/Dockerfile b/connector/msteams/Dockerfile new file mode 100644 index 00000000..9f31894c --- /dev/null +++ b/connector/msteams/Dockerfile @@ -0,0 +1,19 @@ +FROM java_base + +EXPOSE 9095 + +ARG ALFRESCO_MSTEAMS_GROUP_NAME +ARG ALFRESCO_MSTEAMS_GROUP_ID +ARG ALFRESCO_MSTEAMS_USER_NAME +ARG ALFRESCO_MSTEAMS_USER_ID + +ADD alfresco-ms-teams-springboot*.jar /opt/app.jar + +RUN groupadd -g ${ALFRESCO_MSTEAMS_GROUP_ID} ${ALFRESCO_MSTEAMS_GROUP_NAME} && \ + useradd -u ${ALFRESCO_MSTEAMS_USER_ID} -g ${ALFRESCO_MSTEAMS_GROUP_NAME} ${ALFRESCO_MSTEAMS_USER_NAME} && \ + chgrp ${ALFRESCO_MSTEAMS_GROUP_NAME} /opt/app.jar + +USER ${ALFRESCO_MSTEAMS_USER_NAME} + +COPY entrypoint.sh /entrypoint.sh +CMD ["/entrypoint.sh"] diff --git a/connector/msteams/README.md b/connector/msteams/README.md new file mode 100644 index 00000000..486bbf2b --- /dev/null +++ b/connector/msteams/README.md @@ -0,0 +1,31 @@ +# Runtime variables + +Sets of variables configurable with your docker image + +## msteams + +```yaml + +alfresco-connector-msteams: + image: localhost/alfresco-ms-teams-service:YOUR-TAG + environment: + JAVA_OPTS: + ALFRESCO_BASE_URL: + ALFRESCO_DIGITAL_WORKSPACE_CONTEXT_PATH: + MICROSOFT_APP_OAUTH_CONNECTION_NAME: + MICROSOFT_APP_ID: + MICROSOFT_APP_PASSWORD: + TEAMS_CHAT_FILENAME_ENABLED: + TEAMS_CHAT_METADATA_ENABLED: + TEAMS_CHAT_IMAGE_ENABLED: +``` + +- `JAVA_OPTS` - Additional java options +- `ACS_BASE_URL` - The base URL of the Content Services installation in the format `:`. For example, {my.domain}/ +- `ALFRESCO_DIGITAL_WORKSPACE_CONTEXT_PATH` - The Alfresco Digital Workspace context path in the Content Services installation, usually /workspace +- `MICROSOFT_APP_OAUTH_CONNECTION_NAME` - OAuth Connection name +- `MICROSOFT_APP_ID` - The Azure Bot application identifier created when registering the Azure bot and looks something like `9af7ae3a-1798-4de7-a992-c3ac48****` +- `MICROSOFT_APP_PASSWORD` - The Azure Bot application password +- `TEAMS_CHAT_FILENAME_ENABLED` - Enables or disables the inclusion of filenames in Teams chat messages. Set to `true` to include filenames, or `false` to exclude them. +- `TEAMS_CHAT_METADATA_ENABLED` - Enables or disables the inclusion of metadata in Teams chat messages. Set to `true` to include metadata, or `false` to exclude it. +- `TEAMS_CHAT_IMAGE_ENABLED` - Enables or disables the inclusion of images in Teams chat messages. Set to `true` to include images, or `false` to exclude them. diff --git a/connector/msteams/artifacts.json b/connector/msteams/artifacts.json new file mode 100644 index 00000000..87ab13d7 --- /dev/null +++ b/connector/msteams/artifacts.json @@ -0,0 +1,14 @@ +{ + "artifacts": { + "acs23": [ + { + "name": "alfresco-ms-teams-springboot", + "version": "2.0.2", + "path": "connector/msteams", + "classifier": ".jar", + "repository": "enterprise-releases", + "group": "org.alfresco" + } + ] + } +} diff --git a/connector/msteams/entrypoint.sh b/connector/msteams/entrypoint.sh new file mode 100755 index 00000000..f3895170 --- /dev/null +++ b/connector/msteams/entrypoint.sh @@ -0,0 +1,2 @@ +#!/bin/bash +exec java $JAVA_OPTS -jar /opt/app.jar diff --git a/docker-bake.hcl b/docker-bake.hcl index dac61678..3065fa85 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -1,5 +1,5 @@ group "default" { - targets = ["content_service", "enterprise-search", "ats", "tengines"] + targets = ["content_service", "enterprise-search", "ats", "tengines", "connectors"] } group "content_service" { @@ -18,6 +18,10 @@ group "tengines" { targets = ["tengine_libreoffice", "tengine_imagemagick", "tengine_tika", "tengine_pdfrenderer", "tengine_misc", "tengine_aio"] } +group "connectors" { + targets = ["connector_msteams"] +} + variable "LABEL_VENDOR" { default = "Hyland Software, Inc." } @@ -455,3 +459,32 @@ target "tengine_aio" { tags = ["localhost/alfresco-transform-core-aio:latest"] output = ["type=docker"] } + +variable "ALFRESCO_MSTEAMS_USER_NAME" { + default = "ms-int-user" +} + +variable "ALFRESCO_MSTEAMS_USER_ID" { + default = "33041" +} + +target "connector_msteams" { + context = "./connector/msteams" + dockerfile = "Dockerfile" + inherits = ["java_base"] + contexts = { + java_base = "target:java_base" + } + args = { + ALFRESCO_MSTEAMS_GROUP_NAME = "${ALFRESCO_GROUP_NAME}" + ALFRESCO_MSTEAMS_GROUP_ID = "${ALFRESCO_GROUP_ID}" + ALFRESCO_MSTEAMS_USER_NAME = "${ALFRESCO_MSTEAMS_USER_NAME}" + ALFRESCO_MSTEAMS_USER_ID = "${ALFRESCO_MSTEAMS_USER_ID}" + } + labels = { + "org.opencontainers.image.title" = "${PRODUCT_LINE} Connector Microsoft Teams" + "org.opencontainers.image.description" = "Alfresco Connector Microsoft Teams" + } + tags = ["localhost/alfresco-ms-teams-service:latest"] + output = ["type=docker"] +}