From a9062994f4d3048a34cdf1ecc089794aa489c3e1 Mon Sep 17 00:00:00 2001 From: VyacheslavSemin Date: Mon, 7 Oct 2024 11:08:45 +0000 Subject: [PATCH 1/3] Fix errors when running containers Co-authored-by: VyacheslavSemin Co-committed-by: VyacheslavSemin --- .env | 5 +- .github/workflows/build.yaml | 27 +- Dockerfile | 27 +- Dockerfile.noplugins | 25 +- README.md | 2 + build.sh | 3 +- config/documentserver/default.json | 417 ----------------------------- docker-bake.hcl | 10 + 8 files changed, 72 insertions(+), 444 deletions(-) delete mode 100644 config/documentserver/default.json diff --git a/.env b/.env index e1ff1b1..474c936 100644 --- a/.env +++ b/.env @@ -14,7 +14,10 @@ PRODUCT_EDITION= # Unless otherwise specified, the latest up-to-date version will be used # Example: # RELEASE_VERSION=-7.2.2 -RELEASE_VERSION=-8.1.1 +RELEASE_VERSION=-8.2.0 + +# The hash that will be appended to the ONLYOFFICE Docs version in the request URLs +DS_VERSION_HASH=1 # Prefix in the name of your repository in Docker Hub PREFIX_NAME=docs diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3ee167c..8b7dc18 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -7,9 +7,23 @@ on: - "v*" jobs: + prepare-build: + name: "Prepare build" + runs-on: ubuntu-latest + outputs: + sourceTag: ${{ steps.prepare.outputs.sourceTag }} + dsHash: ${{ steps.prepare.outputs.dsHash }} + steps: + - name: prepare-build + id: prepare + run: | + echo "sourceTag=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT" + echo "dsHash=$(echo -n "$(date +'%Y.%m.%d-%H%M')" | md5sum | awk '{print $1}')" >> "$GITHUB_OUTPUT" + build: name: "${{ matrix.name }} ${{ matrix.edition }}" runs-on: ubuntu-latest + needs: [prepare-build] strategy: fail-fast: false matrix: @@ -44,18 +58,17 @@ jobs: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - - name: Get Tag Name - id: tag-name - run: | - echo "source-tag=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT" - - name: "Build Docs${{ matrix.edition }}" env: - SOURCE_TAG: ${{ steps.tag-name.outputs.source-tag }} + DS_VERSION_HASH: ${{ needs.prepare-build.outputs.dsHash }} + SOURCE_TAG: ${{ needs.prepare-build.outputs.sourceTag }} NOPLUG_POSTFIX: ${{ matrix.postfix }} DOCKERFILE: ${{ matrix.dockerfile }} run: | - DOCKER_TAG=$(echo ${SOURCE_TAG} | sed 's/^.//') + : ${DS_VERSION_HASH:?Should be set!} + + DS_VERSION_HASH=${DS_VERSION_HASH} \ + DOCKER_TAG=$(echo ${SOURCE_TAG} | sed 's/^.//') \ PRODUCT_EDITION=${{ matrix.edition }} \ TAG=$DOCKER_TAG \ docker buildx bake \ diff --git a/Dockerfile b/Dockerfile index 84861d9..30e9959 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,14 +7,18 @@ FROM amazonlinux:2 AS ds-base LABEL maintainer Ascensio System SIA ARG COMPANY_NAME=onlyoffice +ARG DS_VERSION_HASH ENV COMPANY_NAME=$COMPANY_NAME \ + DS_VERSION_HASH=$DS_VERSION_HASH \ NODE_ENV=production-linux \ NODE_CONFIG_DIR=/etc/$COMPANY_NAME/documentserver RUN yum install sudo -y && \ yum install shadow-utils -y && \ amazon-linux-extras install epel -y && \ - yum install procps-ng tar -y && \ + yum install procps-ng tar wget -y && \ + wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.5/dumb-init_1.2.5_x86_64 && \ + chmod +x /usr/local/bin/dumb-init && \ groupadd --system --gid 101 ds && \ useradd --system -g ds --no-create-home --shell /sbin/nologin --uid 101 ds && \ rm -f /var/log/*log @@ -24,14 +28,16 @@ RUN pip install redis==3.5.3 FROM ds-base AS ds-service ARG TARGETARCH +ARG DS_VERSION_HASH ARG PRODUCT_EDITION= ARG RELEASE_VERSION ARG PRODUCT_URL=https://download.onlyoffice.com/install/documentserver/linux/onlyoffice-documentserver$PRODUCT_EDITION$RELEASE_VERSION.$TARGETARCH.rpm -ENV TARGETARCH=$TARGETARCH +ENV TARGETARCH=$TARGETARCH \ + DS_VERSION_HASH=$DS_VERSION_HASH WORKDIR /ds RUN useradd --no-create-home --shell /sbin/nologin nginx && \ yum -y updateinfo && \ - yum -y install cabextract fontconfig xorg-x11-font-utils xorg-x11-server-utils wget rpm2cpio && \ + yum -y install cabextract fontconfig xorg-x11-font-utils xorg-x11-server-utils rpm2cpio && \ rpm -i https://downloads.sourceforge.net/project/mscorefonts2/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm && \ PRODUCT_URL=$(echo $PRODUCT_URL | sed "s/"$TARGETARCH"/"$(uname -m)"/g") && \ PACKAGE_NAME=$(basename "$PRODUCT_URL") && \ @@ -48,9 +54,6 @@ COPY --chown=ds:ds \ config/nginx/includes/http-common.conf \ config/nginx/includes/http-upstream.conf \ /etc/$COMPANY_NAME/documentserver/nginx/includes/ -COPY --chown=ds:ds \ - config/documentserver/default.json \ - /etc/$COMPANY_NAME/documentserver/default.json COPY --chown=ds:ds \ fonts/ \ /var/www/$COMPANY_NAME/documentserver/core-fonts/custom/ @@ -58,6 +61,7 @@ COPY --chown=ds:ds \ plugins/ \ /var/www/$COMPANY_NAME/documentserver/sdkjs-plugins/ RUN documentserver-generate-allfonts.sh true && \ + documentserver-flush-cache.sh -h $DS_VERSION_HASH -r false && \ documentserver-pluginsmanager.sh -r false \ --update=\"/var/www/$COMPANY_NAME/documentserver/sdkjs-plugins/plugin-list-default.json\" @@ -81,6 +85,7 @@ COPY --chown=ds:ds --chmod=644 --from=ds-service \ /etc/nginx/conf.d/ COPY --chown=ds:ds --chmod=644 --from=ds-service \ /etc/$COMPANY_NAME/documentserver*/nginx/includes/*.conf \ + /etc/nginx/includes/ds-cache.conf \ /etc/nginx/includes/ COPY --chown=ds:ds --from=ds-service \ /var/www/$COMPANY_NAME/documentserver/fonts \ @@ -174,7 +179,7 @@ COPY --from=redis-lib \ /usr/lib/python2.7/site-packages/redis-3.5.3.dist-info COPY docker-entrypoint.sh /usr/local/bin/ USER ds -ENTRYPOINT docker-entrypoint.sh /var/www/$COMPANY_NAME/documentserver/server/DocService/docservice +ENTRYPOINT dumb-init docker-entrypoint.sh /var/www/$COMPANY_NAME/documentserver/server/DocService/docservice HEALTHCHECK --interval=10s --timeout=3s CMD curl -sf http://localhost:8000/index.html FROM ds-base AS converter @@ -215,7 +220,7 @@ RUN mkdir -p \ /var/lib/$COMPANY_NAME/documentserver/App_Data/docbuilder && \ chown -R ds:ds /var/lib/$COMPANY_NAME/documentserver USER ds -ENTRYPOINT docker-entrypoint.sh /var/www/$COMPANY_NAME/documentserver/server/FileConverter/converter +ENTRYPOINT dumb-init docker-entrypoint.sh /var/www/$COMPANY_NAME/documentserver/server/FileConverter/converter FROM node:alpine3.19 AS example LABEL maintainer Ascensio System SIA @@ -264,6 +269,9 @@ ENTRYPOINT /var/www/onlyoffice/documentserver-example/docker-entrypoint.sh npm s FROM python:3.11 AS builder RUN pip install redis psycopg2 PyMySQL pika python-qpid-proton func_timeout requests kubernetes flask FROM python:3.11-slim AS utils +ARG DS_VERSION_HASH +ENV DS_VERSION_HASH=$DS_VERSION_HASH +COPY --from=ds-base /usr/local/bin/dumb-init /usr/local/bin/dumb-init COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages RUN apt update && apt install -y postgresql-client default-mysql-client curl wget jq && \ curl -LO \ @@ -274,7 +282,8 @@ RUN apt update && apt install -y postgresql-client default-mysql-client curl wg groupadd --system -g 1006 ds && \ useradd --system -g ds -d /home/ds -s /bin/bash -u 101 ds && \ mkdir /scripts && \ - chown -R ds:ds /scripts + chown -R ds:ds /scripts && \ + chmod +x /usr/local/bin/dumb-init USER ds FROM statsd/statsd AS metrics diff --git a/Dockerfile.noplugins b/Dockerfile.noplugins index ff2db31..ef49c28 100644 --- a/Dockerfile.noplugins +++ b/Dockerfile.noplugins @@ -3,14 +3,18 @@ FROM amazonlinux:2 AS ds-base LABEL maintainer Ascensio System SIA ARG COMPANY_NAME=onlyoffice +ARG DS_VERSION_HASH ENV COMPANY_NAME=$COMPANY_NAME \ + DS_VERSION_HASH=$DS_VERSION_HASH \ NODE_ENV=production-linux \ NODE_CONFIG_DIR=/etc/$COMPANY_NAME/documentserver RUN yum install sudo -y && \ yum install shadow-utils -y && \ amazon-linux-extras install epel -y && \ - yum install procps-ng tar -y && \ + yum install procps-ng tar wget -y && \ + wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.5/dumb-init_1.2.5_x86_64 && \ + chmod +x /usr/local/bin/dumb-init && \ groupadd --system --gid 101 ds && \ useradd --system -g ds --no-create-home --shell /sbin/nologin --uid 101 ds && \ rm -f /var/log/*log @@ -20,14 +24,16 @@ RUN pip install redis==3.5.3 FROM ds-base AS ds-service ARG TARGETARCH +ARG DS_VERSION_HASH ARG PRODUCT_EDITION= ARG RELEASE_VERSION ARG PRODUCT_URL=https://download.onlyoffice.com/install/documentserver/linux/onlyoffice-documentserver$PRODUCT_EDITION$RELEASE_VERSION.$TARGETARCH.rpm -ENV TARGETARCH=$TARGETARCH +ENV TARGETARCH=$TARGETARCH \ + DS_VERSION_HASH=$DS_VERSION_HASH WORKDIR /ds RUN useradd --no-create-home --shell /sbin/nologin nginx && \ yum -y updateinfo && \ - yum -y install cabextract fontconfig xorg-x11-font-utils xorg-x11-server-utils wget rpm2cpio && \ + yum -y install cabextract fontconfig xorg-x11-font-utils xorg-x11-server-utils rpm2cpio && \ rpm -i https://downloads.sourceforge.net/project/mscorefonts2/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm && \ PRODUCT_URL=$(echo $PRODUCT_URL | sed "s/"$TARGETARCH"/"$(uname -m)"/g") && \ PACKAGE_NAME=$(basename "$PRODUCT_URL") && \ @@ -44,16 +50,14 @@ COPY --chown=ds:ds \ config/nginx/includes/http-common.conf \ config/nginx/includes/http-upstream.conf \ /etc/$COMPANY_NAME/documentserver/nginx/includes/ -COPY --chown=ds:ds \ - config/documentserver/default.json \ - /etc/$COMPANY_NAME/documentserver/default.json COPY --chown=ds:ds \ fonts/ \ /var/www/$COMPANY_NAME/documentserver/core-fonts/custom/ COPY --chown=ds:ds \ plugins/ \ /var/www/$COMPANY_NAME/documentserver/sdkjs-plugins/ -RUN documentserver-generate-allfonts.sh true +RUN documentserver-generate-allfonts.sh true && \ + documentserver-flush-cache.sh -h $DS_VERSION_HASH -r false FROM ds-base AS proxy ENV DOCSERVICE_HOST_PORT=localhost:8000 \ @@ -75,6 +79,7 @@ COPY --chown=ds:ds --chmod=644 --from=ds-service \ /etc/nginx/conf.d/ COPY --chown=ds:ds --chmod=644 --from=ds-service \ /etc/$COMPANY_NAME/documentserver*/nginx/includes/*.conf \ + /etc/nginx/includes/ds-cache.conf \ /etc/nginx/includes/ COPY --chown=ds:ds --from=ds-service \ /var/www/$COMPANY_NAME/documentserver/fonts \ @@ -163,7 +168,7 @@ COPY --from=redis-lib \ COPY docker-entrypoint.sh /usr/local/bin/ RUN mkdir -p /var/www/$COMPANY_NAME/documentserver/sdkjs-plugins USER ds -ENTRYPOINT docker-entrypoint.sh /var/www/$COMPANY_NAME/documentserver/server/DocService/docservice +ENTRYPOINT dumb-init docker-entrypoint.sh /var/www/$COMPANY_NAME/documentserver/server/DocService/docservice HEALTHCHECK --interval=10s --timeout=3s CMD curl -sf http://localhost:8000/index.html FROM ds-base AS converter @@ -204,7 +209,7 @@ RUN mkdir -p \ /var/lib/$COMPANY_NAME/documentserver/App_Data/docbuilder && \ chown -R ds:ds /var/lib/$COMPANY_NAME/documentserver USER ds -ENTRYPOINT docker-entrypoint.sh /var/www/$COMPANY_NAME/documentserver/server/FileConverter/converter +ENTRYPOINT dumb-init docker-entrypoint.sh /var/www/$COMPANY_NAME/documentserver/server/FileConverter/converter FROM node:alpine3.19 AS example LABEL maintainer Ascensio System SIA @@ -253,6 +258,8 @@ ENTRYPOINT /var/www/onlyoffice/documentserver-example/docker-entrypoint.sh npm s FROM python:3.11 AS builder RUN pip install redis psycopg2 PyMySQL pika python-qpid-proton func_timeout requests kubernetes flask FROM python:3.11-slim AS utils +ARG DS_VERSION_HASH +ENV DS_VERSION_HASH=$DS_VERSION_HASH COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages RUN apt update && apt install -y postgresql-client default-mysql-client curl wget jq && \ curl -LO \ diff --git a/README.md b/README.md index bcee9d3..d677407 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,8 @@ Possible values: If you want to use a ONLYOFFICE Docs version other than the latest one, specify the version you need in the `RELEASE_VERSION` variable. If no value is defined, the latest up-to-date version will be used. +If you are not using the script `build.sh` to build images, then change the value in the `DS_VERSION_HASH` variable at each build. This variable defines the hash that will be appended to the ONLYOFFICE Docs version in the request URLs. + If you want to build images with no plugins at all, then change the value of the `DOCKERFILE` variable to `Dockerfile.noplugins` in the `.env` file. #### 2. Run the build diff --git a/build.sh b/build.sh index 8ca3dc1..08d6c1d 100755 --- a/build.sh +++ b/build.sh @@ -5,4 +5,5 @@ export DOCKER_BUILDKIT=1 docker-compose build \ --build-arg DOCKERFILE=$DOCKERFILE \ --build-arg PRODUCT_EDITION=$PRODUCT_EDITION \ - --build-arg RELEASE_VERSION=$RELEASE_VERSION + --build-arg RELEASE_VERSION=$RELEASE_VERSION \ + --build-arg DS_VERSION_HASH=$(echo -n "$(date +'%Y.%m.%d-%H%M')" | md5sum | awk '{print $1}') diff --git a/config/documentserver/default.json b/config/documentserver/default.json deleted file mode 100644 index 2a8f7ea..0000000 --- a/config/documentserver/default.json +++ /dev/null @@ -1,417 +0,0 @@ -{ - "statsd": { - "useMetrics": false, - "host": "localhost", - "port": "8125", - "prefix": "ds." - }, - "log": { - "filePath": "", - "options": { - "replaceConsole": true - } - }, - "queue": { - "type": "rabbitmq", - "visibilityTimeout": 300, - "retentionPeriod": 900 - }, - "storage": { - "name": "storage-fs", - "fs": { - "folderPath": "", - "urlExpires": 900, - "secretString": "verysecretstring" - }, - "region": "", - "endpoint": "http://localhost/s3", - "bucketName": "cache", - "storageFolderName": "files", - "cacheFolderName": "data", - "urlExpires": 604800, - "accessKeyId": "AKID", - "secretAccessKey": "SECRET", - "sslEnabled": false, - "s3ForcePathStyle": true, - "externalHost": "" - }, - "persistentStorage": { - }, - "rabbitmq": { - "url": "amqp://guest:guest@localhost:5672", - "socketOptions": {}, - "exchangepubsub": "ds.pubsub", - "queueconverttask": "ds.converttask", - "queueconvertresponse": "ds.convertresponse", - "exchangeconvertdead": "ds.exchangeconvertdead", - "queueconvertdead": "ds.convertdead", - "queuedelayed": "ds.delayed" - }, - "activemq": { - "connectOptions": { - "port": 5672, - "host": "localhost", - "reconnect": false - }, - "queueconverttask": "ds.converttask", - "queueconvertresponse": "ds.convertresponse", - "queueconvertdead": "ActiveMQ.DLQ", - "queuedelayed": "ds.delayed", - "topicpubsub": "ds.pubsub" - }, - "dnscache": { - "enable" : true, - "ttl" : 300, - "cachesize" : 1000 - }, - "openpgpjs": { - "config": { - }, - "encrypt": { - "passwords": ["verysecretstring"] - }, - "decrypt": { - "passwords": ["verysecretstring"] - } - }, - "bottleneck": { - "getChanges": { - } - }, - "wopi": { - "enable": false, - "host" : "", - "htmlTemplate" : "../../web-apps/apps/api/wopi", - "wopiZone" : "external-http", - "favIconUrlWord" : "/web-apps/apps/documenteditor/main/resources/img/favicon.ico", - "favIconUrlCell" : "/web-apps/apps/spreadsheeteditor/main/resources/img/favicon.ico", - "favIconUrlSlide" : "/web-apps/apps/presentationeditor/main/resources/img/favicon.ico", - "favIconUrlPdf" : "/web-apps/apps/pdfeditor/main/resources/img/favicon.ico", - "fileInfoBlockList" : ["FileUrl"], - "pdfView": ["djvu", "xps", "oxps"], - "pdfEdit": ["pdf"], - "forms": ["pdf"], - "wordView": ["doc", "dotx", "dotm", "dot", "fodt", "ott", "rtf", "mht", "mhtml", "html", "htm", "xml", "epub", "fb2", "sxw", "stw", "wps", "wpt", "docxf", "oform"], - "wordEdit": ["docx", "docm", "odt", "txt"], - "cellView": ["xls", "xlsb", "xltx", "xltm", "xlt", "fods", "ots", "sxc", "xml", "et", "ett"], - "cellEdit": ["xlsx", "xlsm", "ods", "csv"], - "slideView": ["ppt", "ppsx", "ppsm", "pps", "potx", "potm", "pot", "fodp", "otp", "sxi", "dps", "dpt"], - "slideEdit": ["pptx", "pptm", "odp"], - "publicKey": "BgIAAACkAABSU0ExAAgAAAEAAQBpTpiJQ2hD8plpGTfEEmcq4IKyr31HikXpuVSBraMfqyodn2PGXBJ3daNSmdPOc0Nz4HO9Auljn8YYXDPBdpiABptSKvEDPF23Q+Qytg0+vCRyondyBcW91w7KLzXce3fnk8ZfJ8QtbZPL9m11wJIWZueQF+l0HKYx4lty+nccbCanytFTADkGQ3SnmExGEF3rBz6I9+OcrDDK9NKPJgEmCiuyei/d4XbPgKls3EIG0h38X5mVF2VytfWm2Yu850B6z3N4MYhj4b4vsYT62zEC4pMRUeb8dIBy4Jsmr3avtmeO00MUH6DVyPC8nirixj2YIOPKk13CdVqGDSXA3cvl", - "modulus": "5cvdwCUNhlp1wl2TyuMgmD3G4iqevPDI1aAfFEPTjme2r3avJpvgcoB0/OZREZPiAjHb+oSxL77hY4gxeHPPekDnvIvZpvW1cmUXlZlf/B3SBkLcbKmAz3bh3S96sisKJgEmj9L0yjCsnOP3iD4H610QRkyYp3RDBjkAU9HKpyZsHHf6clviMaYcdOkXkOdmFpLAdW32y5NtLcQnX8aT53d73DUvyg7XvcUFcneiciS8Pg22MuRDt108A/EqUpsGgJh2wTNcGMafY+kCvXPgc0NzztOZUqN1dxJcxmOfHSqrH6OtgVS56UWKR32vsoLgKmcSxDcZaZnyQ2hDiZhOaQ==", - "exponent": 65537, - "privateKey": "-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDly93AJQ2GWnXC\nXZPK4yCYPcbiKp688MjVoB8UQ9OOZ7avdq8mm+BygHT85lERk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hqExbm0H1iZ1zZ97l0P8fvIhHE42gmaLToOIGDhPSXGvv\nzlqOHbGbq4jsERc1jp1bej5q6wKBgQDwaueIc4pRchH98QYidcyr8Vwg9KhbnfYX\ny3W4RPlZtBdF34iJaio+ASzugo/zy1RTcVrsCskYWXyKDUQz1yu0iCng+fDCUnTm\nXGmEoEGNhk4vTJOt7hBav1/Ja/dUipGf6mXUuanwJ0e+1/Et/B0ah5X1Um5AyNZI\nM+SyRz3u+wKBgQCjvtUNXoqaghCBCmB6TjZ1prexnWkYFugCv2SSUMIk1W7gIlJ6\ntsjcrj1R1Qii6qzfBFd+GWoA0V06h0e2/qRVCg//p6GytrW33IycgvS+ZPLJ7tLI\nFR2r66WfRlpoPiSL8eRt/P7kkG0hXCn7K7ub2TEu/Ka/W1yNwad6PR8iCwKBgQC8\nXcZSrtQsxAc8w99emJVoEo9wcsCGJ9ltA0iUu9XyZpvlbyJ3J+s48YrWxQ0sop7L\nUgE+96Rfo51kPMi3JVtk81p8ntf4KMrWwokaFMXHsPcJMCJ1IBVIRLE0C5eZcYhv\nlyN57I4tT1lzOZYJxYK4Cot/zrn7oF/j6mTBGfh4iQKBgQCiJMUxRz01/czH/XSX\ngo3dVbHQ4FEOufWnE3Eb93S8r0/eq1RM118rb0TqzuiadW2xYDU4nucWQlrlmq0d\nFY/m+Hy97pqyk6jmoU5I/D+ssBIoYHWLnH9/xfvDEk2JGSJSHtzu0D4EDC/rgQ49\nMbYsO5oUrF8tPlhj5vzbf3GKLA==\n-----END PRIVATE KEY-----\n", - "refreshLockInterval": "10m", - "dummy" : { - "enable": false, - "sampleFilePath": "" - } - }, - "tenants": { - "baseDir": "", - "baseDomain": "", - "filenameConfig": "config.json", - "filenameSecret": "secret.key", - "filenameLicense": "license.lic", - "defaultTenant": "localhost", - "cache" : { - "stdTTL": 300, - "checkperiod": 60, - "useClones": false - } - }, - "externalRequest": { - "directIfIn" : { - "allowList": [], - "jwtToken": true - }, - "action": { - "allow": true, - "blockPrivateIP": true, - "proxyUrl": "", - "proxyUser": { - "username": "", - "password": "" - }, - "proxyHeaders": { - } - } - }, - "services": { - "CoAuthoring": { - "server": { - "port": 8000, - "workerpercpu": 1, - "mode": "development", - "limits_tempfile_upload": 104857600, - "limits_image_size": 26214400, - "limits_image_download_timeout": { - "connectionAndInactivity": "2m", - "wholeCycle": "2m" - }, - "callbackRequestTimeout": { - "connectionAndInactivity": "10m", - "wholeCycle": "10m" - }, - "healthcheckfilepath": "../public/healthcheck.docx", - "savetimeoutdelay": 5000, - "edit_singleton": false, - "forgottenfiles": "forgotten", - "forgottenfilesname": "output", - "maxRequestChanges": 20000, - "openProtectedFile": true, - "isAnonymousSupport": true, - "editorDataStorage": "editorDataRedis", - "editorStatStorage": "", - "assemblyFormatAsOrigin": true, - "newFileTemplate" : "../../document-templates/new", - "downloadFileAllowExt": ["pdf", "xlsx"], - "tokenRequiredParams": true - }, - "requestDefaults": { - "headers": { - "User-Agent": "Node.js/6.13", - "Connection": "Keep-Alive" - }, - "gzip": true, - "rejectUnauthorized": true - }, - "autoAssembly": { - "enable": false, - "interval": "5m", - "step": "1m" - }, - "utils": { - "utils_common_fontdir": "null", - "utils_fonts_search_patterns": "*.ttf;*.ttc;*.otf", - "limits_image_types_upload": "jpg;jpeg;jpe;png;gif;bmp;svg;tiff;tif" - }, - "sql": { - "type": "postgres", - "tableChanges": "doc_changes", - "tableResult": "task_result", - "dbHost": "localhost", - "dbPort": 5432, - "dbName": "onlyoffice", - "dbUser": "onlyoffice", - "dbPass": "onlyoffice", - "charset": "utf8", - "connectionlimit": 10, - "max_allowed_packet": 1048575, - "pgPoolExtraOptions": { - "idleTimeoutMillis": 30000, - "maxLifetimeSeconds ": 60000, - "statement_timeout ": 60000, - "query_timeout ": 60000, - "connectionTimeoutMillis": 60000 - }, - "damengExtraOptions": { - "columnNameUpperCase": false, - "columnNameCase": "lower", - "connectTimeout": 60000, - "loginEncrypt": false, - "localTimezone": 0, - "poolTimeout": 60, - "socketTimeout": 60000, - "queueTimeout": 60000 - }, - "oracleExtraOptions": { - "connectTimeout": 60 - }, - "msSqlExtraOptions": { - "options": { - "encrypt": false, - "trustServerCertificate": true - }, - "pool": { - "idleTimeoutMillis": 30000 - } - }, - "mysqlExtraOptions": {} - }, - "redis": { - "name": "redis", - "prefix": "ds:", - "host": "127.0.0.1", - "port": 6379, - "options": {}, - "optionsCluster": {}, - "iooptions": { - "lazyConnect": true - }, - "iooptionsClusterNodes": [ - ], - "iooptionsClusterOptions": { - "lazyConnect": true - } - }, - "pubsub": { - "maxChanges": 1000 - }, - "expire": { - "saveLock": 60, - "presence": 300, - "locks": 604800, - "changeindex": 86400, - "lockDoc": 30, - "message": 86400, - "lastsave": 604800, - "forcesave": 604800, - "forcesaveLock": 5000, - "saved": 3600, - "documentsCron": "0 */2 * * * *", - "files": 86400, - "filesCron": "00 00 */1 * * *", - "filesremovedatonce": 100, - "sessionidle": "1h", - "sessionabsolute": "30d", - "sessionclosecommand": "2m", - "pemStdTTL": "1h", - "pemCheckPeriod": "10m", - "updateVersionStatus": "5m", - "monthUniqueUsers": "1y" - }, - "ipfilter": { - "rules": [{"address": "*", "allowed": true}], - "useforrequest": false, - "errorcode": 403 - }, - "request-filtering-agent" : { - "allowPrivateIPAddress": false, - "allowMetaIPAddress": false - }, - "secret": { - "browser": {"string": "secret", "file": ""}, - "inbox": {"string": "secret", "file": ""}, - "outbox": {"string": "secret", "file": ""}, - "session": {"string": "secret", "file": ""} - }, - "token": { - "enable": { - "browser": false, - "request": { - "inbox": false, - "outbox": false - } - }, - "browser": { - "secretFromInbox": true - }, - "inbox": { - "header": "Authorization", - "prefix": "Bearer ", - "inBody": false - }, - "outbox": { - "header": "Authorization", - "prefix": "Bearer ", - "algorithm": "HS256", - "expires": "5m", - "inBody": false, - "urlExclusionRegex": "" - }, - "session": { - "algorithm": "HS256", - "expires": "30d" - }, - "verifyOptions": { - "clockTolerance": 60 - } - }, - "plugins": { - "uri": "/sdkjs-plugins", - "autostart": [] - }, - "themes": { - "uri": "/web-apps/apps/common/main/resources/themes" - }, - "editor":{ - "spellcheckerUrl": "", - "reconnection":{ - "attempts": 50, - "delay": "2s" - }, - "binaryChanges": false, - "websocketMaxPayloadSize": "1.5MB", - "maxChangesSize": "0mb" - }, - "sockjs": { - "sockjs_url": "", - "disable_cors": true, - "websocket": true - }, - "socketio": { - "connection": { - "path": "/doc/", - "serveClient": false, - "pingTimeout": 20000, - "pingInterval": 25000, - "maxHttpBufferSize": 1e8 - } - }, - "callbackBackoffOptions": { - "retries": 0, - "timeout":{ - "factor": 2, - "minTimeout": 1000, - "maxTimeout": 2147483647, - "randomize": false - }, - "httpStatus": "429,500-599" - } - } - }, - "license" : { - "license_file": "", - "warning_limit_percents": 70, - "packageType": 2 - }, - "FileConverter": { - "converter": { - "maxDownloadBytes": 104857600, - "downloadTimeout": { - "connectionAndInactivity": "2m", - "wholeCycle": "2m" - }, - "downloadAttemptMaxCount": 3, - "downloadAttemptDelay": 1000, - "maxprocesscount": 1, - "fontDir": "null", - "presentationThemesDir": "null", - "x2tPath": "null", - "docbuilderPath": "null", - "args": "", - "spawnOptions": {}, - "errorfiles": "", - "streamWriterBufferSize": 8388608, - "maxRedeliveredCount": 2, - "inputLimits": [ - { - "type": "docx;dotx;docm;dotm", - "zip": { - "uncompressed": "50MB", - "template": "*.xml" - } - }, - { - "type": "xlsx;xltx;xlsm;xltm", - "zip": { - "uncompressed": "300MB", - "template": "*.xml" - } - }, - { - "type": "pptx;ppsx;potx;pptm;ppsm;potm", - "zip": { - "uncompressed": "50MB", - "template": "*.xml" - } - } - ] - } - } -} diff --git a/docker-bake.hcl b/docker-bake.hcl index ec06742..9e2a05c 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -23,6 +23,10 @@ variable "NOPLUG_POSTFIX" { default = "" } +variable "DS_VERSION_HASH" { + default = "" +} + group "apps" { targets = ["proxy", "converter", "docservice", "example"] } @@ -44,6 +48,7 @@ target "proxy" { platforms = ["linux/amd64", "linux/arm64"] args = { "PRODUCT_EDITION": "${PRODUCT_EDITION}" + "DS_VERSION_HASH": "${DS_VERSION_HASH}" } } @@ -54,6 +59,7 @@ target "converter" { platforms = ["linux/amd64", "linux/arm64"] args = { "PRODUCT_EDITION": "${PRODUCT_EDITION}" + "DS_VERSION_HASH": "${DS_VERSION_HASH}" } } @@ -64,6 +70,7 @@ target "docservice" { platforms = ["linux/amd64", "linux/arm64"] args = { "PRODUCT_EDITION": "${PRODUCT_EDITION}" + "DS_VERSION_HASH": "${DS_VERSION_HASH}" } } @@ -72,5 +79,8 @@ target "utils" { dockerfile = "${DOCKERFILE}" tags = ["docker.io/${COMPANY_NAME}/${PREFIX_NAME}-utils:${TAG}"] platforms = ["linux/amd64", "linux/arm64"] + args = { + "DS_VERSION_HASH": "${DS_VERSION_HASH}" + } } From 0a8e3aa426ca81027230cfa5087bb48bd0666f59 Mon Sep 17 00:00:00 2001 From: VyacheslavSemin Date: Tue, 15 Oct 2024 14:56:18 +0300 Subject: [PATCH 2/3] Add the ability to change branding --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 30e9959..81544a4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,7 @@ LABEL maintainer Ascensio System SIA ARG COMPANY_NAME=onlyoffice ARG DS_VERSION_HASH ENV COMPANY_NAME=$COMPANY_NAME \ + APPLICATION_NAME=$COMPANY_NAME \ DS_VERSION_HASH=$DS_VERSION_HASH \ NODE_ENV=production-linux \ NODE_CONFIG_DIR=/etc/$COMPANY_NAME/documentserver From a859ae15bdd31c450eed21dde0317963e30c36d4 Mon Sep 17 00:00:00 2001 From: Valeria Bagisheva Date: Wed, 16 Oct 2024 06:48:38 +0000 Subject: [PATCH 3/3] Replace default psql version with 17 Co-authored-by: Valeria Bagisheva Co-committed-by: Valeria Bagisheva --- Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 81544a4..8161561 100644 --- a/Dockerfile +++ b/Dockerfile @@ -274,7 +274,12 @@ ARG DS_VERSION_HASH ENV DS_VERSION_HASH=$DS_VERSION_HASH COPY --from=ds-base /usr/local/bin/dumb-init /usr/local/bin/dumb-init COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages -RUN apt update && apt install -y postgresql-client default-mysql-client curl wget jq && \ +RUN apt update && \ + apt-get install -y wget gnupg2 lsb-release && \ + echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \ + wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \ + apt-get update && \ + apt install -y postgresql-client-17 default-mysql-client curl wget jq && \ curl -LO \ https://storage.googleapis.com/kubernetes-release/release/`curl \ -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl && \