├── .github ├── ISSUE_TEMPLATE.md └── workflows │ ├── 4testing-build.yml │ ├── cron-rebuild-trigger.yml │ ├── rebuild.yml │ ├── stable-build.yml │ └── zap-ds.yaml ├── .travis.yml ├── Dockerfile ├── LICENSE.txt ├── Makefile ├── README.md ├── config └── supervisor │ ├── ds │ ├── ds-converter.conf │ ├── ds-docservice.conf │ ├── ds-example.conf │ ├── ds-metrics.conf │ └── ds.conf │ └── supervisor ├── docker-bake.hcl ├── docker-compose.yml ├── oracle └── sqlplus ├── production.dockerfile ├── run-document-server.sh └── tests ├── README.md ├── activemq.yml ├── certs-customized.yml ├── certs.yml ├── damengdb ├── .env ├── README.md ├── damengdb.Dockerfile └── docker-compose.yml ├── graphite.yml ├── graphite └── statsd │ └── config.js ├── mariadb.yml ├── mssql ├── README.md ├── create_db_user.sh ├── docker-compose.yml └── mssql.Dockerfile ├── mysql.yml ├── oracle ├── README.md ├── create_db_user.sh ├── docker-compose.yml └── oracle.Dockerfile ├── postgres-old.yml ├── postgres.yml ├── prometheus.yml ├── prometheus ├── grafana │ ├── conf │ │ ├── default-provider.yaml │ │ └── prometheus.yml │ └── dashboards │ │ └── documentserver-statsd-exporter.json └── prometheus-scrape │ └── statsd-exporter.yml ├── rabbitmq-old.yml ├── rabbitmq.yml ├── redis.yml ├── standalone.yml └── test.sh /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | **Do you want to request a *feature* or report a *bug*?** 2 | 3 | **What is the current behavior?** 4 | 5 | **If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.** 6 | 7 | **What is the expected behavior?** 8 | 9 | **Did this work in previous versions of DocumentServer?** 10 | 11 | **DocumentServer Docker tag:** 12 | 13 | **Host Operating System:** 14 | -------------------------------------------------------------------------------- /.github/workflows/4testing-build.yml: -------------------------------------------------------------------------------- 1 | ### This workflow setup instance then build and push images ### 2 | name: 4testing multiarch-build 3 | run-name: >- 4 | Build #${{ inputs.build }} [ 5 | ${{ inputs.amd64 && 'AMD64' || '-' }} 6 | ${{ inputs.arm64 && 'ARM64' || '-' }} 7 | ] [ 8 | ${{ inputs.community && 'CE' || '-' }} 9 | ${{ inputs.developer && 'DE' || '-' }} 10 | ${{ inputs.enterprise && 'EE' || '-' }} 11 | ] 12 | 13 | on: 14 | workflow_dispatch: 15 | inputs: 16 | build: 17 | description: 'Build number (ex. 45)' 18 | type: string 19 | required: true 20 | amd64: 21 | type: boolean 22 | description: 'Build AMD64' 23 | default: true 24 | arm64: 25 | type: boolean 26 | description: 'Build ARM64' 27 | default: true 28 | community: 29 | type: boolean 30 | description: 'Build Community Edition' 31 | default: true 32 | enterprise: 33 | type: boolean 34 | description: 'Build Enterprise Edition' 35 | default: true 36 | developer: 37 | type: boolean 38 | description: 'Build Developer Edition' 39 | default: true 40 | 41 | env: 42 | COMPANY_NAME: "onlyoffice" 43 | PRODUCT_NAME: "documentserver" 44 | 45 | jobs: 46 | prepare: 47 | runs-on: ubuntu-latest 48 | steps: 49 | - id: matrix 50 | env: 51 | BRANCH_NAME: ${{ github.ref_name }} 52 | AMD64: ${{ github.event.inputs.amd64 }} 53 | ARM64: ${{ github.event.inputs.arm64 }} 54 | COMMUNITY: ${{ github.event.inputs.community }} 55 | ENTERPRISE: ${{ github.event.inputs.enterprise }} 56 | DEVELOPER: ${{ github.event.inputs.developer }} 57 | run: | 58 | set -ex 59 | 60 | if ! [[ "$BRANCH_NAME" == develop || "$BRANCH_NAME" =~ hotfix || "$BRANCH_NAME" =~ release ]]; then 61 | echo "Wrong branch." 62 | exit 1 63 | fi 64 | 65 | [ "${AMD64}" = true ] && PLATFORMS+=("amd64") 66 | [ "${ARM64}" = true ] && PLATFORMS+=("arm64") 67 | if [ -z ${PLATFORMS} ]; then 68 | echo "None of the platforms are selected." 69 | exit 1 70 | fi 71 | 72 | [ "${COMMUNITY}" = true ] && EDITIONS+=("community") 73 | [ "${ENTERPRISE}" = true ] && EDITIONS+=("enterprise") 74 | [ "${DEVELOPER}" = true ] && EDITIONS+=("developer") 75 | if [ -z ${EDITIONS} ]; then 76 | echo "None of the editions are selected." 77 | exit 1 78 | fi 79 | echo "editions=$(jq -n -c --arg s "${EDITIONS[*]}" '($s|split(" "))')" >> $GITHUB_OUTPUT 80 | outputs: 81 | editions: ${{ steps.matrix.outputs.editions }} 82 | 83 | build: 84 | name: "Build ${{ matrix.image }}-${{ matrix.edition }}" 85 | runs-on: ubuntu-latest 86 | needs: prepare 87 | strategy: 88 | fail-fast: false 89 | matrix: 90 | image: ["documentserver"] 91 | edition: ${{ fromJSON(needs.prepare.outputs.editions) }} 92 | steps: 93 | - name: Checkout code 94 | uses: actions/checkout@v3 95 | 96 | - name: Set up QEMU 97 | uses: docker/setup-qemu-action@v2 98 | 99 | - name: Set up Docker Buildx 100 | id: buildx 101 | uses: docker/setup-buildx-action@v2 102 | 103 | - name: Login to Docker Hub 104 | uses: docker/login-action@v2 105 | with: 106 | username: ${{ secrets.DOCKER_HUB_USERNAME }} 107 | password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} 108 | 109 | - name: Build 4testing 110 | id: build-ds 111 | env: 112 | BRANCH_NAME: ${{ github.ref_name }} 113 | AMD64: ${{ github.event.inputs.amd64 }} 114 | ARM64: ${{ github.event.inputs.arm64 }} 115 | BUILD_NUMBER: ${{ github.event.inputs.build }} 116 | EDITION: ${{ matrix.edition }} 117 | IMAGE: ${{ matrix.image }} 118 | PACKAGE_BASEURL: ${{ secrets.REPO_BASEURL }} 119 | run: | 120 | set -eux 121 | 122 | ### ==>> At this step build variable declaration ### 123 | 124 | case "${EDITION}" in 125 | community) 126 | PRODUCT_EDITION="" 127 | ;; 128 | enterprise) 129 | PRODUCT_EDITION="-ee" 130 | ;; 131 | developer) 132 | PRODUCT_EDITION="-de" 133 | ;; 134 | esac 135 | 136 | [ "${AMD64}" = true ] && PLATFORMS+=("amd64") 137 | [ "${ARM64}" = true ] && PLATFORMS+=("arm64") 138 | PLATFORM=$(echo ${PLATFORMS[*]/#/linux/} | tr ' ' ',') 139 | 140 | if [ "$BRANCH_NAME" = develop ]; then 141 | BUILD_CHANNEL=nightly 142 | PRODUCT_VERSION=99.99.99 143 | elif [[ "$BRANCH_NAME" =~ hotfix || "$BRANCH_NAME" =~ release ]]; then 144 | BUILD_CHANNEL=test 145 | PRODUCT_VERSION=${BRANCH_NAME#*/v} 146 | fi 147 | 148 | export PRODUCT_EDITION 149 | export PACKAGE_VERSION=${PRODUCT_VERSION}-${BUILD_NUMBER} 150 | export BUILD_CHANNEL 151 | export PLATFORM 152 | export DOCKERFILE=Dockerfile 153 | export PREFIX_NAME=4testing- 154 | export TAG=${PRODUCT_VERSION}.${BUILD_NUMBER} 155 | 156 | ### ==>> Build and push images at this step ### 157 | 158 | docker buildx bake -f docker-bake.hcl "${IMAGE}" --push 159 | echo "DONE: Build success" 160 | 161 | ### Set output for Zap scanner 162 | ### NOTE: Output will be used only in release/hotfix branches 163 | 164 | echo "version=${TAG}" >> "$GITHUB_OUTPUT" 165 | echo "branch=${BRANCH_NAME}" >> "$GITHUB_OUTPUT" 166 | shell: bash 167 | 168 | # Run scanner only when edition is community 169 | # and branch hit release/ or hotfix/ 170 | - name: Trigger zap manualy 171 | if: >- 172 | matrix.edition == 'community' && 173 | (startsWith(steps.build-ds.outputs.branch, 'release/') || 174 | startsWith(steps.build-ds.outputs.branch, 'hotfix/')) 175 | env: 176 | VERSION: ${{ steps.build-ds.outputs.version }} 177 | BRANCH: ${{ steps.build-ds.outputs.branch }} 178 | GITHUB_TOKEN: ${{ secrets.TOKEN }} 179 | REPO: ${{ github.repository }} 180 | run: | 181 | gh workflow run zap-ds.yaml \ 182 | --repo "${REPO}" \ 183 | -f branch="${BRANCH}" \ 184 | -f version="${VERSION}" 185 | shell: bash 186 | 187 | -------------------------------------------------------------------------------- /.github/workflows/cron-rebuild-trigger.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Trigger 4testing rebuild 3 | 4 | run-name: "Weekly 4testing rebuild trigger" 5 | 6 | on: 7 | schedule: 8 | # Run every Saturday at 10 p.m. 9 | - cron: '00 22 * * 6' 10 | 11 | jobs: 12 | trigger-rebuild: 13 | name: "trigget-rebuild" 14 | runs-on: "ubuntu-latest" 15 | steps: 16 | - name: Rebuild 4testing manualy 17 | env: 18 | GITHUB_TOKEN: ${{ secrets.TOKEN }} 19 | run: | 20 | gh workflow run rebuild.yml \ 21 | --repo ONLYOFFICE/Docker-DocumentServer \ 22 | -f repo=4test 23 | -------------------------------------------------------------------------------- /.github/workflows/rebuild.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Rebuild Docker-Documentserver 3 | 4 | run-name: > 5 | Rebuild DocumentServer with secure updates for repo: ${{ github.event.inputs.repo }} 6 | 7 | on: 8 | workflow_dispatch: 9 | inputs: 10 | repo: 11 | type: choice 12 | description: Please, choose upload repo.. 13 | options: 14 | - '4test' 15 | - 'stable' 16 | 17 | permissions: 18 | # All other permissions are set to none 19 | contents: read 20 | # Technically read access while waiting for images should be more than enough. However, 21 | # there is a bug in GitHub Actions/Packages and in case private repositories are used, you get a permission 22 | # denied error when attempting to just pull private image, changing the token permission to write solves the 23 | # issue. This is not dangerous, because if it is for "ONLYOFFICE/Docker-DocumentServer", only maintainers can use ds-rebuild.yaml 24 | # If it is for a fork, then the token is read-only anyway. 25 | packages: read 26 | 27 | env: 28 | COMPANY_NAME: "onlyoffice" 29 | PRODUCT_NAME: "documentserver" 30 | REGISTRY_URL: "https://hub.docker.com/v2/repositories" 31 | 32 | jobs: 33 | rebuild-info: 34 | name: "Rebuild-info" 35 | runs-on: "ubuntu-22.04" 36 | env: 37 | REPO_INPUTS: ${{ github.event.inputs.repo }} 38 | EVENT: ${{ github.event_name }} 39 | outputs: 40 | stable-versions: ${{ steps.selective-checks.outputs.stable-versions }} 41 | ucs-versions: ${{ steps.selective-checks.outputs.ucs-versions }} 42 | minor-tags: ${{ steps.selective-checks.outputs.minor-tags }} 43 | ucs-rebuild-condition: ${{ steps.selective-checks.outputs.ucs-rebuild-condition }} 44 | prefix-name: ${{ steps.selective-checks.outputs.prefix-name }} 45 | repo: ${{ steps.selective-checks.outputs.repo }} 46 | steps: 47 | - name: Selective checks 48 | id: selective-checks 49 | run: | 50 | set -e 51 | 52 | REPO=${REPO_INPUTS:-"4test"} 53 | 54 | if [ "${REPO}" == "stable" ]; then 55 | UCS_REBUILD=true 56 | UCS_VERSIONS=($(curl -s -H -X ${REGISTRY_URL}/${COMPANY_NAME}/${PRODUCT_NAME}-ucs/tags/?page_size=100 | \ 57 | jq -r '.results|.[]|.name' | grep -oxE '[0-9]{1,}.[0-9]{1,}.[0-9]{1,}.1' || true)) 58 | echo "ucs-versions=$(jq -c -n '$ARGS.positional' --args "${UCS_VERSIONS[@]}")" >> "$GITHUB_OUTPUT" 59 | elif 60 | [ "${REPO}" == "4test" ]; then 61 | UCS_REBUILD=false 62 | PREFIX_NAME=4testing- 63 | fi 64 | 65 | STABLE_VERSIONS=($(curl -s -H -X ${REGISTRY_URL}/${COMPANY_NAME}/${PRODUCT_NAME}/tags/?page_size=100 | \ 66 | jq -r '.results|.[]|.name' | grep -oxE '[0-9]{1,}.[0-9]{1,}.[0-9]{1,}.1' || true)) 67 | 68 | # When rebuilding stable versions of the document server, 69 | # it is necessary to determine the version from which the 70 | # minor x.x tag will need to be pushed. 71 | 72 | VERSIONS=(${STABLE_VERSIONS[@]}) 73 | for i in {1..10}; do 74 | if [ -z "${VERSIONS}" ]; then 75 | break 76 | else 77 | TEMPLATE=${VERSIONS[0]%.*.*} 78 | TEMPLATE_MINOR=$(printf -- '%s\n' "${VERSIONS[@]}" | grep -o -m 1 "${VERSIONS[0]%.*.*}.[0-9].[0-9]") 79 | MINOR_TAGS+=(${TEMPLATE_MINOR%.*}) 80 | 81 | for v in ${MINOR_TAGS[@]}; do 82 | VERSIONS=(${VERSIONS[@]//${v%.*}.*.*}) 83 | done 84 | fi 85 | done 86 | 87 | echo "Stable releases that will be rebuilded" 88 | echo "--------------------------------------" 89 | echo "${STABLE_VERSIONS[@]}" 90 | echo 91 | echo 92 | echo "Ucs releases that will be rebuilded" 93 | echo "-----------------------------------" 94 | echo "${UCS_VERSIONS[@]}" 95 | 96 | echo "stable-versions=$(jq -c -n '$ARGS.positional' --args "${STABLE_VERSIONS[@]}")" >> "$GITHUB_OUTPUT" 97 | echo "minor-tags=${MINOR_TAGS[@]}" >> "$GITHUB_OUTPUT" 98 | echo "ucs-rebuild-condition=${UCS_REBUILD}" >> "$GITHUB_OUTPUT" 99 | echo "prefix-name=${PREFIX_NAME}" >> "$GITHUB_OUTPUT" 100 | echo "repo=${REPO}" >> "$GITHUB_OUTPUT" 101 | shell: bash 102 | 103 | re-build-stable: 104 | name: "Rebuild stable:${{ matrix.version }} ${{ matrix.edition }}" 105 | needs: [rebuild-info] 106 | runs-on: ubuntu-latest 107 | strategy: 108 | fail-fast: false 109 | matrix: 110 | type: ["stable"] 111 | edition: ["", "-ee", "-de"] 112 | version: ${{fromJSON(needs.rebuild-info.outputs.stable-versions)}} 113 | steps: 114 | - name: Checkout code 115 | uses: actions/checkout@v3 116 | - name: Set up QEMU 117 | uses: docker/setup-qemu-action@v2 118 | - name: Set up Docker Buildx 119 | uses: docker/setup-buildx-action@v2 120 | - name: Login to Docker Hub 121 | uses: docker/login-action@v2 122 | with: 123 | username: ${{ secrets.DOCKER_HUB_USERNAME }} 124 | password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} 125 | # Determines the new build number based 126 | # on data from the hub.docker registry 127 | - name: Declare release number 128 | id: release-number 129 | env: 130 | REBUILD_VERSION: ${{ matrix.version }} 131 | run: | 132 | MINOR_VERSION=${REBUILD_VERSION%.*} 133 | LAST_RELEASE=$(curl -s -H -X ${REGISTRY_URL}/${COMPANY_NAME}/${PRODUCT_NAME}/tags/?page_size=100 \ 134 | | jq -r '.results|.[]|.name' | grep -Eo -m1 "${MINOR_VERSION}.[0-9]{1,}") 135 | LAST_RELEASE=${LAST_RELEASE#*.*.*.} 136 | echo "release-number=$((LAST_RELEASE+1))" >> "$GITHUB_OUTPUT" 137 | shell: bash 138 | # Note: Rebuilding images with an 139 | # extra layer to update security and 140 | # all dependencies. Update tags got +1 to previous release. 141 | - name: Re-build documentserver-stable 142 | env: 143 | MINOR_TAGS_ST: ${{ needs.rebuild-info.outputs.minor-tags }} 144 | VERSION: ${{ matrix.version }} 145 | RELEASE_NUMBER: ${{ steps.release-number.outputs.release-number }} 146 | PREFIX_NAME: ${{ needs.rebuild-info.outputs.prefix-name }} 147 | REPO: ${{ needs.rebuild-info.outputs.repo }} 148 | PRODUCT_EDITION: ${{ matrix.edition }} 149 | run: | 150 | set -eux 151 | export PULL_TAG=${VERSION} 152 | export TAG=${VERSION%.*}.${RELEASE_NUMBER} 153 | export SHORTER_TAG=${VERSION%.*} 154 | export SHORTEST_TAG=${VERSION%.*.*} 155 | 156 | if [ "${REPO}" == "stable" ]; then 157 | MINOR_TAGS=(${MINOR_TAGS_ST}) 158 | for v in ${MINOR_TAGS[@]}; do 159 | if [ "${SHORTER_TAG}" == "${v}" ]; then 160 | export PUSH_MAJOR="true" 161 | fi 162 | done 163 | if [ "${SHORTER_TAG}" == "${MINOR_TAGS[0]}" ]; then 164 | export LATEST="true" 165 | fi 166 | fi 167 | docker buildx bake -f docker-bake.hcl documentserver-stable-rebuild --push 168 | shell: bash 169 | re-build-ucs: 170 | name: "Rebuild ucs: ${{ matrix.version }} ${{ matrix.edition }}" 171 | if: needs.rebuild-info.outputs.ucs-rebuild-condition == 'true' 172 | needs: [rebuild-info] 173 | runs-on: ubuntu-latest 174 | strategy: 175 | fail-fast: false 176 | matrix: 177 | type: ["ucs"] 178 | edition: ["", "-ee"] 179 | version: ${{fromJSON(needs.rebuild-info.outputs.ucs-versions)}} 180 | steps: 181 | - name: Checkout code 182 | uses: actions/checkout@v3 183 | - name: Set up QEMU 184 | uses: docker/setup-qemu-action@v2 185 | - name: Set up Docker Buildx 186 | uses: docker/setup-buildx-action@v2 187 | - name: Login to Docker Hub 188 | uses: docker/login-action@v2 189 | with: 190 | username: ${{ secrets.DOCKER_HUB_USERNAME }} 191 | password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} 192 | # Determines the new build number based 193 | # on data from the hub.docker registry 194 | - name: Declare release number 195 | id: release-number 196 | env: 197 | REBUILD_VERSION: ${{ matrix.version }} 198 | run: | 199 | MINOR_VERSION=${REBUILD_VERSION%.*} 200 | LAST_RELEASE=$(curl -s -H -X ${REGISTRY_URL}/${COMPANY_NAME}/${PRODUCT_NAME}/tags/?page_size=100 \ 201 | | jq -r '.results|.[]|.name' | grep -Eo -m1 "${MINOR_VERSION}.[0-9]{1,}") 202 | LAST_RELEASE=${LAST_RELEASE#*.*.*.} 203 | echo "release-number=$((LAST_RELEASE+1))" >> "$GITHUB_OUTPUT" 204 | shell: bash 205 | # Note: Rebuilding images with an 206 | # extra layer to update security and 207 | # all dependencies. Update tags +1 to previous release. 208 | - name: Re-build documentserver-ucs 209 | env: 210 | VERSION: ${{ matrix.version }} 211 | RELEASE_NUMBER: ${{ steps.release-number.outputs.release-number }} 212 | PRODUCT_EDITION: ${{ matrix.edition }} 213 | run: | 214 | set -eux 215 | export PULL_TAG=${VERSION} 216 | export TAG=${VERSION%.*}.${RELEASE_NUMBER} 217 | export SHORTER_TAG=${VERSION%.*} 218 | export SHORTEST_TAG=${VERSION%.*.*} 219 | 220 | export UCS_REBUILD=true 221 | export UCS_PREFIX=-ucs 222 | 223 | docker buildx bake -f docker-bake.hcl documentserver-stable-rebuild --push 224 | shell: bash 225 | -------------------------------------------------------------------------------- /.github/workflows/stable-build.yml: -------------------------------------------------------------------------------- 1 | ### This workflow setup instance then build and push images ### 2 | name: Multi-arch build stable 3 | run-name: ${{ inputs.tag }} (${{ inputs.release_number }}) 4 | 5 | on: 6 | workflow_dispatch: 7 | inputs: 8 | tag: 9 | description: 'Tag for release (ex. 1.2.3.45)' 10 | type: string 11 | required: true 12 | release_number: 13 | description: 'Sequence number of the release (ex. x.x.x.)' 14 | type: string 15 | required: true 16 | default: '1' 17 | 18 | env: 19 | COMPANY_NAME: "onlyoffice" 20 | PRODUCT_NAME: "documentserver" 21 | VERSION: ${{ github.event.inputs.tag }} 22 | RELEASE_NUMBER: ${{ github.event.inputs.release_number }} 23 | 24 | jobs: 25 | build: 26 | name: "Release image: DocumentServer${{ matrix.edition }}" 27 | runs-on: ubuntu-latest 28 | strategy: 29 | fail-fast: false 30 | matrix: 31 | images: ["documentserver-stable"] 32 | edition: ["", "-ee", "-de"] 33 | steps: 34 | - name: Checkout code 35 | uses: actions/checkout@v3 36 | 37 | - name: Set up QEMU 38 | uses: docker/setup-qemu-action@v2 39 | 40 | - name: Set up Docker Buildx 41 | uses: docker/setup-buildx-action@v2 42 | 43 | - name: Login to Docker Hub 44 | uses: docker/login-action@v2 45 | with: 46 | username: ${{ secrets.DOCKER_HUB_USERNAME }} 47 | password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} 48 | 49 | - name: Build documentserver-release 50 | env: 51 | TARGET: ${{ matrix.images }} 52 | PRODUCT_EDITION: ${{ matrix.edition }} 53 | run: | 54 | set -eux 55 | TESTING_IMAGE=${COMPANY_NAME}/4testing-${PRODUCT_NAME}${PRODUCT_EDITION} 56 | export PRODUCT_EDITION 57 | export PULL_TAG=${VERSION} 58 | export TAG=${VERSION%.*}.${RELEASE_NUMBER} 59 | export SHORTER_TAG=${VERSION%.*} 60 | export SHORTEST_TAG=${VERSION%.*.*} 61 | docker buildx bake -f docker-bake.hcl "${TARGET}" --push 62 | echo "DONE: Build success >> exit with 0" 63 | exit 0 64 | shell: bash 65 | 66 | build-nonexample: 67 | name: "Release image: DocumentServer${{ matrix.edition }}-nonExample" 68 | runs-on: ubuntu-latest 69 | needs: [build] 70 | if: ${{ false }} 71 | strategy: 72 | fail-fast: false 73 | matrix: 74 | images: ["documentserver-nonexample"] 75 | edition: ["", "-ee", "-de"] 76 | steps: 77 | - name: Checkout code 78 | uses: actions/checkout@v3 79 | 80 | - name: Set up QEMU 81 | uses: docker/setup-qemu-action@v2 82 | 83 | - name: Set up Docker Buildx 84 | uses: docker/setup-buildx-action@v2 85 | 86 | - name: Login to Docker Hub 87 | uses: docker/login-action@v2 88 | with: 89 | username: ${{ secrets.DOCKER_HUB_USERNAME }} 90 | password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} 91 | 92 | - name: build image 93 | env: 94 | TARGET: ${{ matrix.images }} 95 | PRODUCT_EDITION: ${{ matrix.edition }} 96 | run: | 97 | set -eux 98 | export PULL_TAG=${VERSION%.*}.${RELEASE_NUMBER} 99 | export TAG=${VERSION%.*}.${RELEASE_NUMBER} 100 | docker buildx bake -f docker-bake.hcl "${TARGET}" --push 101 | shell: bash 102 | 103 | build-ucs-ubuntu20: 104 | name: "Release image: DocumentServer${{ matrix.edition }}-ucs" 105 | runs-on: ubuntu-latest 106 | strategy: 107 | fail-fast: false 108 | matrix: 109 | edition: ["", "-ee"] 110 | steps: 111 | - name: Checkout code 112 | uses: actions/checkout@v3 113 | 114 | - name: Set up QEMU 115 | uses: docker/setup-qemu-action@v2 116 | 117 | - name: Set up Docker Buildx 118 | uses: docker/setup-buildx-action@v2 119 | 120 | - name: Login to Docker Hub 121 | uses: docker/login-action@v2 122 | with: 123 | username: ${{ secrets.DOCKER_HUB_USERNAME }} 124 | password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} 125 | 126 | - name: build UCS 127 | env: 128 | PACKAGE_BASEURL: ${{ secrets.REPO_BASEURL }} 129 | PRODUCT_EDITION: ${{ matrix.edition }} 130 | run: | 131 | set -eux 132 | export DOCKERFILE=Dockerfile 133 | export BASE_VERSION=20.04 134 | export PG_VERSION=12 135 | export PACKAGE_SUFFIX= 136 | export TAG=${VERSION%.*}.${RELEASE_NUMBER} 137 | export PACKAGE_VERSION=$( echo ${VERSION} | sed -E 's/(.*)\./\1-/') 138 | docker buildx bake -f docker-bake.hcl documentserver-ucs --push 139 | shell: bash 140 | -------------------------------------------------------------------------------- /.github/workflows/zap-ds.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Scanning DocumentServer with ZAP 3 | 4 | run-name: > 5 | ZAP DocumentServer ver: ${{ github.event.inputs.version }} from branch: ${{ github.event.inputs.branch }} 6 | 7 | on: 8 | workflow_dispatch: 9 | inputs: 10 | version: 11 | description: 'Set DocumentServer version that will be deployed' 12 | type: string 13 | required: true 14 | branch: 15 | description: 'The branch from which the scan will be performed' 16 | type: string 17 | required: true 18 | jobs: 19 | zap: 20 | name: "Zap scanning DocumentServer" 21 | runs-on: ubuntu-latest 22 | permissions: 23 | issues: write 24 | steps: 25 | - name: Checkout code 26 | uses: actions/checkout@v3 27 | 28 | - name: Run DS 29 | id: run-ds 30 | env: 31 | TAG: ${{ github.event.inputs.version }} 32 | run: | 33 | # Create ssl certs 34 | openssl genrsa -out tls.key 2048 35 | openssl req -new -key tls.key -out tls.csr -subj "/C=RU/ST=NizhObl/L=NizhNov/O=RK-Tech/OU=TestUnit/CN=TestName" 36 | openssl x509 -req -days 365 -in tls.csr -signkey tls.key -out tls.crt 37 | openssl dhparam -out dhparam.pem 2048 38 | sudo mkdir -p /app/onlyoffice/DocumentServer/data/certs 39 | sudo cp ./tls.key /app/onlyoffice/DocumentServer/data/certs/ 40 | sudo cp ./tls.crt /app/onlyoffice/DocumentServer/data/certs/ 41 | sudo cp ./dhparam.pem /app/onlyoffice/DocumentServer/data/certs/ 42 | sudo chmod 400 /app/onlyoffice/DocumentServer/data/certs/tls.key 43 | rm ./tls.key ./tls.crt ./dhparam.pem 44 | 45 | # Run Ds with enabled ssl 46 | export CONTAINER_NAME="documentserver" 47 | sudo docker run -itd \ 48 | --name ${CONTAINER_NAME} \ 49 | -p 80:80 \ 50 | -p 443:443 \ 51 | -v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data \ 52 | onlyoffice/4testing-documentserver:${TAG} 53 | sleep 60 54 | sudo docker exec ${CONTAINER_NAME} sudo supervisorctl start ds:example 55 | LOCAL_IP=$(hostname -I | awk '{print $1}') 56 | echo "local-ip=${LOCAL_IP}" >> "$GITHUB_OUTPUT" 57 | 58 | # Scan DocumentServer with ZAP. 59 | # NOTE: Full scan get a lot of time. 60 | # If you want make scan more faster (but less accurate) remove `cmd options` field 61 | # -j mean that scanning use AJAX Spider, with this spider the scan takes approximately an hour 62 | # Without any cmd options will be used default spider and the scan takes approximately ~10-15 minutes 63 | - name: ZAP Scan 64 | uses: zaproxy/action-full-scan@v0.12.0 65 | with: 66 | token: ${{ secrets.GITHUB_TOKEN }} 67 | docker_name: 'ghcr.io/zaproxy/zaproxy:stable' 68 | target: 'https://${{ steps.run-ds.outputs.local-ip }}/' 69 | allow_issue_writing: false 70 | cmd_options: '-j' 71 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: generic 2 | 3 | dist: trusty 4 | 5 | env: 6 | # community edition 7 | - config: standalone.yml 8 | 9 | # integration edition 10 | - config: standalone.yml 11 | PRODUCT_NAME: documentserver-ie 12 | 13 | 14 | # certificates (default tls if onlyoffice not exists) 15 | - config: certs.yml 16 | ssl: true 17 | 18 | # certificates (default onlyoffice if exists) 19 | - config: certs.yml 20 | ssl: true 21 | private_key: onlyoffice.key 22 | certificate_request: onlyoffice.csr 23 | certificate: onlyoffice.crt 24 | 25 | # custom certificates 26 | - config: certs-customized.yml 27 | ssl: true 28 | private_key: mycert.key 29 | certificate_request: mycert.csr 30 | certificate: mycert.crt 31 | SSL_CERTIFICATE_PATH: /var/www/onlyoffice/Data/certs/mycert.crt 32 | SSL_KEY_PATH: /var/www/onlyoffice/Data/certs/mycert.key 33 | 34 | 35 | # postgresql 16 36 | - config: postgres.yml 37 | POSTGRES_VERSION: 16 38 | 39 | # postgresql 15 40 | - config: postgres.yml 41 | POSTGRES_VERSION: 15 42 | 43 | # postgresql 14 44 | - config: postgres.yml 45 | POSTGRES_VERSION: 14 46 | 47 | # postgresql 13 48 | - config: postgres.yml 49 | POSTGRES_VERSION: 13 50 | 51 | # postgresql 12 52 | - config: postgres.yml 53 | 54 | # postgresql custom values 55 | - config: postgres.yml 56 | DB_NAME: mydb 57 | DB_USER: myuser 58 | DB_PWD: password 59 | POSTGRES_DB: mydb 60 | POSTGRES_USER: myuser 61 | 62 | # postgresql deprecated variables 63 | - config: postgres-old.yml 64 | 65 | 66 | # mysql 8 67 | - config: mysql.yml 68 | MYSQL_VERSION: 8 69 | 70 | # mysql 5 71 | - config: mysql.yml 72 | MYSQL_VERSION: 5 73 | 74 | # mysql 5.7 75 | - config: mysql.yml 76 | 77 | 78 | # mariadb 10 79 | - config: mariadb.yml 80 | MARIADB_VERSION: 10 81 | 82 | # mariadb 10.5 83 | - config: mariadb.yml 84 | 85 | 86 | - config: activemq.yml 87 | ACTIVEMQ_VERSION: latest 88 | 89 | # activemq 5.14.3 90 | - config: activemq.yml 91 | 92 | 93 | # rabbitmq latest 94 | - config: rabbitmq.yml 95 | 96 | # rabbitmq 3 97 | - config: rabbitmq.yml 98 | RABBITMQ_VERSION: 3 99 | 100 | # rabbitmq old variables 101 | - config: rabbitmq-old.yml 102 | 103 | 104 | # redis latest with community edition 105 | - config: redis.yml 106 | 107 | # redis latest with integraion edition 108 | - config: redis.yml 109 | PRODUCT_NAME: documentserver-ie 110 | 111 | # redis 6 112 | - config: redis.yml 113 | REDIS_VERSION: 6 114 | 115 | # redis 5 116 | - config: redis.yml 117 | REDIS_VERSION: 5 118 | 119 | 120 | # graphite 121 | - config: graphite.yml 122 | 123 | services: 124 | - docker 125 | 126 | script: 127 | # Go to tests dir 128 | - cd ${PWD}/tests 129 | 130 | # Run test. 131 | - ./test.sh 132 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE_VERSION=24.04 2 | 3 | ARG BASE_IMAGE=ubuntu:$BASE_VERSION 4 | 5 | FROM ${BASE_IMAGE} AS documentserver 6 | LABEL maintainer Ascensio System SIA 7 | 8 | ARG BASE_VERSION 9 | 10 | ARG PG_VERSION=16 11 | ARG PACKAGE_SUFFIX=t64 12 | 13 | ARG OOU_VERSION_MAJOR=8.3.3 14 | ARG OOU_BUILD=1 15 | 16 | 17 | ENV OC_RELEASE_NUM=21 18 | ENV OC_RU_VER=12 19 | ENV OC_RU_REVISION_VER=0 20 | ENV OC_RESERVED_NUM=0 21 | ENV OC_RU_DATE=0 22 | ENV OC_PATH=${OC_RELEASE_NUM}${OC_RU_VER}000 23 | ENV OC_FILE_SUFFIX=${OC_RELEASE_NUM}.${OC_RU_VER}.${OC_RU_REVISION_VER}.${OC_RESERVED_NUM}.${OC_RU_DATE}${OC_FILE_SUFFIX}dbru 24 | ENV OC_VER_DIR=${OC_RELEASE_NUM}_${OC_RU_VER} 25 | ENV OC_DOWNLOAD_URL=https://download.oracle.com/otn_software/linux/instantclient/${OC_PATH} 26 | 27 | ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive PG_VERSION=${PG_VERSION} BASE_VERSION=${BASE_VERSION} 28 | 29 | ARG ONLYOFFICE_VALUE=onlyoffice 30 | 31 | RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \ 32 | apt-get -y update && \ 33 | apt-get -yq install wget apt-transport-https gnupg locales lsb-release && \ 34 | wget -q -O /etc/apt/sources.list.d/mssql-release.list "https://packages.microsoft.com/config/ubuntu/$BASE_VERSION/prod.list" && \ 35 | wget -q -O /tmp/microsoft.asc https://packages.microsoft.com/keys/microsoft.asc && \ 36 | apt-key add /tmp/microsoft.asc && \ 37 | gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg < /tmp/microsoft.asc && \ 38 | apt-get -y update && \ 39 | locale-gen en_US.UTF-8 && \ 40 | echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections && \ 41 | ACCEPT_EULA=Y apt-get -yq install \ 42 | adduser \ 43 | apt-utils \ 44 | bomstrip \ 45 | certbot \ 46 | cron \ 47 | curl \ 48 | htop \ 49 | libaio1${PACKAGE_SUFFIX} \ 50 | libasound2${PACKAGE_SUFFIX} \ 51 | libboost-regex-dev \ 52 | libcairo2 \ 53 | libcurl3-gnutls \ 54 | libcurl4 \ 55 | libgtk-3-0 \ 56 | libnspr4 \ 57 | libnss3 \ 58 | libstdc++6 \ 59 | libxml2 \ 60 | libxss1 \ 61 | libxtst6 \ 62 | mssql-tools18 \ 63 | mysql-client \ 64 | nano \ 65 | net-tools \ 66 | netcat-openbsd \ 67 | nginx-extras \ 68 | postgresql \ 69 | postgresql-client \ 70 | pwgen \ 71 | rabbitmq-server \ 72 | redis-server \ 73 | sudo \ 74 | supervisor \ 75 | ttf-mscorefonts-installer \ 76 | unixodbc-dev \ 77 | unzip \ 78 | xvfb \ 79 | xxd \ 80 | zlib1g || dpkg --configure -a && \ 81 | # Added dpkg --configure -a to handle installation issues with rabbitmq-server on arm64 architecture 82 | if [ $(ls -l /usr/share/fonts/truetype/msttcorefonts | wc -l) -ne 61 ]; \ 83 | then echo 'msttcorefonts failed to download'; exit 1; fi && \ 84 | echo "SERVER_ADDITIONAL_ERL_ARGS=\"+S 1:1\"" | tee -a /etc/rabbitmq/rabbitmq-env.conf && \ 85 | sed -i "s/bind .*/bind 127.0.0.1/g" /etc/redis/redis.conf && \ 86 | sed 's|\(application\/zip.*\)|\1\n application\/wasm wasm;|' -i /etc/nginx/mime.types && \ 87 | pg_conftool $PG_VERSION main set listen_addresses 'localhost' && \ 88 | service postgresql restart && \ 89 | sudo -u postgres psql -c "CREATE USER $ONLYOFFICE_VALUE WITH password '$ONLYOFFICE_VALUE';" && \ 90 | sudo -u postgres psql -c "CREATE DATABASE $ONLYOFFICE_VALUE OWNER $ONLYOFFICE_VALUE;" && \ 91 | wget -O basic.zip ${OC_DOWNLOAD_URL}/instantclient-basic-linux.x64-${OC_FILE_SUFFIX}.zip && \ 92 | wget -O sqlplus.zip ${OC_DOWNLOAD_URL}/instantclient-sqlplus-linux.x64-${OC_FILE_SUFFIX}.zip && \ 93 | unzip -d /usr/share basic.zip && \ 94 | unzip -d /usr/share sqlplus.zip && \ 95 | mv /usr/share/instantclient_${OC_VER_DIR} /usr/share/instantclient && \ 96 | service postgresql stop && \ 97 | service redis-server stop && \ 98 | service rabbitmq-server stop && \ 99 | service supervisor stop && \ 100 | service nginx stop && \ 101 | rm -rf /var/lib/apt/lists/* 102 | 103 | COPY config/supervisor/supervisor /etc/init.d/ 104 | COPY config/supervisor/ds/*.conf /etc/supervisor/conf.d/ 105 | COPY run-document-server.sh /app/ds/run-document-server.sh 106 | COPY oracle/sqlplus /usr/bin/sqlplus 107 | 108 | EXPOSE 80 443 109 | 110 | ARG COMPANY_NAME=onlyoffice 111 | ARG PRODUCT_NAME=documentserver 112 | ARG PRODUCT_EDITION= 113 | ARG PACKAGE_VERSION= 114 | ARG TARGETARCH 115 | ARG PACKAGE_BASEURL="http://download.onlyoffice.com/install/documentserver/linux" 116 | 117 | ENV COMPANY_NAME=$COMPANY_NAME \ 118 | PRODUCT_NAME=$PRODUCT_NAME \ 119 | PRODUCT_EDITION=$PRODUCT_EDITION \ 120 | DS_PLUGIN_INSTALLATION=false \ 121 | DS_DOCKER_INSTALLATION=true 122 | 123 | ## PACKAGE_FILE="${COMPANY_NAME}-${PRODUCT_NAME}${PRODUCT_EDITION}${PACKAGE_VERSION:+_$PACKAGE_VERSION}_${TARGETARCH:-$(dpkg --print-architecture)}.deb" && \ 124 | ## wget -q -P /tmp "$PACKAGE_BASEURL/$PACKAGE_FILE" && \ 125 | ## rm -f /tmp/onlyoffice-documentserver*.deb && \ 126 | RUN wget -q -P /tmp "https://github.com/thomisus/server/releases/download/${OOU_VERSION_MAJOR}.${OOU_BUILD}/onlyoffice-documentserver_${OOU_VERSION_MAJOR}-${OOU_BUILD}.oou_amd64.deb" && \ 127 | apt-get -y update && \ 128 | service postgresql start && \ 129 | apt-get -yq install /tmp/onlyoffice-documentserver_${OOU_VERSION_MAJOR}-${OOU_BUILD}.oou_amd64.deb && \ 130 | service postgresql stop && \ 131 | chmod 755 /etc/init.d/supervisor && \ 132 | sed "s/COMPANY_NAME/${COMPANY_NAME}/g" -i /etc/supervisor/conf.d/*.conf && \ 133 | service supervisor stop && \ 134 | chmod 755 /app/ds/*.sh && \ 135 | rm -f /tmp/onlyoffice-documentserver_${OOU_VERSION_MAJOR}-${OOU_BUILD}.oou_amd64.deb && \ 136 | printf "\nGO" >> /var/www/$COMPANY_NAME/documentserver/server/schema/mssql/createdb.sql && \ 137 | printf "\nGO" >> /var/www/$COMPANY_NAME/documentserver/server/schema/mssql/removetbl.sql && \ 138 | printf "\nexit" >> /var/www/$COMPANY_NAME/documentserver/server/schema/oracle/createdb.sql && \ 139 | printf "\nexit" >> /var/www/$COMPANY_NAME/documentserver/server/schema/oracle/removetbl.sql && \ 140 | rm -f /tmp/*.deb && \ 141 | rm -rf /var/log/$COMPANY_NAME && \ 142 | rm -rf /var/lib/apt/lists/* 143 | 144 | VOLUME /var/log/$COMPANY_NAME /var/lib/$COMPANY_NAME /var/www/$COMPANY_NAME/Data /var/lib/postgresql /var/lib/rabbitmq /var/lib/redis /usr/share/fonts/truetype/custom 145 | 146 | ENTRYPOINT ["/app/ds/run-document-server.sh"] 147 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | GNU AFFERO GENERAL PUBLIC LICENSE 2 | Version 3, 19 November 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU Affero General Public License is a free, copyleft license for 11 | software and other kinds of works, specifically designed to ensure 12 | cooperation with the community in the case of network server software. 13 | 14 | The licenses for most software and other practical works are designed 15 | to take away your freedom to share and change the works. By contrast, 16 | our General Public Licenses are intended to guarantee your freedom to 17 | share and change all versions of a program--to make sure it remains free 18 | software for all its users. 19 | 20 | When we speak of free software, we are referring to freedom, not 21 | price. Our General Public Licenses are designed to make sure that you 22 | have the freedom to distribute copies of free software (and charge for 23 | them if you wish), that you receive source code or can get it if you 24 | want it, that you can change the software or use pieces of it in new 25 | free programs, and that you know you can do these things. 26 | 27 | Developers that use our General Public Licenses protect your rights 28 | with two steps: (1) assert copyright on the software, and (2) offer 29 | you this License which gives you legal permission to copy, distribute 30 | and/or modify the software. 31 | 32 | A secondary benefit of defending all users' freedom is that 33 | improvements made in alternate versions of the program, if they 34 | receive widespread use, become available for other developers to 35 | incorporate. Many developers of free software are heartened and 36 | encouraged by the resulting cooperation. However, in the case of 37 | software used on network servers, this result may fail to come about. 38 | The GNU General Public License permits making a modified version and 39 | letting the public access it on a server without ever releasing its 40 | source code to the public. 41 | 42 | The GNU Affero General Public License is designed specifically to 43 | ensure that, in such cases, the modified source code becomes available 44 | to the community. It requires the operator of a network server to 45 | provide the source code of the modified version running there to the 46 | users of that server. Therefore, public use of a modified version, on 47 | a publicly accessible server, gives the public access to the source 48 | code of the modified version. 49 | 50 | An older license, called the Affero General Public License and 51 | published by Affero, was designed to accomplish similar goals. This is 52 | a different license, not a version of the Affero GPL, but Affero has 53 | released a new version of the Affero GPL which permits relicensing under 54 | this license. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | TERMS AND CONDITIONS 60 | 61 | 0. Definitions. 62 | 63 | "This License" refers to version 3 of the GNU Affero General Public License. 64 | 65 | "Copyright" also means copyright-like laws that apply to other kinds of 66 | works, such as semiconductor masks. 67 | 68 | "The Program" refers to any copyrightable work licensed under this 69 | License. Each licensee is addressed as "you". "Licensees" and 70 | "recipients" may be individuals or organizations. 71 | 72 | To "modify" a work means to copy from or adapt all or part of the work 73 | in a fashion requiring copyright permission, other than the making of an 74 | exact copy. The resulting work is called a "modified version" of the 75 | earlier work or a work "based on" the earlier work. 76 | 77 | A "covered work" means either the unmodified Program or a work based 78 | on the Program. 79 | 80 | To "propagate" a work means to do anything with it that, without 81 | permission, would make you directly or secondarily liable for 82 | infringement under applicable copyright law, except executing it on a 83 | computer or modifying a private copy. Propagation includes copying, 84 | distribution (with or without modification), making available to the 85 | public, and in some countries other activities as well. 86 | 87 | To "convey" a work means any kind of propagation that enables other 88 | parties to make or receive copies. Mere interaction with a user through 89 | a computer network, with no transfer of a copy, is not conveying. 90 | 91 | An interactive user interface displays "Appropriate Legal Notices" 92 | to the extent that it includes a convenient and prominently visible 93 | feature that (1) displays an appropriate copyright notice, and (2) 94 | tells the user that there is no warranty for the work (except to the 95 | extent that warranties are provided), that licensees may convey the 96 | work under this License, and how to view a copy of this License. If 97 | the interface presents a list of user commands or options, such as a 98 | menu, a prominent item in the list meets this criterion. 99 | 100 | 1. Source Code. 101 | 102 | The "source code" for a work means the preferred form of the work 103 | for making modifications to it. "Object code" means any non-source 104 | form of a work. 105 | 106 | A "Standard Interface" means an interface that either is an official 107 | standard defined by a recognized standards body, or, in the case of 108 | interfaces specified for a particular programming language, one that 109 | is widely used among developers working in that language. 110 | 111 | The "System Libraries" of an executable work include anything, other 112 | than the work as a whole, that (a) is included in the normal form of 113 | packaging a Major Component, but which is not part of that Major 114 | Component, and (b) serves only to enable use of the work with that 115 | Major Component, or to implement a Standard Interface for which an 116 | implementation is available to the public in source code form. A 117 | "Major Component", in this context, means a major essential component 118 | (kernel, window system, and so on) of the specific operating system 119 | (if any) on which the executable work runs, or a compiler used to 120 | produce the work, or an object code interpreter used to run it. 121 | 122 | The "Corresponding Source" for a work in object code form means all 123 | the source code needed to generate, install, and (for an executable 124 | work) run the object code and to modify the work, including scripts to 125 | control those activities. However, it does not include the work's 126 | System Libraries, or general-purpose tools or generally available free 127 | programs which are used unmodified in performing those activities but 128 | which are not part of the work. For example, Corresponding Source 129 | includes interface definition files associated with source files for 130 | the work, and the source code for shared libraries and dynamically 131 | linked subprograms that the work is specifically designed to require, 132 | such as by intimate data communication or control flow between those 133 | subprograms and other parts of the work. 134 | 135 | The Corresponding Source need not include anything that users 136 | can regenerate automatically from other parts of the Corresponding 137 | Source. 138 | 139 | The Corresponding Source for a work in source code form is that 140 | same work. 141 | 142 | 2. Basic Permissions. 143 | 144 | All rights granted under this License are granted for the term of 145 | copyright on the Program, and are irrevocable provided the stated 146 | conditions are met. This License explicitly affirms your unlimited 147 | permission to run the unmodified Program. The output from running a 148 | covered work is covered by this License only if the output, given its 149 | content, constitutes a covered work. This License acknowledges your 150 | rights of fair use or other equivalent, as provided by copyright law. 151 | 152 | You may make, run and propagate covered works that you do not 153 | convey, without conditions so long as your license otherwise remains 154 | in force. You may convey covered works to others for the sole purpose 155 | of having them make modifications exclusively for you, or provide you 156 | with facilities for running those works, provided that you comply with 157 | the terms of this License in conveying all material for which you do 158 | not control copyright. Those thus making or running the covered works 159 | for you must do so exclusively on your behalf, under your direction 160 | and control, on terms that prohibit them from making any copies of 161 | your copyrighted material outside their relationship with you. 162 | 163 | Conveying under any other circumstances is permitted solely under 164 | the conditions stated below. Sublicensing is not allowed; section 10 165 | makes it unnecessary. 166 | 167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 168 | 169 | No covered work shall be deemed part of an effective technological 170 | measure under any applicable law fulfilling obligations under article 171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 172 | similar laws prohibiting or restricting circumvention of such 173 | measures. 174 | 175 | When you convey a covered work, you waive any legal power to forbid 176 | circumvention of technological measures to the extent such circumvention 177 | is effected by exercising rights under this License with respect to 178 | the covered work, and you disclaim any intention to limit operation or 179 | modification of the work as a means of enforcing, against the work's 180 | users, your or third parties' legal rights to forbid circumvention of 181 | technological measures. 182 | 183 | 4. Conveying Verbatim Copies. 184 | 185 | You may convey verbatim copies of the Program's source code as you 186 | receive it, in any medium, provided that you conspicuously and 187 | appropriately publish on each copy an appropriate copyright notice; 188 | keep intact all notices stating that this License and any 189 | non-permissive terms added in accord with section 7 apply to the code; 190 | keep intact all notices of the absence of any warranty; and give all 191 | recipients a copy of this License along with the Program. 192 | 193 | You may charge any price or no price for each copy that you convey, 194 | and you may offer support or warranty protection for a fee. 195 | 196 | 5. Conveying Modified Source Versions. 197 | 198 | You may convey a work based on the Program, or the modifications to 199 | produce it from the Program, in the form of source code under the 200 | terms of section 4, provided that you also meet all of these conditions: 201 | 202 | a) The work must carry prominent notices stating that you modified 203 | it, and giving a relevant date. 204 | 205 | b) The work must carry prominent notices stating that it is 206 | released under this License and any conditions added under section 207 | 7. This requirement modifies the requirement in section 4 to 208 | "keep intact all notices". 209 | 210 | c) You must license the entire work, as a whole, under this 211 | License to anyone who comes into possession of a copy. This 212 | License will therefore apply, along with any applicable section 7 213 | additional terms, to the whole of the work, and all its parts, 214 | regardless of how they are packaged. This License gives no 215 | permission to license the work in any other way, but it does not 216 | invalidate such permission if you have separately received it. 217 | 218 | d) If the work has interactive user interfaces, each must display 219 | Appropriate Legal Notices; however, if the Program has interactive 220 | interfaces that do not display Appropriate Legal Notices, your 221 | work need not make them do so. 222 | 223 | A compilation of a covered work with other separate and independent 224 | works, which are not by their nature extensions of the covered work, 225 | and which are not combined with it such as to form a larger program, 226 | in or on a volume of a storage or distribution medium, is called an 227 | "aggregate" if the compilation and its resulting copyright are not 228 | used to limit the access or legal rights of the compilation's users 229 | beyond what the individual works permit. Inclusion of a covered work 230 | in an aggregate does not cause this License to apply to the other 231 | parts of the aggregate. 232 | 233 | 6. Conveying Non-Source Forms. 234 | 235 | You may convey a covered work in object code form under the terms 236 | of sections 4 and 5, provided that you also convey the 237 | machine-readable Corresponding Source under the terms of this License, 238 | in one of these ways: 239 | 240 | a) Convey the object code in, or embodied in, a physical product 241 | (including a physical distribution medium), accompanied by the 242 | Corresponding Source fixed on a durable physical medium 243 | customarily used for software interchange. 244 | 245 | b) Convey the object code in, or embodied in, a physical product 246 | (including a physical distribution medium), accompanied by a 247 | written offer, valid for at least three years and valid for as 248 | long as you offer spare parts or customer support for that product 249 | model, to give anyone who possesses the object code either (1) a 250 | copy of the Corresponding Source for all the software in the 251 | product that is covered by this License, on a durable physical 252 | medium customarily used for software interchange, for a price no 253 | more than your reasonable cost of physically performing this 254 | conveying of source, or (2) access to copy the 255 | Corresponding Source from a network server at no charge. 256 | 257 | c) Convey individual copies of the object code with a copy of the 258 | written offer to provide the Corresponding Source. This 259 | alternative is allowed only occasionally and noncommercially, and 260 | only if you received the object code with such an offer, in accord 261 | with subsection 6b. 262 | 263 | d) Convey the object code by offering access from a designated 264 | place (gratis or for a charge), and offer equivalent access to the 265 | Corresponding Source in the same way through the same place at no 266 | further charge. You need not require recipients to copy the 267 | Corresponding Source along with the object code. If the place to 268 | copy the object code is a network server, the Corresponding Source 269 | may be on a different server (operated by you or a third party) 270 | that supports equivalent copying facilities, provided you maintain 271 | clear directions next to the object code saying where to find the 272 | Corresponding Source. Regardless of what server hosts the 273 | Corresponding Source, you remain obligated to ensure that it is 274 | available for as long as needed to satisfy these requirements. 275 | 276 | e) Convey the object code using peer-to-peer transmission, provided 277 | you inform other peers where the object code and Corresponding 278 | Source of the work are being offered to the general public at no 279 | charge under subsection 6d. 280 | 281 | A separable portion of the object code, whose source code is excluded 282 | from the Corresponding Source as a System Library, need not be 283 | included in conveying the object code work. 284 | 285 | A "User Product" is either (1) a "consumer product", which means any 286 | tangible personal property which is normally used for personal, family, 287 | or household purposes, or (2) anything designed or sold for incorporation 288 | into a dwelling. In determining whether a product is a consumer product, 289 | doubtful cases shall be resolved in favor of coverage. For a particular 290 | product received by a particular user, "normally used" refers to a 291 | typical or common use of that class of product, regardless of the status 292 | of the particular user or of the way in which the particular user 293 | actually uses, or expects or is expected to use, the product. A product 294 | is a consumer product regardless of whether the product has substantial 295 | commercial, industrial or non-consumer uses, unless such uses represent 296 | the only significant mode of use of the product. 297 | 298 | "Installation Information" for a User Product means any methods, 299 | procedures, authorization keys, or other information required to install 300 | and execute modified versions of a covered work in that User Product from 301 | a modified version of its Corresponding Source. The information must 302 | suffice to ensure that the continued functioning of the modified object 303 | code is in no case prevented or interfered with solely because 304 | modification has been made. 305 | 306 | If you convey an object code work under this section in, or with, or 307 | specifically for use in, a User Product, and the conveying occurs as 308 | part of a transaction in which the right of possession and use of the 309 | User Product is transferred to the recipient in perpetuity or for a 310 | fixed term (regardless of how the transaction is characterized), the 311 | Corresponding Source conveyed under this section must be accompanied 312 | by the Installation Information. But this requirement does not apply 313 | if neither you nor any third party retains the ability to install 314 | modified object code on the User Product (for example, the work has 315 | been installed in ROM). 316 | 317 | The requirement to provide Installation Information does not include a 318 | requirement to continue to provide support service, warranty, or updates 319 | for a work that has been modified or installed by the recipient, or for 320 | the User Product in which it has been modified or installed. Access to a 321 | network may be denied when the modification itself materially and 322 | adversely affects the operation of the network or violates the rules and 323 | protocols for communication across the network. 324 | 325 | Corresponding Source conveyed, and Installation Information provided, 326 | in accord with this section must be in a format that is publicly 327 | documented (and with an implementation available to the public in 328 | source code form), and must require no special password or key for 329 | unpacking, reading or copying. 330 | 331 | 7. Additional Terms. 332 | 333 | "Additional permissions" are terms that supplement the terms of this 334 | License by making exceptions from one or more of its conditions. 335 | Additional permissions that are applicable to the entire Program shall 336 | be treated as though they were included in this License, to the extent 337 | that they are valid under applicable law. If additional permissions 338 | apply only to part of the Program, that part may be used separately 339 | under those permissions, but the entire Program remains governed by 340 | this License without regard to the additional permissions. 341 | 342 | When you convey a copy of a covered work, you may at your option 343 | remove any additional permissions from that copy, or from any part of 344 | it. (Additional permissions may be written to require their own 345 | removal in certain cases when you modify the work.) You may place 346 | additional permissions on material, added by you to a covered work, 347 | for which you have or can give appropriate copyright permission. 348 | 349 | Notwithstanding any other provision of this License, for material you 350 | add to a covered work, you may (if authorized by the copyright holders of 351 | that material) supplement the terms of this License with terms: 352 | 353 | a) Disclaiming warranty or limiting liability differently from the 354 | terms of sections 15 and 16 of this License; or 355 | 356 | b) Requiring preservation of specified reasonable legal notices or 357 | author attributions in that material or in the Appropriate Legal 358 | Notices displayed by works containing it; or 359 | 360 | c) Prohibiting misrepresentation of the origin of that material, or 361 | requiring that modified versions of such material be marked in 362 | reasonable ways as different from the original version; or 363 | 364 | d) Limiting the use for publicity purposes of names of licensors or 365 | authors of the material; or 366 | 367 | e) Declining to grant rights under trademark law for use of some 368 | trade names, trademarks, or service marks; or 369 | 370 | f) Requiring indemnification of licensors and authors of that 371 | material by anyone who conveys the material (or modified versions of 372 | it) with contractual assumptions of liability to the recipient, for 373 | any liability that these contractual assumptions directly impose on 374 | those licensors and authors. 375 | 376 | All other non-permissive additional terms are considered "further 377 | restrictions" within the meaning of section 10. If the Program as you 378 | received it, or any part of it, contains a notice stating that it is 379 | governed by this License along with a term that is a further 380 | restriction, you may remove that term. If a license document contains 381 | a further restriction but permits relicensing or conveying under this 382 | License, you may add to a covered work material governed by the terms 383 | of that license document, provided that the further restriction does 384 | not survive such relicensing or conveying. 385 | 386 | If you add terms to a covered work in accord with this section, you 387 | must place, in the relevant source files, a statement of the 388 | additional terms that apply to those files, or a notice indicating 389 | where to find the applicable terms. 390 | 391 | Additional terms, permissive or non-permissive, may be stated in the 392 | form of a separately written license, or stated as exceptions; 393 | the above requirements apply either way. 394 | 395 | 8. Termination. 396 | 397 | You may not propagate or modify a covered work except as expressly 398 | provided under this License. Any attempt otherwise to propagate or 399 | modify it is void, and will automatically terminate your rights under 400 | this License (including any patent licenses granted under the third 401 | paragraph of section 11). 402 | 403 | However, if you cease all violation of this License, then your 404 | license from a particular copyright holder is reinstated (a) 405 | provisionally, unless and until the copyright holder explicitly and 406 | finally terminates your license, and (b) permanently, if the copyright 407 | holder fails to notify you of the violation by some reasonable means 408 | prior to 60 days after the cessation. 409 | 410 | Moreover, your license from a particular copyright holder is 411 | reinstated permanently if the copyright holder notifies you of the 412 | violation by some reasonable means, this is the first time you have 413 | received notice of violation of this License (for any work) from that 414 | copyright holder, and you cure the violation prior to 30 days after 415 | your receipt of the notice. 416 | 417 | Termination of your rights under this section does not terminate the 418 | licenses of parties who have received copies or rights from you under 419 | this License. If your rights have been terminated and not permanently 420 | reinstated, you do not qualify to receive new licenses for the same 421 | material under section 10. 422 | 423 | 9. Acceptance Not Required for Having Copies. 424 | 425 | You are not required to accept this License in order to receive or 426 | run a copy of the Program. Ancillary propagation of a covered work 427 | occurring solely as a consequence of using peer-to-peer transmission 428 | to receive a copy likewise does not require acceptance. However, 429 | nothing other than this License grants you permission to propagate or 430 | modify any covered work. These actions infringe copyright if you do 431 | not accept this License. Therefore, by modifying or propagating a 432 | covered work, you indicate your acceptance of this License to do so. 433 | 434 | 10. Automatic Licensing of Downstream Recipients. 435 | 436 | Each time you convey a covered work, the recipient automatically 437 | receives a license from the original licensors, to run, modify and 438 | propagate that work, subject to this License. You are not responsible 439 | for enforcing compliance by third parties with this License. 440 | 441 | An "entity transaction" is a transaction transferring control of an 442 | organization, or substantially all assets of one, or subdividing an 443 | organization, or merging organizations. If propagation of a covered 444 | work results from an entity transaction, each party to that 445 | transaction who receives a copy of the work also receives whatever 446 | licenses to the work the party's predecessor in interest had or could 447 | give under the previous paragraph, plus a right to possession of the 448 | Corresponding Source of the work from the predecessor in interest, if 449 | the predecessor has it or can get it with reasonable efforts. 450 | 451 | You may not impose any further restrictions on the exercise of the 452 | rights granted or affirmed under this License. For example, you may 453 | not impose a license fee, royalty, or other charge for exercise of 454 | rights granted under this License, and you may not initiate litigation 455 | (including a cross-claim or counterclaim in a lawsuit) alleging that 456 | any patent claim is infringed by making, using, selling, offering for 457 | sale, or importing the Program or any portion of it. 458 | 459 | 11. Patents. 460 | 461 | A "contributor" is a copyright holder who authorizes use under this 462 | License of the Program or a work on which the Program is based. The 463 | work thus licensed is called the contributor's "contributor version". 464 | 465 | A contributor's "essential patent claims" are all patent claims 466 | owned or controlled by the contributor, whether already acquired or 467 | hereafter acquired, that would be infringed by some manner, permitted 468 | by this License, of making, using, or selling its contributor version, 469 | but do not include claims that would be infringed only as a 470 | consequence of further modification of the contributor version. For 471 | purposes of this definition, "control" includes the right to grant 472 | patent sublicenses in a manner consistent with the requirements of 473 | this License. 474 | 475 | Each contributor grants you a non-exclusive, worldwide, royalty-free 476 | patent license under the contributor's essential patent claims, to 477 | make, use, sell, offer for sale, import and otherwise run, modify and 478 | propagate the contents of its contributor version. 479 | 480 | In the following three paragraphs, a "patent license" is any express 481 | agreement or commitment, however denominated, not to enforce a patent 482 | (such as an express permission to practice a patent or covenant not to 483 | sue for patent infringement). To "grant" such a patent license to a 484 | party means to make such an agreement or commitment not to enforce a 485 | patent against the party. 486 | 487 | If you convey a covered work, knowingly relying on a patent license, 488 | and the Corresponding Source of the work is not available for anyone 489 | to copy, free of charge and under the terms of this License, through a 490 | publicly available network server or other readily accessible means, 491 | then you must either (1) cause the Corresponding Source to be so 492 | available, or (2) arrange to deprive yourself of the benefit of the 493 | patent license for this particular work, or (3) arrange, in a manner 494 | consistent with the requirements of this License, to extend the patent 495 | license to downstream recipients. "Knowingly relying" means you have 496 | actual knowledge that, but for the patent license, your conveying the 497 | covered work in a country, or your recipient's use of the covered work 498 | in a country, would infringe one or more identifiable patents in that 499 | country that you have reason to believe are valid. 500 | 501 | If, pursuant to or in connection with a single transaction or 502 | arrangement, you convey, or propagate by procuring conveyance of, a 503 | covered work, and grant a patent license to some of the parties 504 | receiving the covered work authorizing them to use, propagate, modify 505 | or convey a specific copy of the covered work, then the patent license 506 | you grant is automatically extended to all recipients of the covered 507 | work and works based on it. 508 | 509 | A patent license is "discriminatory" if it does not include within 510 | the scope of its coverage, prohibits the exercise of, or is 511 | conditioned on the non-exercise of one or more of the rights that are 512 | specifically granted under this License. You may not convey a covered 513 | work if you are a party to an arrangement with a third party that is 514 | in the business of distributing software, under which you make payment 515 | to the third party based on the extent of your activity of conveying 516 | the work, and under which the third party grants, to any of the 517 | parties who would receive the covered work from you, a discriminatory 518 | patent license (a) in connection with copies of the covered work 519 | conveyed by you (or copies made from those copies), or (b) primarily 520 | for and in connection with specific products or compilations that 521 | contain the covered work, unless you entered into that arrangement, 522 | or that patent license was granted, prior to 28 March 2007. 523 | 524 | Nothing in this License shall be construed as excluding or limiting 525 | any implied license or other defenses to infringement that may 526 | otherwise be available to you under applicable patent law. 527 | 528 | 12. No Surrender of Others' Freedom. 529 | 530 | If conditions are imposed on you (whether by court order, agreement or 531 | otherwise) that contradict the conditions of this License, they do not 532 | excuse you from the conditions of this License. If you cannot convey a 533 | covered work so as to satisfy simultaneously your obligations under this 534 | License and any other pertinent obligations, then as a consequence you may 535 | not convey it at all. For example, if you agree to terms that obligate you 536 | to collect a royalty for further conveying from those to whom you convey 537 | the Program, the only way you could satisfy both those terms and this 538 | License would be to refrain entirely from conveying the Program. 539 | 540 | 13. Remote Network Interaction; Use with the GNU General Public License. 541 | 542 | Notwithstanding any other provision of this License, if you modify the 543 | Program, your modified version must prominently offer all users 544 | interacting with it remotely through a computer network (if your version 545 | supports such interaction) an opportunity to receive the Corresponding 546 | Source of your version by providing access to the Corresponding Source 547 | from a network server at no charge, through some standard or customary 548 | means of facilitating copying of software. This Corresponding Source 549 | shall include the Corresponding Source for any work covered by version 3 550 | of the GNU General Public License that is incorporated pursuant to the 551 | following paragraph. 552 | 553 | Notwithstanding any other provision of this License, you have 554 | permission to link or combine any covered work with a work licensed 555 | under version 3 of the GNU General Public License into a single 556 | combined work, and to convey the resulting work. The terms of this 557 | License will continue to apply to the part which is the covered work, 558 | but the work with which it is combined will remain governed by version 559 | 3 of the GNU General Public License. 560 | 561 | 14. Revised Versions of this License. 562 | 563 | The Free Software Foundation may publish revised and/or new versions of 564 | the GNU Affero General Public License from time to time. Such new versions 565 | will be similar in spirit to the present version, but may differ in detail to 566 | address new problems or concerns. 567 | 568 | Each version is given a distinguishing version number. If the 569 | Program specifies that a certain numbered version of the GNU Affero General 570 | Public License "or any later version" applies to it, you have the 571 | option of following the terms and conditions either of that numbered 572 | version or of any later version published by the Free Software 573 | Foundation. If the Program does not specify a version number of the 574 | GNU Affero General Public License, you may choose any version ever published 575 | by the Free Software Foundation. 576 | 577 | If the Program specifies that a proxy can decide which future 578 | versions of the GNU Affero General Public License can be used, that proxy's 579 | public statement of acceptance of a version permanently authorizes you 580 | to choose that version for the Program. 581 | 582 | Later license versions may give you additional or different 583 | permissions. However, no additional obligations are imposed on any 584 | author or copyright holder as a result of your choosing to follow a 585 | later version. 586 | 587 | 15. Disclaimer of Warranty. 588 | 589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 597 | 598 | 16. Limitation of Liability. 599 | 600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 608 | SUCH DAMAGES. 609 | 610 | 17. Interpretation of Sections 15 and 16. 611 | 612 | If the disclaimer of warranty and limitation of liability provided 613 | above cannot be given local legal effect according to their terms, 614 | reviewing courts shall apply local law that most closely approximates 615 | an absolute waiver of all civil liability in connection with the 616 | Program, unless a warranty or assumption of liability accompanies a 617 | copy of the Program in return for a fee. 618 | 619 | END OF TERMS AND CONDITIONS 620 | 621 | How to Apply These Terms to Your New Programs 622 | 623 | If you develop a new program, and you want it to be of the greatest 624 | possible use to the public, the best way to achieve this is to make it 625 | free software which everyone can redistribute and change under these terms. 626 | 627 | To do so, attach the following notices to the program. It is safest 628 | to attach them to the start of each source file to most effectively 629 | state the exclusion of warranty; and each file should have at least 630 | the "copyright" line and a pointer to where the full notice is found. 631 | 632 | 633 | Copyright (C) 634 | 635 | This program is free software: you can redistribute it and/or modify 636 | it under the terms of the GNU Affero General Public License as published by 637 | the Free Software Foundation, either version 3 of the License, or 638 | (at your option) any later version. 639 | 640 | This program is distributed in the hope that it will be useful, 641 | but WITHOUT ANY WARRANTY; without even the implied warranty of 642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 643 | GNU Affero General Public License for more details. 644 | 645 | You should have received a copy of the GNU Affero General Public License 646 | along with this program. If not, see . 647 | 648 | Also add information on how to contact you by electronic and paper mail. 649 | 650 | If your software can interact with users remotely through a computer 651 | network, you should also make sure that it provides a way for users to 652 | get its source. For example, if your program is a web application, its 653 | interface could display a "Source" link that leads users to an archive 654 | of the code. There are many ways you could offer source, and different 655 | solutions will be better for different programs; see section 13 for the 656 | specific requirements. 657 | 658 | You should also get your employer (if you work as a programmer) or school, 659 | if any, to sign a "copyright disclaimer" for the program, if necessary. 660 | For more information on this, and how to apply and follow the GNU AGPL, see 661 | . 662 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | COMPANY_NAME ?= ONLYOFFICE 2 | GIT_BRANCH ?= develop 3 | PRODUCT_NAME ?= documentserver 4 | PRODUCT_EDITION ?= 5 | PRODUCT_VERSION ?= 0.0.0 6 | BUILD_NUMBER ?= 0 7 | BUILD_CHANNEL ?= nightly 8 | ONLYOFFICE_VALUE ?= onlyoffice 9 | 10 | COMPANY_NAME_LOW = $(shell echo $(COMPANY_NAME) | tr A-Z a-z) 11 | 12 | PACKAGE_NAME := $(COMPANY_NAME_LOW)-$(PRODUCT_NAME)$(PRODUCT_EDITION) 13 | PACKAGE_VERSION ?= $(PRODUCT_VERSION)-$(BUILD_NUMBER)~stretch 14 | PACKAGE_BASEURL ?= https://s3.eu-west-1.amazonaws.com/repo-doc-onlyoffice-com/server/linux/debian 15 | 16 | ifeq ($(BUILD_CHANNEL),$(filter $(BUILD_CHANNEL),nightly test)) 17 | DOCKER_TAG := $(PRODUCT_VERSION).$(BUILD_NUMBER) 18 | else 19 | DOCKER_TAG := $(PRODUCT_VERSION).$(BUILD_NUMBER)-$(subst /,-,$(GIT_BRANCH)) 20 | endif 21 | 22 | DOCKER_ORG ?= $(COMPANY_NAME_LOW) 23 | DOCKER_IMAGE := $(DOCKER_ORG)/4testing-$(PRODUCT_NAME)$(PRODUCT_EDITION) 24 | DOCKER_DUMMY := $(COMPANY_NAME_LOW)-$(PRODUCT_NAME)$(PRODUCT_EDITION)__$(DOCKER_TAG).dummy 25 | DOCKER_ARCH := $(COMPANY_NAME_LOW)-$(PRODUCT_NAME)_$(DOCKER_TAG).tar.gz 26 | 27 | .PHONY: all clean clean-docker image deploy docker 28 | 29 | $(DOCKER_DUMMY): 30 | docker pull ubuntu:22.04 31 | docker build \ 32 | --build-arg COMPANY_NAME=$(COMPANY_NAME_LOW) \ 33 | --build-arg PRODUCT_NAME=$(PRODUCT_NAME) \ 34 | --build-arg PRODUCT_EDITION=$(PRODUCT_EDITION) \ 35 | --build-arg PACKAGE_VERSION=$(PACKAGE_VERSION) \ 36 | --build-arg PACKAGE_BASEURL=$(PACKAGE_BASEURL) \ 37 | --build-arg TARGETARCH=amd64 \ 38 | --build-arg ONLYOFFICE_VALUE=$(ONLYOFFICE_VALUE) \ 39 | -t $(DOCKER_IMAGE):$(DOCKER_TAG) . && \ 40 | mkdir -p $$(dirname $@) && \ 41 | echo "Done" > $@ 42 | 43 | $(DOCKER_ARCH): $(DOCKER_DUMMY) 44 | docker save $(DOCKER_IMAGE):$(DOCKER_TAG) | \ 45 | gzip > $@ 46 | 47 | all: image 48 | 49 | clean: 50 | rm -rfv *.dummy *.tar.gz 51 | 52 | clean-docker: 53 | docker rmi -f $$(docker images -q $(COMPANY_NAME_LOW)/*) || exit 0 54 | 55 | image: $(DOCKER_DUMMY) 56 | 57 | deploy: $(DOCKER_DUMMY) 58 | for i in {1..3}; do \ 59 | docker push $(DOCKER_IMAGE):$(DOCKER_TAG) && break || sleep 1m; \ 60 | done 61 | ifeq ($(BUILD_CHANNEL),nightly) 62 | docker tag $(DOCKER_IMAGE):$(DOCKER_TAG) $(DOCKER_IMAGE):latest 63 | for i in {1..3}; do \ 64 | docker push $(DOCKER_IMAGE):latest && break || sleep 1m; \ 65 | done 66 | endif 67 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This build of onlyoffice community edition ( documentserver ) has connections limits increased to 9999 ( instead of default 20 ). 2 | All credits to www.btactic.com that made this blog post https://www.btactic.com/build-onlyoffice-from-source-code-2022/?lang=en# 3 | 4 | It is intended to be NOT production ready ( use at your own risk ). 5 | If you want a production ready release, contact Ascensio System https://www.onlyoffice.com/contacts.aspx and buy an Enterprise license to support development. 6 | 7 | 8 | 9 | * [Overview](#overview) 10 | * [Functionality](#functionality) 11 | * [Recommended System Requirements](#recommended-system-requirements) 12 | * [Running Docker Image](#running-docker-image) 13 | * [Configuring Docker Image](#configuring-docker-image) 14 | - [Storing Data](#storing-data) 15 | - [Running ONLYOFFICE Document Server on Different Port](#running-onlyoffice-document-server-on-different-port) 16 | - [Running ONLYOFFICE Document Server using HTTPS](#running-onlyoffice-document-server-using-https) 17 | + [Generation of Self Signed Certificates](#generation-of-self-signed-certificates) 18 | + [Strengthening the Server Security](#strengthening-the-server-security) 19 | + [Installation of the SSL Certificates](#installation-of-the-ssl-certificates) 20 | + [Available Configuration Parameters](#available-configuration-parameters) 21 | * [Installing ONLYOFFICE Document Server integrated with Community and Mail Servers](#installing-onlyoffice-document-server-integrated-with-community-and-mail-servers) 22 | * [ONLYOFFICE Document Server ipv6 setup](#onlyoffice-document-server-ipv6-setup) 23 | * [Issues](#issues) 24 | - [Docker Issues](#docker-issues) 25 | - [Document Server usage Issues](#document-server-usage-issues) 26 | * [Project Information](#project-information) 27 | * [User Feedback and Support](#user-feedback-and-support) 28 | 29 | ## Overview 30 | 31 | ONLYOFFICE Document Server is an online office suite comprising viewers and editors for texts, spreadsheets and presentations, fully compatible with Office Open XML formats: .docx, .xlsx, .pptx and enabling collaborative editing in real time. 32 | 33 | Starting from version 6.0, Document Server is distributed as ONLYOFFICE Docs. It has [three editions](https://github.com/ONLYOFFICE/DocumentServer#onlyoffice-document-server-editions). With this image, you will install the free Community version. 34 | 35 | ONLYOFFICE Docs can be used as a part of ONLYOFFICE Workspace or with third-party sync&share solutions (e.g. Nextcloud, ownCloud, Seafile) to enable collaborative editing within their interface. 36 | 37 | ***Important*** Please update `docker-engine` to latest version (`20.10.21` as of writing this doc) before using it. We use `ubuntu:22.04` as base image and it older versions of docker have compatibility problems with it 38 | 39 | ## Functionality ## 40 | * ONLYOFFICE Document Editor 41 | * ONLYOFFICE Spreadsheet Editor 42 | * ONLYOFFICE Presentation Editor 43 | * ONLYOFFICE Documents application for iOS 44 | * Collaborative editing 45 | * Hieroglyph support 46 | * Support for all the popular formats: DOC, DOCX, TXT, ODT, RTF, ODP, EPUB, ODS, XLS, XLSX, CSV, PPTX, HTML 47 | 48 | Integrating it with ONLYOFFICE Community Server you will be able to: 49 | * view and edit files stored on Drive, Box, Dropbox, OneDrive, OwnCloud connected to ONLYOFFICE; 50 | * share files; 51 | * embed documents on a website; 52 | * manage access rights to documents. 53 | 54 | ## Recommended System Requirements 55 | 56 | * **RAM**: 4 GB or more 57 | * **CPU**: dual-core 2 GHz or higher 58 | * **Swap**: at least 2 GB 59 | * **HDD**: at least 2 GB of free space 60 | * **Distribution**: 64-bit Red Hat, CentOS or other compatible distributive with kernel version 3.8 or later, 64-bit Debian, Ubuntu or other compatible distributive with kernel version 3.8 or later 61 | * **Docker**: version 1.9.0 or later 62 | 63 | ## Running Docker Image 64 | 65 | sudo docker run -i -t -d -p 80:80 onlyoffice/documentserver 66 | 67 | Use this command if you wish to install ONLYOFFICE Document Server separately. To install ONLYOFFICE Document Server integrated with Community and Mail Servers, refer to the corresponding instructions below. 68 | 69 | ## Configuring Docker Image 70 | 71 | ### Storing Data 72 | 73 | All the data are stored in the specially-designated directories, **data volumes**, at the following location: 74 | * **/var/log/onlyoffice** for ONLYOFFICE Document Server logs 75 | * **/var/www/onlyoffice/Data** for certificates 76 | * **/var/lib/onlyoffice** for file cache 77 | * **/var/lib/postgresql** for database 78 | 79 | To get access to your data from outside the container, you need to mount the volumes. It can be done by specifying the '-v' option in the docker run command. 80 | 81 | sudo docker run -i -t -d -p 80:80 \ 82 | -v /app/onlyoffice/DocumentServer/logs:/var/log/onlyoffice \ 83 | -v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data \ 84 | -v /app/onlyoffice/DocumentServer/lib:/var/lib/onlyoffice \ 85 | -v /app/onlyoffice/DocumentServer/rabbitmq:/var/lib/rabbitmq \ 86 | -v /app/onlyoffice/DocumentServer/redis:/var/lib/redis \ 87 | -v /app/onlyoffice/DocumentServer/db:/var/lib/postgresql onlyoffice/documentserver 88 | 89 | Normally, you do not need to store container data because the container's operation does not depend on its state. Saving data will be useful: 90 | * For easy access to container data, such as logs 91 | * To remove the limit on the size of the data inside the container 92 | * When using services launched outside the container such as PostgreSQL, Redis, RabbitMQ 93 | 94 | ### Running ONLYOFFICE Document Server on Different Port 95 | 96 | To change the port, use the -p command. E.g.: to make your portal accessible via port 8080 execute the following command: 97 | 98 | sudo docker run -i -t -d -p 8080:80 onlyoffice/documentserver 99 | 100 | ### Running ONLYOFFICE Document Server using HTTPS 101 | 102 | sudo docker run -i -t -d -p 443:443 \ 103 | -v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data onlyoffice/documentserver 104 | 105 | Access to the onlyoffice application can be secured using SSL so as to prevent unauthorized access. While a CA certified SSL certificate allows for verification of trust via the CA, a self signed certificates can also provide an equal level of trust verification as long as each client takes some additional steps to verify the identity of your website. Below the instructions on achieving this are provided. 106 | 107 | To secure the application via SSL basically two things are needed: 108 | 109 | - **Private key (.key)** 110 | - **SSL certificate (.crt)** 111 | 112 | So you need to create and install the following files: 113 | 114 | /app/onlyoffice/DocumentServer/data/certs/tls.key 115 | /app/onlyoffice/DocumentServer/data/certs/tls.crt 116 | 117 | When using CA certified certificates (e.g [Let's encrypt](https://letsencrypt.org)), these files are provided to you by the CA. If you are using self-signed certificates you need to generate these files [yourself](#generation-of-self-signed-certificates). 118 | 119 | #### Using the automatically generated Let's Encrypt SSL Certificates 120 | 121 | sudo docker run -i -t -d -p 80:80 -p 443:443 \ 122 | -e LETS_ENCRYPT_DOMAIN=your_domain -e LETS_ENCRYPT_MAIL=your_mail onlyoffice/documentserver 123 | 124 | If you want to get and extend Let's Encrypt SSL Certificates automatically just set LETS_ENCRYPT_DOMAIN and LETS_ENCRYPT_MAIL variables. 125 | 126 | #### Generation of Self Signed Certificates 127 | 128 | Generation of self-signed SSL certificates involves a simple 3 step procedure. 129 | 130 | **STEP 1**: Create the server private key 131 | 132 | ```bash 133 | openssl genrsa -out tls.key 2048 134 | ``` 135 | 136 | **STEP 2**: Create the certificate signing request (CSR) 137 | 138 | ```bash 139 | openssl req -new -key tls.key -out tls.csr 140 | ``` 141 | 142 | **STEP 3**: Sign the certificate using the private key and CSR 143 | 144 | ```bash 145 | openssl x509 -req -days 365 -in tls.csr -signkey tls.key -out tls.crt 146 | ``` 147 | 148 | You have now generated an SSL certificate that's valid for 365 days. 149 | 150 | #### Strengthening the server security 151 | 152 | This section provides you with instructions to [strengthen your server security](https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html). 153 | To achieve this you need to generate stronger DHE parameters. 154 | 155 | ```bash 156 | openssl dhparam -out dhparam.pem 2048 157 | ``` 158 | 159 | #### Installation of the SSL Certificates 160 | 161 | Out of the four files generated above, you need to install the `tls.key`, `tls.crt` and `dhparam.pem` files at the onlyoffice server. The CSR file is not needed, but do make sure you safely backup the file (in case you ever need it again). 162 | 163 | The default path that the onlyoffice application is configured to look for the SSL certificates is at `/var/www/onlyoffice/Data/certs`, this can however be changed using the `SSL_KEY_PATH`, `SSL_CERTIFICATE_PATH` and `SSL_DHPARAM_PATH` configuration options. 164 | 165 | The `/var/www/onlyoffice/Data/` path is the path of the data store, which means that you have to create a folder named certs inside `/app/onlyoffice/DocumentServer/data/` and copy the files into it and as a measure of security you will update the permission on the `tls.key` file to only be readable by the owner. 166 | 167 | ```bash 168 | mkdir -p /app/onlyoffice/DocumentServer/data/certs 169 | cp tls.key /app/onlyoffice/DocumentServer/data/certs/ 170 | cp tls.crt /app/onlyoffice/DocumentServer/data/certs/ 171 | cp dhparam.pem /app/onlyoffice/DocumentServer/data/certs/ 172 | chmod 400 /app/onlyoffice/DocumentServer/data/certs/tls.key 173 | ``` 174 | 175 | You are now just one step away from having our application secured. 176 | 177 | #### Available Configuration Parameters 178 | 179 | *Please refer the docker run command options for the `--env-file` flag where you can specify all required environment variables in a single file. This will save you from writing a potentially long docker run command.* 180 | 181 | Below is the complete list of parameters that can be set using environment variables. 182 | 183 | - **ONLYOFFICE_HTTPS_HSTS_ENABLED**: Advanced configuration option for turning off the HSTS configuration. Applicable only when SSL is in use. Defaults to `true`. 184 | - **ONLYOFFICE_HTTPS_HSTS_MAXAGE**: Advanced configuration option for setting the HSTS max-age in the onlyoffice nginx vHost configuration. Applicable only when SSL is in use. Defaults to `31536000`. 185 | - **SSL_CERTIFICATE_PATH**: The path to the SSL certificate to use. Defaults to `/var/www/onlyoffice/Data/certs/tls.crt`. 186 | - **SSL_KEY_PATH**: The path to the SSL certificate's private key. Defaults to `/var/www/onlyoffice/Data/certs/tls.key`. 187 | - **SSL_DHPARAM_PATH**: The path to the Diffie-Hellman parameter. Defaults to `/var/www/onlyoffice/Data/certs/dhparam.pem`. 188 | - **SSL_VERIFY_CLIENT**: Enable verification of client certificates using the `CA_CERTIFICATES_PATH` file. Defaults to `false` 189 | - **NODE_EXTRA_CA_CERTS**: The [NODE_EXTRA_CA_CERTS](https://nodejs.org/api/cli.html#node_extra_ca_certsfile "Node.js documentation") to extend CAs with the extra certificates for Node.js. Defaults to `/var/www/onlyoffice/Data/certs/extra-ca-certs.pem`. 190 | - **DB_TYPE**: The database type. Supported values are `postgres`, `mariadb`, `mysql`, `mssql` or `oracle`. Defaults to `postgres`. 191 | - **DB_HOST**: The IP address or the name of the host where the database server is running. 192 | - **DB_PORT**: The database server port number. 193 | - **DB_NAME**: The name of a database to use. Should be existing on container startup. 194 | - **DB_USER**: The new user name with superuser permissions for the database account. 195 | - **DB_PWD**: The password set for the database account. 196 | - **AMQP_URI**: The [AMQP URI](https://www.rabbitmq.com/uri-spec.html "RabbitMQ URI Specification") to connect to message broker server. 197 | - **AMQP_TYPE**: The message broker type. Supported values are `rabbitmq` or `activemq`. Defaults to `rabbitmq`. 198 | - **REDIS_SERVER_HOST**: The IP address or the name of the host where the Redis server is running. 199 | - **REDIS_SERVER_PORT**: The Redis server port number. 200 | - **REDIS_SERVER_PASS**: The Redis server password. The password is not set by default. 201 | - **NGINX_WORKER_PROCESSES**: Defines the number of nginx worker processes. 202 | - **NGINX_WORKER_CONNECTIONS**: Sets the maximum number of simultaneous connections that can be opened by a nginx worker process. 203 | - **SECURE_LINK_SECRET**: Defines secret for the nginx config directive [secure_link_md5](https://nginx.org/en/docs/http/ngx_http_secure_link_module.html#secure_link_md5). Defaults to `random string`. 204 | - **JWT_ENABLED**: Specifies the enabling the JSON Web Token validation by the ONLYOFFICE Document Server. Defaults to `true`. 205 | - **JWT_SECRET**: Defines the secret key to validate the JSON Web Token in the request to the ONLYOFFICE Document Server. Defaults to random value. 206 | - **JWT_HEADER**: Defines the http header that will be used to send the JSON Web Token. Defaults to `Authorization`. 207 | - **JWT_IN_BODY**: Specifies the enabling the token validation in the request body to the ONLYOFFICE Document Server. Defaults to `false`. 208 | - **WOPI_ENABLED**: Specifies the enabling the wopi handlers. Defaults to `false`. 209 | - **ALLOW_META_IP_ADDRESS**: Defines if it is allowed to connect meta IP address or not. Defaults to `false`. 210 | - **ALLOW_PRIVATE_IP_ADDRESS**: Defines if it is allowed to connect private IP address or not. Defaults to `false`. 211 | - **USE_UNAUTHORIZED_STORAGE**: Set to `true`if using selfsigned certificates for your storage server e.g. Nextcloud. Defaults to `false` 212 | - **GENERATE_FONTS**: When 'true' regenerates fonts list and the fonts thumbnails etc. at each start. Defaults to `true` 213 | - **METRICS_ENABLED**: Specifies the enabling StatsD for ONLYOFFICE Document Server. Defaults to `false`. 214 | - **METRICS_HOST**: Defines StatsD listening host. Defaults to `localhost`. 215 | - **METRICS_PORT**: Defines StatsD listening port. Defaults to `8125`. 216 | - **METRICS_PREFIX**: Defines StatsD metrics prefix for backend services. Defaults to `ds.`. 217 | - **LETS_ENCRYPT_DOMAIN**: Defines the domain for Let's Encrypt certificate. 218 | - **LETS_ENCRYPT_MAIL**: Defines the domain administator mail address for Let's Encrypt certificate. 219 | - **PLUGINS_ENABLED**: Defines whether to enable default plugins. Defaults to `true`. 220 | 221 | ## Installing ONLYOFFICE Document Server integrated with Community and Mail Servers 222 | 223 | ONLYOFFICE Document Server is a part of ONLYOFFICE Community Edition that comprises also Community Server and Mail Server. To install them, follow these easy steps: 224 | 225 | **STEP 1**: Create the `onlyoffice` network. 226 | 227 | ```bash 228 | docker network create --driver bridge onlyoffice 229 | ``` 230 | Then launch containers on it using the 'docker run --net onlyoffice' option: 231 | 232 | **STEP 2**: Install MySQL. 233 | 234 | Follow [these steps](#installing-mysql) to install MySQL server. 235 | 236 | **STEP 3**: Generate JWT Secret 237 | 238 | JWT secret defines the secret key to validate the JSON Web Token in the request to the **ONLYOFFICE Document Server**. You can specify it yourself or easily get it using the command: 239 | ``` 240 | JWT_SECRET=$(cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 12); 241 | ``` 242 | 243 | **STEP 4**: Install ONLYOFFICE Document Server. 244 | 245 | ```bash 246 | sudo docker run --net onlyoffice -i -t -d --restart=always --name onlyoffice-document-server \ 247 | -e JWT_ENABLED=true \ 248 | -e JWT_SECRET=${JWT_SECRET} \ 249 | -e JWT_HEADER=AuthorizationJwt \ 250 | -v /app/onlyoffice/DocumentServer/logs:/var/log/onlyoffice \ 251 | -v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data \ 252 | -v /app/onlyoffice/DocumentServer/lib:/var/lib/onlyoffice \ 253 | -v /app/onlyoffice/DocumentServer/db:/var/lib/postgresql \ 254 | onlyoffice/documentserver 255 | ``` 256 | 257 | **STEP 5**: Install ONLYOFFICE Mail Server. 258 | 259 | For the mail server correct work you need to specify its hostname 'yourdomain.com'. 260 | 261 | ```bash 262 | sudo docker run --init --net onlyoffice --privileged -i -t -d --restart=always --name onlyoffice-mail-server -p 25:25 -p 143:143 -p 587:587 \ 263 | -e MYSQL_SERVER=onlyoffice-mysql-server \ 264 | -e MYSQL_SERVER_PORT=3306 \ 265 | -e MYSQL_ROOT_USER=root \ 266 | -e MYSQL_ROOT_PASSWD=my-secret-pw \ 267 | -e MYSQL_SERVER_DB_NAME=onlyoffice_mailserver \ 268 | -v /app/onlyoffice/MailServer/data:/var/vmail \ 269 | -v /app/onlyoffice/MailServer/data/certs:/etc/pki/tls/mailserver \ 270 | -v /app/onlyoffice/MailServer/logs:/var/log \ 271 | -h yourdomain.com \ 272 | onlyoffice/mailserver 273 | ``` 274 | 275 | The additional parameters for mail server are available [here](https://github.com/ONLYOFFICE/Docker-CommunityServer/blob/master/docker-compose.workspace_enterprise.yml#L87). 276 | 277 | To learn more, refer to the [ONLYOFFICE Mail Server documentation](https://github.com/ONLYOFFICE/Docker-MailServer "ONLYOFFICE Mail Server documentation"). 278 | 279 | **STEP 6**: Install ONLYOFFICE Community Server 280 | 281 | ```bash 282 | sudo docker run --net onlyoffice -i -t -d --privileged --restart=always --name onlyoffice-community-server -p 80:80 -p 443:443 -p 5222:5222 --cgroupns=host \ 283 | -e MYSQL_SERVER_ROOT_PASSWORD=my-secret-pw \ 284 | -e MYSQL_SERVER_DB_NAME=onlyoffice \ 285 | -e MYSQL_SERVER_HOST=onlyoffice-mysql-server \ 286 | -e MYSQL_SERVER_USER=onlyoffice_user \ 287 | -e MYSQL_SERVER_PASS=onlyoffice_pass \ 288 | 289 | -e DOCUMENT_SERVER_PORT_80_TCP_ADDR=onlyoffice-document-server \ 290 | -e DOCUMENT_SERVER_JWT_ENABLED=true \ 291 | -e DOCUMENT_SERVER_JWT_SECRET=${JWT_SECRET} \ 292 | -e DOCUMENT_SERVER_JWT_HEADER=AuthorizationJwt \ 293 | 294 | -e MAIL_SERVER_API_HOST=${MAIL_SERVER_IP} \ 295 | -e MAIL_SERVER_DB_HOST=onlyoffice-mysql-server \ 296 | -e MAIL_SERVER_DB_NAME=onlyoffice_mailserver \ 297 | -e MAIL_SERVER_DB_PORT=3306 \ 298 | -e MAIL_SERVER_DB_USER=root \ 299 | -e MAIL_SERVER_DB_PASS=my-secret-pw \ 300 | 301 | -v /app/onlyoffice/CommunityServer/data:/var/www/onlyoffice/Data \ 302 | -v /app/onlyoffice/CommunityServer/logs:/var/log/onlyoffice \ 303 | -v /app/onlyoffice/CommunityServer/letsencrypt:/etc/letsencrypt \ 304 | -v /sys/fs/cgroup:/sys/fs/cgroup:rw \ 305 | onlyoffice/communityserver 306 | ``` 307 | 308 | Where `${MAIL_SERVER_IP}` is the IP address for **ONLYOFFICE Mail Server**. You can easily get it using the command: 309 | ``` 310 | MAIL_SERVER_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' onlyoffice-mail-server) 311 | ``` 312 | 313 | Alternatively, you can use an automatic installation script to install the whole ONLYOFFICE Community Edition at once. For the mail server correct work you need to specify its hostname 'yourdomain.com'. 314 | 315 | **STEP 1**: Download the Community Edition Docker script file 316 | 317 | ```bash 318 | wget https://download.onlyoffice.com/install/opensource-install.sh 319 | ``` 320 | 321 | **STEP 2**: Install ONLYOFFICE Community Edition executing the following command: 322 | 323 | ```bash 324 | bash opensource-install.sh -md yourdomain.com 325 | ``` 326 | 327 | Or, use [docker-compose](https://docs.docker.com/compose/install "docker-compose"). For the mail server correct work you need to specify its hostname 'yourdomain.com'. Assuming you have docker-compose installed, execute the following command: 328 | 329 | ```bash 330 | wget https://raw.githubusercontent.com/ONLYOFFICE/Docker-CommunityServer/master/docker-compose.groups.yml 331 | docker-compose up -d 332 | ``` 333 | 334 | ## ONLYOFFICE Document Server ipv6 setup 335 | 336 | (Works and is supported only for Linux hosts) 337 | 338 | Docker does not currently provide ipv6 addresses to containers by default. This function is experimental now. 339 | 340 | To set up interaction via ipv6, you need to enable support for this feature in your Docker. For this you need: 341 | - create the `/etc/docker/daemon.json` file with the following content: 342 | 343 | ``` 344 | { 345 | "ipv6": true, 346 | "fixed-cidr-v6": "2001:db8:abc1::/64" 347 | } 348 | ``` 349 | - restart docker with the following command: `systemctl restart docker` 350 | 351 | After that, all running containers receive an ipv6 address and have an inet6 interface. 352 | 353 | You can check your default bridge network and see the field there 354 | `EnableIPv6=true`. A new ipv6 subnet will also be added. 355 | 356 | For more information, visit the official [Docker manual site](https://docs.docker.com/config/daemon/ipv6/) 357 | 358 | ## Issues 359 | 360 | ### Docker Issues 361 | 362 | As a relatively new project Docker is being worked on and actively developed by its community. So it's recommended to use the latest version of Docker, because the issues that you encounter might have already been fixed with a newer Docker release. 363 | 364 | The known Docker issue with ONLYOFFICE Document Server with rpm-based distributives is that sometimes the processes fail to start inside Docker container. Fedora and RHEL/CentOS users should try disabling selinux with setenforce 0. If it fixes the issue then you can either stick with SELinux disabled which is not recommended by RedHat, or switch to using Ubuntu. 365 | 366 | ### Document Server usage issues 367 | 368 | Due to the operational characteristic, **Document Server** saves a document only after the document has been closed by all the users who edited it. To avoid data loss, you must forcefully disconnect the **Document Server** users when you need to stop **Document Server** in cases of the application update, server reboot etc. To do that, execute the following script on the server where **Document Server** is installed: 369 | 370 | ``` 371 | sudo docker exec documentserver-prepare4shutdown.sh 372 | ``` 373 | 374 | Please note, that both executing the script and disconnecting users may take a long time (up to 5 minutes). 375 | 376 | ## Project Information 377 | 378 | Official website: [https://www.onlyoffice.com](https://www.onlyoffice.com/?utm_source=github&utm_medium=cpc&utm_campaign=GitHubDockerDS) 379 | 380 | Code repository: [https://github.com/ONLYOFFICE/DocumentServer](https://github.com/ONLYOFFICE/DocumentServer "https://github.com/ONLYOFFICE/DocumentServer") 381 | 382 | Docker Image: [https://github.com/ONLYOFFICE/Docker-DocumentServer](https://github.com/ONLYOFFICE/Docker-DocumentServer "https://github.com/ONLYOFFICE/Docker-DocumentServer") 383 | 384 | License: [GNU AGPL v3.0](https://help.onlyoffice.com/products/files/doceditor.aspx?fileid=4358397&doc=K0ZUdlVuQzQ0RFhhMzhZRVN4ZFIvaHlhUjN2eS9XMXpKR1M5WEppUk1Gcz0_IjQzNTgzOTci0 "GNU AGPL v3.0") 385 | 386 | Free version vs commercial builds comparison: https://github.com/ONLYOFFICE/DocumentServer#onlyoffice-document-server-editions 387 | 388 | SaaS version: [https://www.onlyoffice.com/cloud-office.aspx](https://www.onlyoffice.com/cloud-office.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubDockerDS) 389 | 390 | ## User Feedback and Support 391 | 392 | If you have any problems with or questions about this image, please visit our official forum to find answers to your questions: [forum.onlyoffice.com][1] or you can ask and answer ONLYOFFICE development questions on [Stack Overflow][2]. 393 | 394 | [1]: https://forum.onlyoffice.com 395 | [2]: https://stackoverflow.com/questions/tagged/onlyoffice 396 | -------------------------------------------------------------------------------- /config/supervisor/ds/ds-converter.conf: -------------------------------------------------------------------------------- 1 | [program:converter] 2 | command=/var/www/COMPANY_NAME/documentserver/server/FileConverter/converter 3 | directory=/var/www/COMPANY_NAME/documentserver/server/FileConverter 4 | user=ds 5 | environment=NODE_ENV=production-linux,NODE_CONFIG_DIR=/etc/COMPANY_NAME/documentserver,NODE_DISABLE_COLORS=1,APPLICATION_NAME=COMPANY_NAME,LD_LIBRARY_PATH=/var/www/COMPANY_NAME/documentserver/server/FileConverter/bin 6 | stdout_logfile=/var/log/COMPANY_NAME/documentserver/converter/out.log 7 | stdout_logfile_backups=0 8 | stdout_logfile_maxbytes=0 9 | stderr_logfile=/var/log/COMPANY_NAME/documentserver/converter/err.log 10 | stderr_logfile_backups=0 11 | stderr_logfile_maxbytes=0 12 | autostart=true 13 | autorestart=true 14 | -------------------------------------------------------------------------------- /config/supervisor/ds/ds-docservice.conf: -------------------------------------------------------------------------------- 1 | [program:docservice] 2 | command=/var/www/COMPANY_NAME/documentserver/server/DocService/docservice 3 | directory=/var/www/COMPANY_NAME/documentserver/server/DocService 4 | user=ds 5 | environment=NODE_ENV=production-linux,NODE_CONFIG_DIR=/etc/COMPANY_NAME/documentserver,NODE_DISABLE_COLORS=1,APPLICATION_NAME=COMPANY_NAME 6 | stdout_logfile=/var/log/COMPANY_NAME/documentserver/docservice/out.log 7 | stdout_logfile_backups=0 8 | stdout_logfile_maxbytes=0 9 | stderr_logfile=/var/log/COMPANY_NAME/documentserver/docservice/err.log 10 | stderr_logfile_backups=0 11 | stderr_logfile_maxbytes=0 12 | autostart=true 13 | autorestart=true 14 | -------------------------------------------------------------------------------- /config/supervisor/ds/ds-example.conf: -------------------------------------------------------------------------------- 1 | [program:example] 2 | command=/var/www/COMPANY_NAME/documentserver-example/example 3 | directory=/var/www/COMPANY_NAME/documentserver-example/ 4 | user=ds 5 | environment=NODE_ENV=production-linux,NODE_CONFIG_DIR=/etc/COMPANY_NAME/documentserver-example,NODE_DISABLE_COLORS=1 6 | stdout_logfile=/var/log/COMPANY_NAME/documentserver-example/out.log 7 | stdout_logfile_backups=0 8 | stdout_logfile_maxbytes=0 9 | stderr_logfile=/var/log/COMPANY_NAME/documentserver-example/err.log 10 | stderr_logfile_backups=0 11 | stderr_logfile_maxbytes=0 12 | autostart=false 13 | autorestart=true 14 | redirect_stderr=true 15 | -------------------------------------------------------------------------------- /config/supervisor/ds/ds-metrics.conf: -------------------------------------------------------------------------------- 1 | [program:metrics] 2 | command=/var/www/COMPANY_NAME/documentserver/server/Metrics/metrics ./config/config.js 3 | directory=/var/www/COMPANY_NAME/documentserver/server/Metrics 4 | user=ds 5 | environment=NODE_DISABLE_COLORS=1 6 | stdout_logfile=/var/log/COMPANY_NAME/documentserver/metrics/out.log 7 | stdout_logfile_backups=0 8 | stdout_logfile_maxbytes=0 9 | stderr_logfile=/var/log/COMPANY_NAME/documentserver/metrics/err.log 10 | stderr_logfile_backups=0 11 | stderr_logfile_maxbytes=0 12 | autostart=false 13 | autorestart=false 14 | -------------------------------------------------------------------------------- /config/supervisor/ds/ds.conf: -------------------------------------------------------------------------------- 1 | [group:ds] 2 | programs=docservice,converter,metrics,example 3 | -------------------------------------------------------------------------------- /config/supervisor/supervisor: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # 3 | # skeleton example file to build /etc/init.d/ scripts. 4 | # This file should be used to construct scripts for /etc/init.d. 5 | # 6 | # Written by Miquel van Smoorenburg . 7 | # Modified for Debian 8 | # by Ian Murdock . 9 | # Further changes by Javier Fernandez-Sanguino 10 | # 11 | # Version: @(#)skeleton 1.9 26-Feb-2001 miquels@cistron.nl 12 | # 13 | ### BEGIN INIT INFO 14 | # Provides: supervisor 15 | # Required-Start: $remote_fs $network $named 16 | # Required-Stop: $remote_fs $network $named 17 | # Default-Start: 2 3 4 5 18 | # Default-Stop: 0 1 6 19 | # Short-Description: Start/stop supervisor 20 | # Description: Start/stop supervisor daemon and its configured 21 | # subprocesses. 22 | ### END INIT INFO 23 | 24 | . /lib/lsb/init-functions 25 | 26 | PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin 27 | DAEMON=/usr/bin/supervisord 28 | NAME=supervisord 29 | DESC=supervisor 30 | 31 | test -x $DAEMON || exit 0 32 | 33 | LOGDIR=/var/log/supervisor 34 | PIDFILE=/var/run/$NAME.pid 35 | PS_COUNT=0 36 | DODTIME=5 # Time to wait for the server to die, in seconds 37 | # If this value is set too low you might not 38 | # let some servers to die gracefully and 39 | # 'restart' will not work 40 | 41 | # Include supervisor defaults if available 42 | if [ -f /etc/default/supervisor ] ; then 43 | . /etc/default/supervisor 44 | fi 45 | DAEMON_OPTS="-c /etc/supervisor/supervisord.conf $DAEMON_OPTS" 46 | 47 | set -e 48 | 49 | running_pid() 50 | { 51 | # Check if a given process pid's cmdline matches a given name 52 | pid=$1 53 | name=$2 54 | [ -z "$pid" ] && return 1 55 | [ ! -d /proc/$pid ] && return 1 56 | (cat /proc/$pid/cmdline | tr "\000" "\n"|grep -q $name) || return 1 57 | return 0 58 | } 59 | 60 | running() 61 | { 62 | # Check if the process is running looking at /proc 63 | # (works for all users) 64 | 65 | # No pidfile, probably no daemon present 66 | [ ! -f "$PIDFILE" ] && return 1 67 | # Obtain the pid and check it against the binary name 68 | pid=`cat $PIDFILE` 69 | running_pid $pid $DAEMON || return 1 70 | return 0 71 | } 72 | 73 | force_stop() { 74 | # Forcefully kill the process 75 | [ ! -f "$PIDFILE" ] && return 76 | if running ; then 77 | kill -15 $pid 78 | # Is it really dead? 79 | [ -n "$DODTIME" ] && sleep "$DODTIME"s 80 | if running ; then 81 | kill -9 $pid 82 | [ -n "$DODTIME" ] && sleep "$DODTIME"s 83 | if running ; then 84 | echo "Cannot kill $LABEL (pid=$pid)!" 85 | exit 1 86 | fi 87 | fi 88 | fi 89 | rm -f $PIDFILE 90 | return 0 91 | } 92 | 93 | get_pid() { 94 | PS_COUNT=$(pgrep -fc $DAEMON || true) 95 | } 96 | 97 | case "$1" in 98 | start) 99 | get_pid 100 | if [ $PS_COUNT -eq 0 ]; then 101 | rm -f "$PIDFILE" 102 | fi 103 | echo -n "Starting $DESC: " 104 | start-stop-daemon --start --quiet --pidfile $PIDFILE \ 105 | --startas $DAEMON -- $DAEMON_OPTS 106 | test -f $PIDFILE || sleep 1 107 | if running ; then 108 | echo "$NAME." 109 | else 110 | echo " ERROR." 111 | fi 112 | ;; 113 | stop) 114 | echo -n "Stopping $DESC: " 115 | start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE 116 | echo "$NAME." 117 | ;; 118 | force-stop) 119 | echo -n "Forcefully stopping $DESC: " 120 | force_stop 121 | if ! running ; then 122 | echo "$NAME." 123 | else 124 | echo " ERROR." 125 | fi 126 | ;; 127 | #reload) 128 | # 129 | # If the daemon can reload its config files on the fly 130 | # for example by sending it SIGHUP, do it here. 131 | # 132 | # If the daemon responds to changes in its config file 133 | # directly anyway, make this a do-nothing entry. 134 | # 135 | # echo "Reloading $DESC configuration files." 136 | # start-stop-daemon --stop --signal 1 --quiet --pidfile \ 137 | # /var/run/$NAME.pid --exec $DAEMON 138 | #;; 139 | force-reload) 140 | # 141 | # If the "reload" option is implemented, move the "force-reload" 142 | # option to the "reload" entry above. If not, "force-reload" is 143 | # just the same as "restart" except that it does nothing if the 144 | # daemon isn't already running. 145 | # check wether $DAEMON is running. If so, restart 146 | start-stop-daemon --stop --test --quiet --pidfile $PIDFILE \ 147 | --startas $DAEMON \ 148 | && $0 restart \ 149 | || exit 0 150 | ;; 151 | restart) 152 | echo -n "Restarting $DESC: " 153 | start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE 154 | [ -n "$DODTIME" ] && sleep $DODTIME 155 | start-stop-daemon --start --quiet --pidfile $PIDFILE \ 156 | --startas $DAEMON -- $DAEMON_OPTS 157 | echo "$NAME." 158 | ;; 159 | status) 160 | echo -n "$LABEL is " 161 | if running ; then 162 | echo "running" 163 | else 164 | echo " not running." 165 | exit 1 166 | fi 167 | ;; 168 | *) 169 | N=/etc/init.d/$NAME 170 | # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 171 | echo "Usage: $N {start|stop|restart|force-reload|status|force-stop}" >&2 172 | exit 1 173 | ;; 174 | esac 175 | 176 | exit 0 177 | -------------------------------------------------------------------------------- /docker-bake.hcl: -------------------------------------------------------------------------------- 1 | variable "TAG" { 2 | default = "" 3 | } 4 | 5 | variable "SHORTER_TAG" { 6 | default = "" 7 | } 8 | 9 | variable "SHORTEST_TAG" { 10 | default = "" 11 | } 12 | 13 | variable "PULL_TAG" { 14 | default = "" 15 | } 16 | 17 | variable "COMPANY_NAME" { 18 | default = "" 19 | } 20 | 21 | variable "PREFIX_NAME" { 22 | default = "" 23 | } 24 | 25 | variable "PRODUCT_EDITION" { 26 | default = "" 27 | } 28 | 29 | variable "PRODUCT_NAME" { 30 | default = "" 31 | } 32 | 33 | variable "PACKAGE_VERSION" { 34 | default = "" 35 | } 36 | 37 | variable "DOCKERFILE" { 38 | default = "" 39 | } 40 | 41 | variable "PLATFORM" { 42 | default = "" 43 | } 44 | 45 | variable "PACKAGE_BASEURL" { 46 | default = "" 47 | } 48 | 49 | variable "PACKAGE_FILE" { 50 | default = "" 51 | } 52 | 53 | variable "BUILD_CHANNEL" { 54 | default = "" 55 | } 56 | 57 | variable "PUSH_MAJOR" { 58 | default = "false" 59 | } 60 | 61 | variable "LATEST" { 62 | default = "false" 63 | } 64 | 65 | ### ↓ Variables for UCS build ↓ 66 | 67 | variable "BASE_VERSION" { 68 | default = "" 69 | } 70 | 71 | variable "PACKAGE_SUFFIX" { 72 | default = "" 73 | } 74 | 75 | variable "PG_VERSION" { 76 | default = "" 77 | } 78 | 79 | variable "UCS_REBUILD" { 80 | default = "" 81 | } 82 | 83 | variable "UCS_PREFIX" { 84 | default = "" 85 | } 86 | 87 | ### ↑ Variables for UCS build ↑ 88 | 89 | target "documentserver" { 90 | target = "documentserver" 91 | dockerfile = "${DOCKERFILE}" 92 | tags = [ 93 | "docker.io/${COMPANY_NAME}/${PREFIX_NAME}${PRODUCT_NAME}${PRODUCT_EDITION}:${TAG}", 94 | equal("nightly",BUILD_CHANNEL) ? "docker.io/${COMPANY_NAME}/${PREFIX_NAME}${PRODUCT_NAME}${PRODUCT_EDITION}:latest": "", 95 | ] 96 | platforms = ["${PLATFORM}"] 97 | args = { 98 | "COMPANY_NAME": "${COMPANY_NAME}" 99 | "PRODUCT_NAME": "${PRODUCT_NAME}" 100 | "PRODUCT_EDITION": "${PRODUCT_EDITION}" 101 | "PACKAGE_VERSION": "${PACKAGE_VERSION}" 102 | "PACKAGE_BASEURL": "${PACKAGE_BASEURL}" 103 | "PLATFORM": "${PLATFORM}" 104 | } 105 | } 106 | 107 | target "documentserver-stable" { 108 | target = "documentserver-stable" 109 | dockerfile = "production.dockerfile" 110 | tags = ["docker.io/${COMPANY_NAME}/${PREFIX_NAME}${PRODUCT_NAME}${PRODUCT_EDITION}:${TAG}", 111 | "docker.io/${COMPANY_NAME}/${PREFIX_NAME}${PRODUCT_NAME}${PRODUCT_EDITION}:${SHORTER_TAG}", 112 | "docker.io/${COMPANY_NAME}/${PREFIX_NAME}${PRODUCT_NAME}${PRODUCT_EDITION}:${SHORTEST_TAG}", 113 | "docker.io/${COMPANY_NAME}/${PREFIX_NAME}${PRODUCT_NAME}${PRODUCT_EDITION}:latest", 114 | equal("-ee",PRODUCT_EDITION) ? "docker.io/${COMPANY_NAME}4enterprise/${PREFIX_NAME}${PRODUCT_NAME}${PRODUCT_EDITION}:${TAG}": "",] 115 | platforms = ["linux/amd64", "linux/arm64"] 116 | args = { 117 | "PULL_TAG": "${PULL_TAG}" 118 | "COMPANY_NAME": "${COMPANY_NAME}" 119 | "PRODUCT_NAME": "${PRODUCT_NAME}" 120 | "PRODUCT_EDITION": "${PRODUCT_EDITION}" 121 | } 122 | } 123 | 124 | target "documentserver-ucs" { 125 | target = "documentserver" 126 | dockerfile = "${DOCKERFILE}" 127 | tags = [ 128 | "docker.io/${COMPANY_NAME}/${PRODUCT_NAME}${PRODUCT_EDITION}-ucs:${TAG}" 129 | ] 130 | platforms = ["linux/amd64", "linux/arm64"] 131 | args = { 132 | "PRODUCT_EDITION": "${PRODUCT_EDITION}" 133 | "PRODUCT_NAME": "${PRODUCT_NAME}" 134 | "COMPANY_NAME": "${COMPANY_NAME}" 135 | "PACKAGE_VERSION": "${PACKAGE_VERSION}" 136 | "PACKAGE_BASEURL": "${PACKAGE_BASEURL}" 137 | "PACKAGE_SUFFIX": "${PACKAGE_SUFFIX}" 138 | "BASE_VERSION": "${BASE_VERSION}" 139 | "PG_VERSION": "${PG_VERSION}" 140 | } 141 | } 142 | 143 | target "documentserver-nonexample" { 144 | target = "documentserver-nonexample" 145 | dockerfile = "production.dockerfile" 146 | tags = [ "docker.io/${COMPANY_NAME}/${PRODUCT_NAME}${PREFIX_NAME}${PRODUCT_EDITION}:${TAG}-nonexample" ] 147 | platforms = ["linux/amd64", "linux/arm64"] 148 | args = { 149 | "PULL_TAG": "${PULL_TAG}" 150 | "COMPANY_NAME": "${COMPANY_NAME}" 151 | "PRODUCT_NAME": "${PRODUCT_NAME}" 152 | "PRODUCT_EDITION": "${PRODUCT_EDITION}" 153 | } 154 | } 155 | 156 | target "documentserver-stable-rebuild" { 157 | target = "documentserver-stable-rebuild" 158 | dockerfile = "production.dockerfile" 159 | tags = equal("true",UCS_REBUILD) ? ["docker.io/${COMPANY_NAME}/${PREFIX_NAME}${PRODUCT_NAME}${PRODUCT_EDITION}-ucs:${TAG}",] : [ 160 | "docker.io/${COMPANY_NAME}/${PREFIX_NAME}${PRODUCT_NAME}${PRODUCT_EDITION}:${TAG}", 161 | equal("",PREFIX_NAME) ? "docker.io/${COMPANY_NAME}/${PREFIX_NAME}${PRODUCT_NAME}${PRODUCT_EDITION}:${SHORTER_TAG}": "", 162 | equal("true",PUSH_MAJOR) ? "docker.io/${COMPANY_NAME}/${PREFIX_NAME}${PRODUCT_NAME}${PRODUCT_EDITION}:${SHORTEST_TAG}": "", 163 | equal("",PREFIX_NAME) && equal("true",LATEST) ? "docker.io/${COMPANY_NAME}/${PREFIX_NAME}${PRODUCT_NAME}${PRODUCT_EDITION}:latest": "", 164 | equal("-ee",PRODUCT_EDITION) && equal("",PREFIX_NAME) ? "docker.io/${COMPANY_NAME}4enterprise/${PREFIX_NAME}${PRODUCT_NAME}${PRODUCT_EDITION}:${TAG}": "", 165 | ] 166 | platforms = ["linux/amd64", "linux/arm64"] 167 | args = { 168 | "UCS_PREFIX": "${UCS_PREFIX}" 169 | "PULL_TAG": "${PULL_TAG}" 170 | "COMPANY_NAME": "${COMPANY_NAME}" 171 | "PRODUCT_NAME": "${PRODUCT_NAME}" 172 | "PRODUCT_EDITION": "${PRODUCT_EDITION}" 173 | } 174 | } 175 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | onlyoffice-documentserver: 3 | build: 4 | context: . 5 | container_name: onlyoffice-documentserver 6 | depends_on: 7 | - onlyoffice-postgresql 8 | - onlyoffice-rabbitmq 9 | environment: 10 | - DB_TYPE=postgres 11 | - DB_HOST=onlyoffice-postgresql 12 | - DB_PORT=5432 13 | - DB_NAME=onlyoffice 14 | - DB_USER=onlyoffice 15 | - AMQP_URI=amqp://guest:guest@onlyoffice-rabbitmq 16 | # Uncomment strings below to enable the JSON Web Token validation. 17 | #- JWT_ENABLED=true 18 | #- JWT_SECRET=secret 19 | #- JWT_HEADER=Authorization 20 | #- JWT_IN_BODY=true 21 | ports: 22 | - '80:80' 23 | - '443:443' 24 | stdin_open: true 25 | restart: always 26 | stop_grace_period: 60s 27 | volumes: 28 | - /var/www/onlyoffice/Data 29 | - /var/log/onlyoffice 30 | - /var/lib/onlyoffice/documentserver/App_Data/cache/files 31 | - /var/www/onlyoffice/documentserver-example/public/files 32 | - /usr/share/fonts 33 | 34 | onlyoffice-rabbitmq: 35 | container_name: onlyoffice-rabbitmq 36 | image: rabbitmq 37 | restart: always 38 | expose: 39 | - '5672' 40 | 41 | onlyoffice-postgresql: 42 | container_name: onlyoffice-postgresql 43 | image: postgres:12 44 | environment: 45 | - POSTGRES_DB=onlyoffice 46 | - POSTGRES_USER=onlyoffice 47 | - POSTGRES_HOST_AUTH_METHOD=trust 48 | restart: always 49 | expose: 50 | - '5432' 51 | volumes: 52 | - postgresql_data:/var/lib/postgresql 53 | 54 | volumes: 55 | postgresql_data: 56 | -------------------------------------------------------------------------------- /oracle/sqlplus: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | CLIENTDIR=/usr/share/instantclient 4 | export LD_LIBRARY_PATH=$CLIENTDIR 5 | $CLIENTDIR/sqlplus $@ 6 | 7 | -------------------------------------------------------------------------------- /production.dockerfile: -------------------------------------------------------------------------------- 1 | ### Arguments avavlivable only for FROM instruction ### 2 | ARG PULL_TAG=latest 3 | ARG COMPANY_NAME=onlyoffice 4 | ARG PRODUCT_EDITION= 5 | ### Rebuild arguments 6 | ARG UCS_PREFIX= 7 | ARG IMAGE=${COMPANY_NAME}/documentserver${PRODUCT_EDITION}${UCS_PREFIX}:${PULL_TAG} 8 | 9 | ### Build main-release ### 10 | 11 | FROM ${COMPANY_NAME}/4testing-documentserver${PRODUCT_EDITION}:${PULL_TAG} as documentserver-stable 12 | 13 | ### Rebuild stable images with secure updates 14 | FROM ${IMAGE} as documentserver-stable-rebuild 15 | RUN echo "This is rebuild" \ 16 | && apt-get update -y \ 17 | && apt-get upgrade -y 18 | 19 | ### Build nonexample ### 20 | 21 | FROM ${COMPANY_NAME}/documentserver${PRODUCT_EDITION}:${PULL_TAG} as documentserver-nonexample 22 | 23 | ARG COMPANY_NAME=onlyoffice 24 | ARG PRODUCT_NAME=documentserver 25 | ARG DS_SUPERVISOR_CONF=/etc/supervisor/conf.d/ds.conf 26 | 27 | ### Remove all documentserver-example data ### 28 | 29 | RUN rm -rf /var/www/$COMPANY_NAME/$PRODUCT_NAME-example \ 30 | && rm -rf /etc/$COMPANY_NAME/$PRODUCT_NAME-example \ 31 | && rm -f $DS_SUPERVISOR_CONF \ 32 | && rm -f /etc/nginx/includes/ds-example.conf \ 33 | && ln -s /etc/$COMPANY_NAME/$PRODUCT_NAME/supervisor/ds.conf $DS_SUPERVISOR_CONF 34 | -------------------------------------------------------------------------------- /run-document-server.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #### /bin/bash -c "sed -i 's/isSupportEditFeature=function(){return!1}/isSupportEditFeature=function(){return 1}/g' /var/www/onlyoffice/documentserver/web-apps/apps/*/mobile/dist/js/app.js;" 4 | 5 | /bin/bash -c "sed -i 's/isSupportEditFeature=()=>!1/isSupportEditFeature=()=>!0/g' /var/www/onlyoffice/documentserver/web-apps/apps/*/mobile/dist/js/app.js;" 6 | 7 | 8 | umask 0022 9 | 10 | start_process() { 11 | "$@" & 12 | CHILD=$!; wait "$CHILD"; CHILD=""; 13 | } 14 | 15 | function clean_exit { 16 | [[ -z "$CHILD" ]] || kill -s SIGTERM "$CHILD" 2>/dev/null 17 | if [ ${ONLYOFFICE_DATA_CONTAINER} == "false" ] && \ 18 | [ ${ONLYOFFICE_DATA_CONTAINER_HOST} == "localhost" ]; then 19 | /usr/bin/documentserver-prepare4shutdown.sh 20 | fi 21 | exit 22 | } 23 | 24 | trap clean_exit SIGTERM SIGQUIT SIGABRT SIGINT 25 | 26 | # Define '**' behavior explicitly 27 | shopt -s globstar 28 | 29 | APP_DIR="/var/www/${COMPANY_NAME}/documentserver" 30 | DATA_DIR="/var/www/${COMPANY_NAME}/Data" 31 | PRIVATE_DATA_DIR="${DATA_DIR}/.private" 32 | DS_RELEASE_DATE="${PRIVATE_DATA_DIR}/ds_release_date" 33 | LOG_DIR="/var/log/${COMPANY_NAME}" 34 | DS_LOG_DIR="${LOG_DIR}/documentserver" 35 | LIB_DIR="/var/lib/${COMPANY_NAME}" 36 | DS_LIB_DIR="${LIB_DIR}/documentserver" 37 | CONF_DIR="/etc/${COMPANY_NAME}/documentserver" 38 | SUPERVISOR_CONF_DIR="/etc/supervisor/conf.d" 39 | IS_UPGRADE="false" 40 | PLUGINS_ENABLED=${PLUGINS_ENABLED:-true} 41 | 42 | ONLYOFFICE_DATA_CONTAINER=${ONLYOFFICE_DATA_CONTAINER:-false} 43 | ONLYOFFICE_DATA_CONTAINER_HOST=${ONLYOFFICE_DATA_CONTAINER_HOST:-localhost} 44 | ONLYOFFICE_DATA_CONTAINER_PORT=80 45 | 46 | RELEASE_DATE="$(stat -c="%y" ${APP_DIR}/server/DocService/docservice | sed -r 's/=([0-9]+)-([0-9]+)-([0-9]+) ([0-9:.+ ]+)/\1-\2-\3/')"; 47 | if [ -f ${DS_RELEASE_DATE} ]; then 48 | PREV_RELEASE_DATE=$(head -n 1 ${DS_RELEASE_DATE}) 49 | else 50 | PREV_RELEASE_DATE="0" 51 | fi 52 | 53 | if [ "${RELEASE_DATE}" != "${PREV_RELEASE_DATE}" ]; then 54 | if [ ${ONLYOFFICE_DATA_CONTAINER} != "true" ]; then 55 | IS_UPGRADE="true"; 56 | fi 57 | fi 58 | 59 | SSL_CERTIFICATES_DIR="/usr/share/ca-certificates/ds" 60 | mkdir -p ${SSL_CERTIFICATES_DIR} 61 | if find "${DATA_DIR}/certs" -type f \( -name "*.crt" -o -name "*.pem" \) -print -quit >/dev/null 2>&1; then 62 | cp -f ${DATA_DIR}/certs/* ${SSL_CERTIFICATES_DIR} 63 | chmod 644 ${SSL_CERTIFICATES_DIR}/*.{crt,pem} 2>/dev/null 64 | chmod 400 ${SSL_CERTIFICATES_DIR}/*.key 2>/dev/null 65 | fi 66 | 67 | if [[ -z $SSL_CERTIFICATE_PATH ]] && [[ -f ${SSL_CERTIFICATES_DIR}/${COMPANY_NAME}.crt ]]; then 68 | SSL_CERTIFICATE_PATH=${SSL_CERTIFICATES_DIR}/${COMPANY_NAME}.crt 69 | else 70 | SSL_CERTIFICATE_PATH=${SSL_CERTIFICATE_PATH:-${SSL_CERTIFICATES_DIR}/tls.crt} 71 | fi 72 | if [[ -z $SSL_KEY_PATH ]] && [[ -f ${SSL_CERTIFICATES_DIR}/${COMPANY_NAME}.key ]]; then 73 | SSL_KEY_PATH=${SSL_CERTIFICATES_DIR}/${COMPANY_NAME}.key 74 | else 75 | SSL_KEY_PATH=${SSL_KEY_PATH:-${SSL_CERTIFICATES_DIR}/tls.key} 76 | fi 77 | 78 | #When set, the well known "root" CAs will be extended with the extra certificates in file 79 | NODE_EXTRA_CA_CERTS=${NODE_EXTRA_CA_CERTS:-${SSL_CERTIFICATES_DIR}/extra-ca-certs.pem} 80 | if [[ -f ${NODE_EXTRA_CA_CERTS} ]]; then 81 | NODE_EXTRA_ENVIRONMENT="${NODE_EXTRA_CA_CERTS}" 82 | elif [[ -f ${SSL_CERTIFICATE_PATH} ]]; then 83 | SSL_CERTIFICATE_SUBJECT=$(openssl x509 -subject -noout -in "${SSL_CERTIFICATE_PATH}" | sed 's/subject=//') 84 | SSL_CERTIFICATE_ISSUER=$(openssl x509 -issuer -noout -in "${SSL_CERTIFICATE_PATH}" | sed 's/issuer=//') 85 | 86 | #Add self-signed certificate to trusted list for validating Docs requests to the test example 87 | if [[ -n $SSL_CERTIFICATE_SUBJECT && $SSL_CERTIFICATE_SUBJECT == $SSL_CERTIFICATE_ISSUER ]]; then 88 | NODE_EXTRA_ENVIRONMENT="${SSL_CERTIFICATE_PATH}" 89 | fi 90 | fi 91 | 92 | if [[ -n $NODE_EXTRA_ENVIRONMENT ]]; then 93 | sed -i "s|^environment=.*$|&,NODE_EXTRA_CA_CERTS=${NODE_EXTRA_ENVIRONMENT}|" /etc/supervisor/conf.d/*.conf 94 | fi 95 | 96 | CA_CERTIFICATES_PATH=${CA_CERTIFICATES_PATH:-${SSL_CERTIFICATES_DIR}/ca-certificates.pem} 97 | SSL_DHPARAM_PATH=${SSL_DHPARAM_PATH:-${SSL_CERTIFICATES_DIR}/dhparam.pem} 98 | SSL_VERIFY_CLIENT=${SSL_VERIFY_CLIENT:-off} 99 | USE_UNAUTHORIZED_STORAGE=${USE_UNAUTHORIZED_STORAGE:-false} 100 | ONLYOFFICE_HTTPS_HSTS_ENABLED=${ONLYOFFICE_HTTPS_HSTS_ENABLED:-true} 101 | ONLYOFFICE_HTTPS_HSTS_MAXAGE=${ONLYOFFICE_HTTPS_HSTS_MAXAGE:-31536000} 102 | SYSCONF_TEMPLATES_DIR="/app/ds/setup/config" 103 | 104 | NGINX_CONFD_PATH="/etc/nginx/conf.d"; 105 | NGINX_ONLYOFFICE_PATH="${CONF_DIR}/nginx" 106 | NGINX_ONLYOFFICE_CONF="${NGINX_ONLYOFFICE_PATH}/ds.conf" 107 | NGINX_ONLYOFFICE_EXAMPLE_PATH="${CONF_DIR}-example/nginx" 108 | NGINX_ONLYOFFICE_EXAMPLE_CONF="${NGINX_ONLYOFFICE_EXAMPLE_PATH}/includes/ds-example.conf" 109 | 110 | NGINX_CONFIG_PATH="/etc/nginx/nginx.conf" 111 | NGINX_WORKER_PROCESSES=${NGINX_WORKER_PROCESSES:-1} 112 | # Limiting the maximum number of simultaneous connections due to possible memory shortage 113 | LIMIT=$(ulimit -n); [ $LIMIT -gt 1048576 ] && LIMIT=1048576 114 | NGINX_WORKER_CONNECTIONS=${NGINX_WORKER_CONNECTIONS:-$LIMIT} 115 | RABBIT_CONNECTIONS=${RABBIT_CONNECTIONS:-$LIMIT} 116 | 117 | JWT_ENABLED=${JWT_ENABLED:-true} 118 | 119 | # validate user's vars before usinig in json 120 | if [ "${JWT_ENABLED}" == "true" ]; then 121 | JWT_ENABLED="true" 122 | else 123 | JWT_ENABLED="false" 124 | fi 125 | 126 | [ -z $JWT_SECRET ] && JWT_MESSAGE='JWT is enabled by default. A random secret is generated automatically. Run the command "docker exec $(sudo docker ps -q) sudo documentserver-jwt-status.sh" to get information about JWT.' 127 | 128 | JWT_SECRET=${JWT_SECRET:-$(pwgen -s 32)} 129 | JWT_HEADER=${JWT_HEADER:-Authorization} 130 | JWT_IN_BODY=${JWT_IN_BODY:-false} 131 | 132 | WOPI_ENABLED=${WOPI_ENABLED:-false} 133 | ALLOW_META_IP_ADDRESS=${ALLOW_META_IP_ADDRESS:-false} 134 | ALLOW_PRIVATE_IP_ADDRESS=${ALLOW_PRIVATE_IP_ADDRESS:-false} 135 | 136 | GENERATE_FONTS=${GENERATE_FONTS:-true} 137 | 138 | if [[ ${PRODUCT_NAME}${PRODUCT_EDITION} == "documentserver" ]]; then 139 | REDIS_ENABLED=false 140 | else 141 | REDIS_ENABLED=true 142 | fi 143 | 144 | ONLYOFFICE_DEFAULT_CONFIG=${CONF_DIR}/local.json 145 | ONLYOFFICE_LOG4JS_CONFIG=${CONF_DIR}/log4js/production.json 146 | ONLYOFFICE_EXAMPLE_CONFIG=${CONF_DIR}-example/local.json 147 | 148 | JSON_BIN=${APP_DIR}/npm/json 149 | JSON="${JSON_BIN} -q -f ${ONLYOFFICE_DEFAULT_CONFIG}" 150 | JSON_LOG="${JSON_BIN} -q -f ${ONLYOFFICE_LOG4JS_CONFIG}" 151 | JSON_EXAMPLE="${JSON_BIN} -q -f ${ONLYOFFICE_EXAMPLE_CONFIG}" 152 | 153 | LOCAL_SERVICES=() 154 | 155 | PG_ROOT=/var/lib/postgresql 156 | PG_NAME=main 157 | PGDATA=${PG_ROOT}/${PG_VERSION}/${PG_NAME} 158 | PG_NEW_CLUSTER=false 159 | RABBITMQ_DATA=/var/lib/rabbitmq 160 | REDIS_DATA=/var/lib/redis 161 | 162 | if [ "${LETS_ENCRYPT_DOMAIN}" != "" -a "${LETS_ENCRYPT_MAIL}" != "" ]; then 163 | LETSENCRYPT_ROOT_DIR="/etc/letsencrypt/live" 164 | SSL_CERTIFICATE_PATH=${LETSENCRYPT_ROOT_DIR}/${LETS_ENCRYPT_DOMAIN}/fullchain.pem 165 | SSL_KEY_PATH=${LETSENCRYPT_ROOT_DIR}/${LETS_ENCRYPT_DOMAIN}/privkey.pem 166 | fi 167 | 168 | read_setting(){ 169 | deprecated_var POSTGRESQL_SERVER_HOST DB_HOST 170 | deprecated_var POSTGRESQL_SERVER_PORT DB_PORT 171 | deprecated_var POSTGRESQL_SERVER_DB_NAME DB_NAME 172 | deprecated_var POSTGRESQL_SERVER_USER DB_USER 173 | deprecated_var POSTGRESQL_SERVER_PASS DB_PWD 174 | deprecated_var RABBITMQ_SERVER_URL AMQP_URI 175 | deprecated_var AMQP_SERVER_URL AMQP_URI 176 | deprecated_var AMQP_SERVER_TYPE AMQP_TYPE 177 | 178 | METRICS_ENABLED="${METRICS_ENABLED:-false}" 179 | METRICS_HOST="${METRICS_HOST:-localhost}" 180 | METRICS_PORT="${METRICS_PORT:-8125}" 181 | METRICS_PREFIX="${METRICS_PREFIX:-.ds}" 182 | 183 | DB_HOST=${DB_HOST:-${POSTGRESQL_SERVER_HOST:-$(${JSON} services.CoAuthoring.sql.dbHost)}} 184 | DB_TYPE=${DB_TYPE:-$(${JSON} services.CoAuthoring.sql.type)} 185 | case $DB_TYPE in 186 | "postgres") 187 | DB_PORT=${DB_PORT:-"5432"} 188 | ;; 189 | "mariadb"|"mysql") 190 | DB_PORT=${DB_PORT:-"3306"} 191 | ;; 192 | "dameng") 193 | DB_PORT=${DB_PORT:-"5236"} 194 | ;; 195 | "mssql") 196 | DB_PORT=${DB_PORT:-"1433"} 197 | ;; 198 | "oracle") 199 | DB_PORT=${DB_PORT:-"1521"} 200 | ;; 201 | "") 202 | DB_PORT=${DB_PORT:-${POSTGRESQL_SERVER_PORT:-$(${JSON} services.CoAuthoring.sql.dbPort)}} 203 | ;; 204 | *) 205 | echo "ERROR: unknown database type" 206 | exit 1 207 | ;; 208 | esac 209 | DB_NAME=${DB_NAME:-${POSTGRESQL_SERVER_DB_NAME:-$(${JSON} services.CoAuthoring.sql.dbName)}} 210 | DB_USER=${DB_USER:-${POSTGRESQL_SERVER_USER:-$(${JSON} services.CoAuthoring.sql.dbUser)}} 211 | DB_PWD=${DB_PWD:-${POSTGRESQL_SERVER_PASS:-$(${JSON} services.CoAuthoring.sql.dbPass)}} 212 | 213 | RABBITMQ_SERVER_URL=${RABBITMQ_SERVER_URL:-$(${JSON} rabbitmq.url)} 214 | AMQP_URI=${AMQP_URI:-${AMQP_SERVER_URL:-${RABBITMQ_SERVER_URL}}} 215 | AMQP_TYPE=${AMQP_TYPE:-${AMQP_SERVER_TYPE:-rabbitmq}} 216 | parse_rabbitmq_url ${AMQP_URI} 217 | 218 | REDIS_SERVER_HOST=${REDIS_SERVER_HOST:-$(${JSON} services.CoAuthoring.redis.host)} 219 | REDIS_SERVER_PORT=${REDIS_SERVER_PORT:-6379} 220 | 221 | DS_LOG_LEVEL=${DS_LOG_LEVEL:-$(${JSON_LOG} categories.default.level)} 222 | } 223 | 224 | deprecated_var() { 225 | if [[ -n ${!1} ]]; then 226 | echo "Variable $1 is deprecated. Use $2 instead." 227 | fi 228 | } 229 | 230 | parse_rabbitmq_url(){ 231 | local amqp=$1 232 | 233 | # extract the protocol 234 | local proto="$(echo $amqp | grep :// | sed -e's,^\(.*://\).*,\1,g')" 235 | # remove the protocol 236 | local url="$(echo ${amqp/$proto/})" 237 | 238 | # extract the user and password (if any) 239 | local userpass="`echo $url | grep @ | cut -d@ -f1`" 240 | local pass=`echo $userpass | grep : | cut -d: -f2` 241 | 242 | local user 243 | if [ -n "$pass" ]; then 244 | user=`echo $userpass | grep : | cut -d: -f1` 245 | else 246 | user=$userpass 247 | fi 248 | 249 | # extract the host 250 | local hostport="$(echo ${url/$userpass@/} | cut -d/ -f1)" 251 | # by request - try to extract the port 252 | local port="$(echo $hostport | grep : | sed -r 's_^.*:+|/.*$__g')" 253 | 254 | local host 255 | if [ -n "$port" ]; then 256 | host=`echo $hostport | grep : | cut -d: -f1` 257 | else 258 | host=$hostport 259 | port="5672" 260 | fi 261 | 262 | # extract the path (if any) 263 | local path="$(echo $url | grep / | cut -d/ -f2-)" 264 | 265 | AMQP_SERVER_PROTO=${proto:0:-3} 266 | AMQP_SERVER_HOST=$host 267 | AMQP_SERVER_USER=$user 268 | AMQP_SERVER_PASS=$pass 269 | AMQP_SERVER_PORT=$port 270 | } 271 | 272 | waiting_for_connection(){ 273 | until nc -z -w 3 "$1" "$2"; do 274 | >&2 echo "Waiting for connection to the $1 host on port $2" 275 | sleep 1 276 | done 277 | } 278 | 279 | waiting_for_db_ready(){ 280 | case $DB_TYPE in 281 | "oracle") 282 | PDB="XEPDB1" 283 | ORACLE_SQL="sqlplus $DB_USER/$DB_PWD@//$DB_HOST:$DB_PORT/$PDB" 284 | DB_TEST="echo \"SELECT version FROM V\$INSTANCE;\" | $ORACLE_SQL 2>/dev/null | grep \"Connected\" | wc -l" 285 | ;; 286 | *) 287 | return 288 | ;; 289 | esac 290 | 291 | for (( i=1; i <= 10; i++ )); do 292 | RES=$(eval $DB_TEST) 293 | if [ "$RES" -ne "0" ]; then 294 | echo "Database is ready" 295 | break 296 | fi 297 | sleep 5 298 | done 299 | } 300 | 301 | waiting_for_db(){ 302 | waiting_for_connection $DB_HOST $DB_PORT 303 | waiting_for_db_ready 304 | } 305 | 306 | waiting_for_amqp(){ 307 | waiting_for_connection ${AMQP_SERVER_HOST} ${AMQP_SERVER_PORT} 308 | } 309 | 310 | waiting_for_redis(){ 311 | waiting_for_connection ${REDIS_SERVER_HOST} ${REDIS_SERVER_PORT} 312 | } 313 | waiting_for_datacontainer(){ 314 | waiting_for_connection ${ONLYOFFICE_DATA_CONTAINER_HOST} ${ONLYOFFICE_DATA_CONTAINER_PORT} 315 | } 316 | 317 | update_statsd_settings(){ 318 | ${JSON} -I -e "if(this.statsd===undefined)this.statsd={};" 319 | ${JSON} -I -e "this.statsd.useMetrics = '${METRICS_ENABLED}'" 320 | ${JSON} -I -e "this.statsd.host = '${METRICS_HOST}'" 321 | ${JSON} -I -e "this.statsd.port = '${METRICS_PORT}'" 322 | ${JSON} -I -e "this.statsd.prefix = '${METRICS_PREFIX}'" 323 | sed -i -E "s/(autostart|autorestart)=.*$/\1=${METRICS_ENABLED}/g" ${SUPERVISOR_CONF_DIR}/ds-metrics.conf 324 | } 325 | 326 | update_db_settings(){ 327 | ${JSON} -I -e "this.services.CoAuthoring.sql.type = '${DB_TYPE}'" 328 | ${JSON} -I -e "this.services.CoAuthoring.sql.dbHost = '${DB_HOST}'" 329 | ${JSON} -I -e "this.services.CoAuthoring.sql.dbPort = '${DB_PORT}'" 330 | ${JSON} -I -e "this.services.CoAuthoring.sql.dbName = '${DB_NAME}'" 331 | ${JSON} -I -e "this.services.CoAuthoring.sql.dbUser = '${DB_USER}'" 332 | ${JSON} -I -e "this.services.CoAuthoring.sql.dbPass = '${DB_PWD}'" 333 | } 334 | 335 | update_rabbitmq_setting(){ 336 | if [ "${AMQP_TYPE}" == "rabbitmq" ]; then 337 | ${JSON} -I -e "if(this.queue===undefined)this.queue={};" 338 | ${JSON} -I -e "this.queue.type = 'rabbitmq'" 339 | ${JSON} -I -e "this.rabbitmq.url = '${AMQP_URI}'" 340 | fi 341 | 342 | if [ "${AMQP_TYPE}" == "activemq" ]; then 343 | ${JSON} -I -e "if(this.queue===undefined)this.queue={};" 344 | ${JSON} -I -e "this.queue.type = 'activemq'" 345 | ${JSON} -I -e "if(this.activemq===undefined)this.activemq={};" 346 | ${JSON} -I -e "if(this.activemq.connectOptions===undefined)this.activemq.connectOptions={};" 347 | 348 | ${JSON} -I -e "this.activemq.connectOptions.host = '${AMQP_SERVER_HOST}'" 349 | 350 | if [ ! "${AMQP_SERVER_PORT}" == "" ]; then 351 | ${JSON} -I -e "this.activemq.connectOptions.port = '${AMQP_SERVER_PORT}'" 352 | else 353 | ${JSON} -I -e "delete this.activemq.connectOptions.port" 354 | fi 355 | 356 | if [ ! "${AMQP_SERVER_USER}" == "" ]; then 357 | ${JSON} -I -e "this.activemq.connectOptions.username = '${AMQP_SERVER_USER}'" 358 | else 359 | ${JSON} -I -e "delete this.activemq.connectOptions.username" 360 | fi 361 | 362 | if [ ! "${AMQP_SERVER_PASS}" == "" ]; then 363 | ${JSON} -I -e "this.activemq.connectOptions.password = '${AMQP_SERVER_PASS}'" 364 | else 365 | ${JSON} -I -e "delete this.activemq.connectOptions.password" 366 | fi 367 | 368 | case "${AMQP_SERVER_PROTO}" in 369 | amqp+ssl|amqps) 370 | ${JSON} -I -e "this.activemq.connectOptions.transport = 'tls'" 371 | ;; 372 | *) 373 | ${JSON} -I -e "delete this.activemq.connectOptions.transport" 374 | ;; 375 | esac 376 | fi 377 | } 378 | 379 | update_redis_settings(){ 380 | ${JSON} -I -e "if(this.services.CoAuthoring.redis===undefined)this.services.CoAuthoring.redis={};" 381 | ${JSON} -I -e "this.services.CoAuthoring.redis.host = '${REDIS_SERVER_HOST}'" 382 | ${JSON} -I -e "this.services.CoAuthoring.redis.port = '${REDIS_SERVER_PORT}'" 383 | 384 | if [ -n "${REDIS_SERVER_PASS}" ]; then 385 | ${JSON} -I -e "this.services.CoAuthoring.redis.options = {'password':'${REDIS_SERVER_PASS}'}" 386 | fi 387 | 388 | } 389 | 390 | update_ds_settings(){ 391 | ${JSON} -I -e "this.services.CoAuthoring.token.enable.browser = ${JWT_ENABLED}" 392 | ${JSON} -I -e "this.services.CoAuthoring.token.enable.request.inbox = ${JWT_ENABLED}" 393 | ${JSON} -I -e "this.services.CoAuthoring.token.enable.request.outbox = ${JWT_ENABLED}" 394 | 395 | ${JSON} -I -e "this.services.CoAuthoring.secret.inbox.string = '${JWT_SECRET}'" 396 | ${JSON} -I -e "this.services.CoAuthoring.secret.outbox.string = '${JWT_SECRET}'" 397 | ${JSON} -I -e "this.services.CoAuthoring.secret.session.string = '${JWT_SECRET}'" 398 | 399 | ${JSON} -I -e "this.services.CoAuthoring.token.inbox.header = '${JWT_HEADER}'" 400 | ${JSON} -I -e "this.services.CoAuthoring.token.outbox.header = '${JWT_HEADER}'" 401 | 402 | ${JSON} -I -e "this.services.CoAuthoring.token.inbox.inBody = ${JWT_IN_BODY}" 403 | ${JSON} -I -e "this.services.CoAuthoring.token.outbox.inBody = ${JWT_IN_BODY}" 404 | 405 | if [ -f "${ONLYOFFICE_EXAMPLE_CONFIG}" ]; then 406 | ${JSON_EXAMPLE} -I -e "this.server.token.enable = ${JWT_ENABLED}" 407 | ${JSON_EXAMPLE} -I -e "this.server.token.secret = '${JWT_SECRET}'" 408 | ${JSON_EXAMPLE} -I -e "this.server.token.authorizationHeader = '${JWT_HEADER}'" 409 | fi 410 | 411 | if [ "${USE_UNAUTHORIZED_STORAGE}" == "true" ]; then 412 | ${JSON} -I -e "if(this.services.CoAuthoring.requestDefaults===undefined)this.services.CoAuthoring.requestDefaults={}" 413 | ${JSON} -I -e "if(this.services.CoAuthoring.requestDefaults.rejectUnauthorized===undefined)this.services.CoAuthoring.requestDefaults.rejectUnauthorized=false" 414 | fi 415 | 416 | WOPI_PRIVATE_KEY="${DATA_DIR}/wopi_private.key" 417 | WOPI_PUBLIC_KEY="${DATA_DIR}/wopi_public.key" 418 | 419 | [ ! -f "${WOPI_PRIVATE_KEY}" ] && echo -n "Generating WOPI private key..." && openssl genpkey -algorithm RSA -outform PEM -out "${WOPI_PRIVATE_KEY}" >/dev/null 2>&1 && echo "Done" 420 | [ ! -f "${WOPI_PUBLIC_KEY}" ] && echo -n "Generating WOPI public key..." && openssl rsa -RSAPublicKey_out -in "${WOPI_PRIVATE_KEY}" -outform "MS PUBLICKEYBLOB" -out "${WOPI_PUBLIC_KEY}" >/dev/null 2>&1 && echo "Done" 421 | WOPI_MODULUS=$(openssl rsa -pubin -inform "MS PUBLICKEYBLOB" -modulus -noout -in "${WOPI_PUBLIC_KEY}" | sed 's/Modulus=//' | xxd -r -p | openssl base64 -A) 422 | WOPI_EXPONENT=$(openssl rsa -pubin -inform "MS PUBLICKEYBLOB" -text -noout -in "${WOPI_PUBLIC_KEY}" | grep -oP '(?<=Exponent: )\d+') 423 | 424 | ${JSON} -I -e "if(this.wopi===undefined)this.wopi={};" 425 | ${JSON} -I -e "this.wopi.enable = ${WOPI_ENABLED}" 426 | ${JSON} -I -e "this.wopi.privateKey = '$(awk '{printf "%s\\n", $0}' ${WOPI_PRIVATE_KEY})'" 427 | ${JSON} -I -e "this.wopi.privateKeyOld = '$(awk '{printf "%s\\n", $0}' ${WOPI_PRIVATE_KEY})'" 428 | ${JSON} -I -e "this.wopi.publicKey = '$(openssl base64 -in ${WOPI_PUBLIC_KEY} -A)'" 429 | ${JSON} -I -e "this.wopi.publicKeyOld = '$(openssl base64 -in ${WOPI_PUBLIC_KEY} -A)'" 430 | ${JSON} -I -e "this.wopi.modulus = '${WOPI_MODULUS}'" 431 | ${JSON} -I -e "this.wopi.modulusOld = '${WOPI_MODULUS}'" 432 | ${JSON} -I -e "this.wopi.exponent = ${WOPI_EXPONENT}" 433 | ${JSON} -I -e "this.wopi.exponentOld = ${WOPI_EXPONENT}" 434 | 435 | if [ "${ALLOW_META_IP_ADDRESS}" = "true" ] || [ "${ALLOW_PRIVATE_IP_ADDRESS}" = "true" ]; then 436 | ${JSON} -I -e "if(this.services.CoAuthoring['request-filtering-agent']===undefined)this.services.CoAuthoring['request-filtering-agent']={}" 437 | [ "${ALLOW_META_IP_ADDRESS}" = "true" ] && ${JSON} -I -e "this.services.CoAuthoring['request-filtering-agent'].allowMetaIPAddress = true" 438 | [ "${ALLOW_PRIVATE_IP_ADDRESS}" = "true" ] && ${JSON} -I -e "this.services.CoAuthoring['request-filtering-agent'].allowPrivateIPAddress = true" 439 | fi 440 | } 441 | 442 | create_postgresql_cluster(){ 443 | local pg_conf_dir=/etc/postgresql/${PG_VERSION}/${PG_NAME} 444 | local postgresql_conf=$pg_conf_dir/postgresql.conf 445 | local hba_conf=$pg_conf_dir/pg_hba.conf 446 | 447 | mv $postgresql_conf $postgresql_conf.backup 448 | mv $hba_conf $hba_conf.backup 449 | 450 | pg_createcluster ${PG_VERSION} ${PG_NAME} 451 | } 452 | 453 | create_postgresql_db(){ 454 | sudo -u postgres psql -c "CREATE USER $DB_USER WITH password '"$DB_PWD"';" 455 | sudo -u postgres psql -c "CREATE DATABASE $DB_NAME OWNER $DB_USER;" 456 | } 457 | 458 | create_mssql_db(){ 459 | MSSQL="/opt/mssql-tools18/bin/sqlcmd -S $DB_HOST,$DB_PORT" 460 | 461 | $MSSQL -U $DB_USER -P "$DB_PWD" -C -Q "IF NOT EXISTS (SELECT * FROM sys.databases WHERE name = '$DB_NAME') BEGIN CREATE DATABASE $DB_NAME; END" 462 | } 463 | 464 | create_db_tbl() { 465 | case $DB_TYPE in 466 | "postgres") 467 | create_postgresql_tbl 468 | ;; 469 | "mariadb"|"mysql") 470 | create_mysql_tbl 471 | ;; 472 | "mssql") 473 | create_mssql_tbl 474 | ;; 475 | "oracle") 476 | create_oracle_tbl 477 | ;; 478 | esac 479 | } 480 | 481 | upgrade_db_tbl() { 482 | case $DB_TYPE in 483 | "postgres") 484 | upgrade_postgresql_tbl 485 | ;; 486 | "mariadb"|"mysql") 487 | upgrade_mysql_tbl 488 | ;; 489 | "mssql") 490 | upgrade_mssql_tbl 491 | ;; 492 | "oracle") 493 | upgrade_oracle_tbl 494 | ;; 495 | esac 496 | } 497 | 498 | upgrade_postgresql_tbl() { 499 | if [ -n "$DB_PWD" ]; then 500 | export PGPASSWORD=$DB_PWD 501 | fi 502 | 503 | PSQL="psql -q -h$DB_HOST -p$DB_PORT -d$DB_NAME -U$DB_USER -w" 504 | 505 | $PSQL -f "$APP_DIR/server/schema/postgresql/removetbl.sql" 506 | $PSQL -f "$APP_DIR/server/schema/postgresql/createdb.sql" 507 | } 508 | 509 | upgrade_mysql_tbl() { 510 | CONNECTION_PARAMS="-h$DB_HOST -P$DB_PORT -u$DB_USER -p$DB_PWD -w" 511 | MYSQL="mysql -q $CONNECTION_PARAMS" 512 | 513 | $MYSQL $DB_NAME < "$APP_DIR/server/schema/mysql/removetbl.sql" >/dev/null 2>&1 514 | $MYSQL $DB_NAME < "$APP_DIR/server/schema/mysql/createdb.sql" >/dev/null 2>&1 515 | } 516 | 517 | upgrade_mssql_tbl() { 518 | CONN_PARAMS="-U $DB_USER -P "$DB_PWD" -C" 519 | MSSQL="/opt/mssql-tools18/bin/sqlcmd -S $DB_HOST,$DB_PORT $CONN_PARAMS" 520 | 521 | $MSSQL < "$APP_DIR/server/schema/mssql/removetbl.sql" >/dev/null 2>&1 522 | $MSSQL < "$APP_DIR/server/schema/mssql/createdb.sql" >/dev/null 2>&1 523 | } 524 | 525 | upgrade_oracle_tbl() { 526 | PDB="XEPDB1" 527 | ORACLE_SQL="sqlplus $DB_USER/$DB_PWD@//$DB_HOST:$DB_PORT/$PDB" 528 | 529 | $ORACLE_SQL @$APP_DIR/server/schema/oracle/removetbl.sql >/dev/null 2>&1 530 | $ORACLE_SQL @$APP_DIR/server/schema/oracle/createdb.sql >/dev/null 2>&1 531 | } 532 | 533 | create_postgresql_tbl() { 534 | if [ -n "$DB_PWD" ]; then 535 | export PGPASSWORD=$DB_PWD 536 | fi 537 | 538 | PSQL="psql -q -h$DB_HOST -p$DB_PORT -d$DB_NAME -U$DB_USER -w" 539 | $PSQL -f "$APP_DIR/server/schema/postgresql/createdb.sql" 540 | } 541 | 542 | create_mysql_tbl() { 543 | CONNECTION_PARAMS="-h$DB_HOST -P$DB_PORT -u$DB_USER -p$DB_PWD -w" 544 | MYSQL="mysql -q $CONNECTION_PARAMS" 545 | 546 | # Create db on remote server 547 | $MYSQL -e "CREATE DATABASE IF NOT EXISTS $DB_NAME DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;" >/dev/null 2>&1 548 | 549 | $MYSQL $DB_NAME < "$APP_DIR/server/schema/mysql/createdb.sql" >/dev/null 2>&1 550 | } 551 | 552 | create_mssql_tbl() { 553 | create_mssql_db 554 | 555 | CONN_PARAMS="-U $DB_USER -P "$DB_PWD" -C" 556 | MSSQL="/opt/mssql-tools18/bin/sqlcmd -S $DB_HOST,$DB_PORT $CONN_PARAMS" 557 | 558 | $MSSQL < "$APP_DIR/server/schema/mssql/createdb.sql" >/dev/null 2>&1 559 | } 560 | 561 | create_oracle_tbl() { 562 | PDB="XEPDB1" 563 | ORACLE_SQL="sqlplus $DB_USER/$DB_PWD@//$DB_HOST:$DB_PORT/$PDB" 564 | 565 | $ORACLE_SQL @$APP_DIR/server/schema/oracle/createdb.sql >/dev/null 2>&1 566 | } 567 | 568 | update_welcome_page() { 569 | WELCOME_PAGE="${APP_DIR}-example/welcome/docker.html" 570 | if [[ -e $WELCOME_PAGE ]]; then 571 | DOCKER_CONTAINER_ID=$(basename $(cat /proc/1/cpuset)) 572 | (( ${#DOCKER_CONTAINER_ID} < 12 )) && DOCKER_CONTAINER_ID=$(hostname) 573 | if (( ${#DOCKER_CONTAINER_ID} >= 12 )); then 574 | if [[ -x $(command -v docker) ]]; then 575 | DOCKER_CONTAINER_NAME=$(docker inspect --format="{{.Name}}" $DOCKER_CONTAINER_ID) 576 | sed 's/$(sudo docker ps -q)/'"${DOCKER_CONTAINER_NAME#/}"'/' -i $WELCOME_PAGE 577 | JWT_MESSAGE=$(echo $JWT_MESSAGE | sed 's/$(sudo docker ps -q)/'"${DOCKER_CONTAINER_NAME#/}"'/') 578 | else 579 | sed 's/$(sudo docker ps -q)/'"${DOCKER_CONTAINER_ID::12}"'/' -i $WELCOME_PAGE 580 | JWT_MESSAGE=$(echo $JWT_MESSAGE | sed 's/$(sudo docker ps -q)/'"${DOCKER_CONTAINER_ID::12}"'/') 581 | fi 582 | fi 583 | fi 584 | } 585 | 586 | update_nginx_settings(){ 587 | # Set up nginx 588 | sed 's/^worker_processes.*/'"worker_processes ${NGINX_WORKER_PROCESSES};"'/' -i ${NGINX_CONFIG_PATH} 589 | sed 's/worker_connections.*/'"worker_connections ${NGINX_WORKER_CONNECTIONS};"'/' -i ${NGINX_CONFIG_PATH} 590 | sed 's/access_log.*/'"access_log off;"'/' -i ${NGINX_CONFIG_PATH} 591 | 592 | # setup HTTPS 593 | if [ -f "${SSL_CERTIFICATE_PATH}" -a -f "${SSL_KEY_PATH}" ]; then 594 | cp -f ${NGINX_ONLYOFFICE_PATH}/ds-ssl.conf.tmpl ${NGINX_ONLYOFFICE_CONF} 595 | 596 | # configure nginx 597 | sed 's,{{SSL_CERTIFICATE_PATH}},'"${SSL_CERTIFICATE_PATH}"',' -i ${NGINX_ONLYOFFICE_CONF} 598 | sed 's,{{SSL_KEY_PATH}},'"${SSL_KEY_PATH}"',' -i ${NGINX_ONLYOFFICE_CONF} 599 | 600 | # turn on http2 601 | sed 's,\(443 ssl\),\1 http2,' -i ${NGINX_ONLYOFFICE_CONF} 602 | 603 | # if dhparam path is valid, add to the config, otherwise remove the option 604 | if [ -r "${SSL_DHPARAM_PATH}" ]; then 605 | sed 's,\(\#* *\)\?\(ssl_dhparam \).*\(;\)$,'"\2${SSL_DHPARAM_PATH}\3"',' -i ${NGINX_ONLYOFFICE_CONF} 606 | else 607 | sed '/ssl_dhparam/d' -i ${NGINX_ONLYOFFICE_CONF} 608 | fi 609 | 610 | sed 's,\(ssl_verify_client \).*\(;\)$,'"\1${SSL_VERIFY_CLIENT}\2"',' -i ${NGINX_ONLYOFFICE_CONF} 611 | 612 | if [ -f "${CA_CERTIFICATES_PATH}" ]; then 613 | sed '/ssl_verify_client/a '"ssl_client_certificate ${CA_CERTIFICATES_PATH}"';' -i ${NGINX_ONLYOFFICE_CONF} 614 | fi 615 | 616 | if [ "${ONLYOFFICE_HTTPS_HSTS_ENABLED}" == "true" ]; then 617 | sed 's,\(max-age=\).*\(;\)$,'"\1${ONLYOFFICE_HTTPS_HSTS_MAXAGE}\2"',' -i ${NGINX_ONLYOFFICE_CONF} 618 | else 619 | sed '/max-age=/d' -i ${NGINX_ONLYOFFICE_CONF} 620 | fi 621 | else 622 | ln -sf ${NGINX_ONLYOFFICE_PATH}/ds.conf.tmpl ${NGINX_ONLYOFFICE_CONF} 623 | fi 624 | 625 | # check if ipv6 supported otherwise remove it from nginx config 626 | if [ ! -f /proc/net/if_inet6 ]; then 627 | sed '/listen\s\+\[::[0-9]*\].\+/d' -i $NGINX_ONLYOFFICE_CONF 628 | fi 629 | 630 | if [ -f "${NGINX_ONLYOFFICE_EXAMPLE_CONF}" ]; then 631 | sed 's/linux/docker/' -i ${NGINX_ONLYOFFICE_EXAMPLE_CONF} 632 | fi 633 | 634 | start_process documentserver-update-securelink.sh -s ${SECURE_LINK_SECRET:-$(pwgen -s 20)} -r false 635 | } 636 | 637 | update_log_settings(){ 638 | ${JSON_LOG} -I -e "this.categories.default.level = '${DS_LOG_LEVEL}'" 639 | } 640 | 641 | update_logrotate_settings(){ 642 | sed 's|\(^su\b\).*|\1 root root|' -i /etc/logrotate.conf 643 | } 644 | 645 | update_release_date(){ 646 | mkdir -p ${PRIVATE_DATA_DIR} 647 | echo ${RELEASE_DATE} > ${DS_RELEASE_DATE} 648 | } 649 | 650 | # create base folders 651 | for i in converter docservice metrics; do 652 | mkdir -p "${DS_LOG_DIR}/$i" 653 | done 654 | 655 | mkdir -p ${DS_LOG_DIR}-example 656 | 657 | # create app folders 658 | for i in ${DS_LIB_DIR}/App_Data/cache/files ${DS_LIB_DIR}/App_Data/docbuilder ${DS_LIB_DIR}-example/files; do 659 | mkdir -p "$i" 660 | done 661 | 662 | # change folder rights 663 | for i in ${DS_LOG_DIR} ${DS_LOG_DIR}-example ${LIB_DIR}; do 664 | chown -R ds:ds "$i" 665 | chmod -R 755 "$i" 666 | done 667 | 668 | if [ ${ONLYOFFICE_DATA_CONTAINER_HOST} = "localhost" ]; then 669 | 670 | read_setting 671 | 672 | if [ $METRICS_ENABLED = "true" ]; then 673 | update_statsd_settings 674 | fi 675 | 676 | update_welcome_page 677 | 678 | update_log_settings 679 | 680 | update_ds_settings 681 | 682 | # update settings by env variables 683 | if [ $DB_HOST != "localhost" ]; then 684 | update_db_settings 685 | waiting_for_db 686 | create_db_tbl 687 | else 688 | # change rights for postgres directory 689 | chown -R postgres:postgres ${PG_ROOT} 690 | chmod -R 700 ${PG_ROOT} 691 | 692 | # create new db if it isn't exist 693 | if [ ! -d ${PGDATA} ]; then 694 | create_postgresql_cluster 695 | PG_NEW_CLUSTER=true 696 | fi 697 | LOCAL_SERVICES+=("postgresql") 698 | fi 699 | 700 | if [ ${AMQP_SERVER_HOST} != "localhost" ]; then 701 | update_rabbitmq_setting 702 | else 703 | # change rights for rabbitmq directory 704 | chown -R rabbitmq:rabbitmq ${RABBITMQ_DATA} 705 | chmod -R go=rX,u=rwX ${RABBITMQ_DATA} 706 | if [ -f ${RABBITMQ_DATA}/.erlang.cookie ]; then 707 | chmod 400 ${RABBITMQ_DATA}/.erlang.cookie 708 | fi 709 | 710 | echo "ulimit -n $RABBIT_CONNECTIONS" >> /etc/default/rabbitmq-server 711 | 712 | LOCAL_SERVICES+=("rabbitmq-server") 713 | # allow Rabbitmq startup after container kill 714 | rm -rf /var/run/rabbitmq 715 | fi 716 | 717 | if [ ${REDIS_ENABLED} = "true" ]; then 718 | if [ ${REDIS_SERVER_HOST} != "localhost" ]; then 719 | update_redis_settings 720 | else 721 | # change rights for redis directory 722 | chown -R redis:redis ${REDIS_DATA} 723 | chmod -R 750 ${REDIS_DATA} 724 | 725 | LOCAL_SERVICES+=("redis-server") 726 | fi 727 | fi 728 | else 729 | # no need to update settings just wait for remote data 730 | waiting_for_datacontainer 731 | 732 | # read settings after the data container in ready state 733 | # to prevent get unconfigureted data 734 | read_setting 735 | 736 | update_welcome_page 737 | fi 738 | 739 | find /etc/${COMPANY_NAME} ! -path '*logrotate*' -exec chown ds:ds {} \; 740 | 741 | #start needed local services 742 | for i in ${LOCAL_SERVICES[@]}; do 743 | service $i start 744 | done 745 | 746 | if [ ${PG_NEW_CLUSTER} = "true" ]; then 747 | create_postgresql_db 748 | create_postgresql_tbl 749 | fi 750 | 751 | if [ ${ONLYOFFICE_DATA_CONTAINER} != "true" ]; then 752 | waiting_for_db 753 | waiting_for_amqp 754 | if [ ${REDIS_ENABLED} = "true" ]; then 755 | waiting_for_redis 756 | fi 757 | 758 | if [ "${IS_UPGRADE}" = "true" ]; then 759 | upgrade_db_tbl 760 | update_release_date 761 | fi 762 | 763 | update_nginx_settings 764 | 765 | service supervisor start 766 | 767 | # start cron to enable log rotating 768 | update_logrotate_settings 769 | service cron start 770 | fi 771 | 772 | # Fix to resolve the `unknown "cache_tag" variable` error 773 | start_process documentserver-flush-cache.sh -r false 774 | 775 | # nginx used as a proxy, and as data container status service. 776 | # it run in all cases. 777 | service nginx start 778 | 779 | if [ "${LETS_ENCRYPT_DOMAIN}" != "" -a "${LETS_ENCRYPT_MAIL}" != "" ]; then 780 | if [ ! -f "${SSL_CERTIFICATE_PATH}" -a ! -f "${SSL_KEY_PATH}" ]; then 781 | start_process documentserver-letsencrypt.sh ${LETS_ENCRYPT_MAIL} ${LETS_ENCRYPT_DOMAIN} 782 | fi 783 | fi 784 | 785 | # Regenerate the fonts list and the fonts thumbnails 786 | if [ "${GENERATE_FONTS}" == "true" ]; then 787 | start_process documentserver-generate-allfonts.sh ${ONLYOFFICE_DATA_CONTAINER} 788 | fi 789 | 790 | if [ "${PLUGINS_ENABLED}" = "true" ]; then 791 | echo -n Installing plugins, please wait... 792 | start_process documentserver-pluginsmanager.sh -r false --update=\"${APP_DIR}/sdkjs-plugins/plugin-list-default.json\" >/dev/null 793 | echo Done 794 | fi 795 | 796 | start_process documentserver-static-gzip.sh ${ONLYOFFICE_DATA_CONTAINER} 797 | 798 | echo "${JWT_MESSAGE}" 799 | 800 | start_process tail -f /var/log/${COMPANY_NAME}/**/*.log 801 | -------------------------------------------------------------------------------- /tests/README.md: -------------------------------------------------------------------------------- 1 | The files in this folder are intended for use in integration auto-tests. 2 | 3 | All credentials are strictly for testing purposes only. -------------------------------------------------------------------------------- /tests/activemq.yml: -------------------------------------------------------------------------------- 1 | version: '2.1' 2 | services: 3 | onlyoffice-documentserver: 4 | container_name: onlyoffice-documentserver 5 | build: 6 | context: ../. 7 | environment: 8 | - AMQP_TYPE=${AMQP_TYPE:-activemq} 9 | - AMQP_URI=${AMQP_URI:-amqp://guest:guest@onlyoffice-activemq} 10 | stdin_open: true 11 | restart: always 12 | ports: 13 | - '80:80' 14 | - '443:443' 15 | networks: 16 | - onlyoffice 17 | 18 | onlyoffice-activemq: 19 | container_name: onlyoffice-activemq 20 | image: webcenter/activemq:${ACTIVEMQ_VERSION:-5.14.3} 21 | environment: 22 | - ACTIVEMQ_USERS_guest=${ACTIVEMQ_USERS_guest:-guest} 23 | - ACTIVEMQ_GROUPS_owners=${ACTIVEMQ_GROUPS_owners:-guest} 24 | restart: always 25 | networks: 26 | - onlyoffice 27 | expose: 28 | - '5672' 29 | 30 | networks: 31 | onlyoffice: 32 | driver: 'bridge' 33 | -------------------------------------------------------------------------------- /tests/certs-customized.yml: -------------------------------------------------------------------------------- 1 | version: '2.1' 2 | services: 3 | onlyoffice-documentserver: 4 | container_name: onlyoffice-documentserver 5 | build: 6 | context: ../. 7 | environment: 8 | - SSL_CERTIFICATE_PATH=${SSL_CERTIFICATE_PATH:-/var/www/onlyoffice/Data/certs/tls.crt} 9 | - SSL_KEY_PATH=${SSL_KEY_PATH:-/var/www/onlyoffice/Data/certs/tls.key} 10 | - CA_CERTIFICATES_PATH=${CA_CERTIFICATES_PATH:-/var/www/onlyoffice/Data/certs/ca-certificates.pem} 11 | - SSL_DHPARAM_PATH=${SSL_DHPARAM_PATH:-/var/www/onlyoffice/Data/certs/dhparam.pem} 12 | stdin_open: true 13 | restart: always 14 | ports: 15 | - '80:80' 16 | - '443:443' 17 | volumes: 18 | - ./data:/var/www/onlyoffice/Data 19 | -------------------------------------------------------------------------------- /tests/certs.yml: -------------------------------------------------------------------------------- 1 | version: '2.1' 2 | services: 3 | onlyoffice-documentserver: 4 | container_name: onlyoffice-documentserver 5 | build: 6 | context: ../. 7 | stdin_open: true 8 | restart: always 9 | ports: 10 | - '80:80' 11 | - '443:443' 12 | volumes: 13 | - ./data:/var/www/onlyoffice/Data 14 | -------------------------------------------------------------------------------- /tests/damengdb/.env: -------------------------------------------------------------------------------- 1 | VERSION=latest 2 | -------------------------------------------------------------------------------- /tests/damengdb/README.md: -------------------------------------------------------------------------------- 1 | ## Stand Documentserver with damengdb 2 | 3 | ### How it works 4 | 5 | For deploy stand, you need: 6 | 7 | **STEP 1**: Build you own images, do it with command: 8 | 9 | ```bash 10 | docker compose build 11 | ``` 12 | 13 | **STEP 2**: Wait build and when it finish deploy with command: 14 | 15 | ```bash 16 | docker compose up -d 17 | ``` 18 | 19 | Thats all. 20 | -------------------------------------------------------------------------------- /tests/damengdb/damengdb.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM onlyoffice/damengdb:8.1.2 as damengdb 2 | 3 | ARG DM8_USER="SYSDBA" 4 | ARG DM8_PASS="SYSDBA001" 5 | ARG DB_HOST="localhost" 6 | ARG DB_PORT="5236" 7 | ARG DISQL_BIN="/opt/dmdbms/bin" 8 | 9 | SHELL ["/bin/bash", "-c"] 10 | 11 | COPY <<"EOF" /wait_dm_ready.sh 12 | #!/usr/bin/env bash 13 | 14 | function wait_dm_ready() { 15 | cd /opt/dmdbms/bin 16 | for i in `seq 1 10`; do 17 | echo `./disql /nolog < /dev/null 2>&1 21 | if [ $? -eq 0 ]; then 22 | echo "DM Database is not OK, please wait..." 23 | sleep 10 24 | else 25 | echo "DM Database is OK" 26 | break 27 | fi 28 | done 29 | } 30 | 31 | wait_dm_ready 32 | 33 | EOF 34 | 35 | COPY <<"EOF" /permissions.sql 36 | 37 | CREATE SYNONYM onlyoffice.DOC_CHANGES FOR sysdba.DOC_CHANGES; 38 | CREATE SYNONYM onlyoffice.TASK_RESULT FOR sysdba.TASK_RESULT; 39 | GRANT ALL PRIVILEGES ON sysdba.DOC_CHANGES TO onlyoffice; 40 | GRANT ALL PRIVILEGES ON sysdba.TASK_RESULT TO onlyoffice; 41 | 42 | EOF 43 | 44 | RUN bash /opt/startup.sh > /dev/null 2>&1 \ 45 | & mkdir -p /schema/damengdb \ 46 | && apt update -y ; apt install wget -y \ 47 | && wget https://raw.githubusercontent.com/ONLYOFFICE/server/master/schema/dameng/createdb.sql -P /schema/dameng/ \ 48 | && bash ./wait_dm_ready.sh \ 49 | && cd ${DISQL_BIN} \ 50 | && ./disql $DM8_USER/$DM8_PASS@$DB_HOST:$DB_PORT -e \ 51 | "create user "onlyoffice" identified by "onlyoffice" password_policy 0;" \ 52 | && ./disql $DM8_USER/$DM8_PASS@$DB_HOST:$DB_PORT -e \ 53 | "GRANT SELECT ON DBA_TAB_COLUMNS TO onlyoffice;" \ 54 | && echo "EXIT" | tee -a /schema/dameng/createdb.sql \ 55 | && ./disql $DM8_USER/$DM8_PASS@$DB_HOST:$DB_PORT \`/schema/dameng/createdb.sql \ 56 | && ./disql $DM8_USER/$DM8_PASS@$DB_HOST:$DB_PORT \`/permissions.sql \ 57 | && sleep 10 58 | -------------------------------------------------------------------------------- /tests/damengdb/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | onlyoffice-documentserver: 4 | build: 5 | context: ../../. 6 | dockerfile: Dockerfile 7 | target: documentserver 8 | container_name: onlyoffice-documentserver 9 | depends_on: 10 | - onlyoffice-dameng 11 | - onlyoffice-rabbitmq 12 | environment: 13 | - DB_TYPE=dameng 14 | - DB_HOST=onlyoffice-dameng 15 | - DB_PORT=5236 16 | - DB_NAME=onlyoffice 17 | - DB_USER=onlyoffice 18 | - AMQP_URI=amqp://guest:guest@onlyoffice-rabbitmq 19 | # Costomize the JSON Web Token validation parameters if needed. 20 | #- JWT_ENABLED=false 21 | #- JWT_SECRET=secret 22 | #- JWT_HEADER=Authorization 23 | #- JWT_IN_BODY=true 24 | ports: 25 | - '80:80' 26 | - '443:443' 27 | stdin_open: true 28 | restart: always 29 | stop_grace_period: 60s 30 | volumes: 31 | - /var/www/onlyoffice/Data 32 | - /var/log/onlyoffice 33 | - /var/lib/onlyoffice/documentserver/App_Data/cache/files 34 | - /var/www/onlyoffice/documentserver-example/public/files 35 | - /usr/share/fonts 36 | 37 | onlyoffice-rabbitmq: 38 | container_name: onlyoffice-rabbitmq 39 | image: rabbitmq 40 | restart: always 41 | expose: 42 | - '5672' 43 | 44 | onlyoffice-dameng: 45 | container_name: onlyoffice-dameng 46 | build: 47 | context: . 48 | dockerfile: damengdb.Dockerfile 49 | target: damengdb 50 | args: 51 | DM8_USER: SYSDBA 52 | DM8_PASS: SYSDBA001 53 | DB_HOST: localhost 54 | DB_PORT: 5236 55 | environment: 56 | - PAGE_SIZE=16 57 | - LD_LIBRARY_PATH=/opt/dmdbms/bin 58 | - INSTANCE_NAME=dm8_01 59 | restart: always 60 | expose: 61 | - '5236' 62 | volumes: 63 | - dameng_data:/opt/dmdbms/data 64 | 65 | volumes: 66 | dameng_data: 67 | 68 | -------------------------------------------------------------------------------- /tests/graphite.yml: -------------------------------------------------------------------------------- 1 | version: '2.1' 2 | services: 3 | onlyoffice-documentserver: 4 | container_name: onlyoffice-documentserver 5 | build: 6 | context: ../. 7 | depends_on: 8 | - onlyoffice-graphite 9 | environment: 10 | - METRICS_ENABLED=${METRICS_ENABLED:-true} 11 | - METRICS_HOST=${METRICS_HOST:-localhost} 12 | - METRICS_PORT=${METRICS_PORT:-8125} 13 | - METRICS_PREFIX=${METRICS_PREFIX:-ds.} 14 | stdin_open: true 15 | restart: always 16 | expose: 17 | - '2003' 18 | ports: 19 | - '80:80' 20 | volumes: 21 | - ./graphite/statsd:/var/www/onlyoffice/documentserver/server/Metrics/config 22 | 23 | onlyoffice-graphite: 24 | container_name: onlyoffice-graphite 25 | image: graphiteapp/graphite-statsd 26 | environment: 27 | - GRAPHITE_STATSD_HOST=${GRAPHITE_STATSD_HOST:-onlyoffice-documentserver} 28 | - GRAPHITE_TIME_ZONE=${GRAPHITE_TIME_ZONE:-Etc/UTC} 29 | ports: 30 | - '8888:80' 31 | stdin_open: true 32 | restart: always 33 | -------------------------------------------------------------------------------- /tests/graphite/statsd/config.js: -------------------------------------------------------------------------------- 1 | { 2 | "graphiteHost": "onlyoffice-graphite", 3 | "graphitePort": 2003, 4 | "port": 8125, 5 | "flushInterval": 60000, 6 | "backends": [ "./backends/graphite.js" ] 7 | } 8 | -------------------------------------------------------------------------------- /tests/mariadb.yml: -------------------------------------------------------------------------------- 1 | version: '2.1' 2 | services: 3 | ds: 4 | container_name: ds 5 | build: 6 | context: ../. 7 | depends_on: 8 | - onlyoffice-mariadb 9 | environment: 10 | - DB_TYPE=${DB_TYPE:-mysql} 11 | - DB_HOST=${DB_HOST:-onlyoffice-mariadb} 12 | - DB_PORT=${DB_PORT:-3306} 13 | - DB_NAME=${DB_NAME:-onlyoffice} 14 | - DB_USER=${DB_USER:-onlyoffice} 15 | - DB_PWD=${DB_PWD:-onlyoffice} 16 | stdin_open: true 17 | restart: always 18 | ports: 19 | - '80:80' 20 | 21 | onlyoffice-mariadb: 22 | container_name: onlyoffice-mariadb 23 | image: mariadb:${MARIADB_VERSION:-10.5} 24 | environment: 25 | - MYSQL_DATABASE=${MYSQL_DATABASE:-onlyoffice} 26 | - MYSQL_USER=${MYSQL_USER:-onlyoffice} 27 | - MYSQL_PASSWORD=${MYSQL_PASSWORD:-onlyoffice} 28 | - MYSQL_ALLOW_EMPTY_PASSWORD=${MYSQL_ALLOW_EMPTY_PASSWORD:-yes} 29 | restart: always 30 | volumes: 31 | - mysql_data:/var/lib/mysql 32 | expose: 33 | - '3306' 34 | 35 | volumes: 36 | mysql_data: 37 | -------------------------------------------------------------------------------- /tests/mssql/README.md: -------------------------------------------------------------------------------- 1 | ## Stand Documentserver with mssql 2 | 3 | ### How it works 4 | 5 | For deploy stand: 6 | 7 | **STEP 1**: Build you own images: 8 | 9 | ```bash 10 | sudo docker-compose build 11 | ``` 12 | 13 | **STEP 2**: Wait build complete and when: 14 | 15 | ```bash 16 | sudo docker-compose up -d 17 | ``` 18 | -------------------------------------------------------------------------------- /tests/mssql/create_db_user.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #generate SA password 4 | SYMBOLS='!#$%&*+,-.:;=?@^_~' 5 | for (( i=1; i <= 20; i++ )); do 6 | PASS=$(tr -dc "A-Za-z0-9$SYMBOLS" /dev/null | grep "affected" | wc -l) 24 | if [ "$RES" -eq "1" ]; then 25 | echo "Database is ready" 26 | break 27 | fi 28 | sleep 10 29 | done 30 | 31 | #create new db user 32 | $CONNECTION_STR "IF NOT EXISTS (SELECT * FROM sys.sql_logins WHERE name = '$MSSQL_USER') BEGIN CREATE LOGIN $MSSQL_USER WITH PASSWORD = '$MSSQL_PASSWORD' , CHECK_POLICY = OFF; ALTER SERVER ROLE [dbcreator] ADD MEMBER [$MSSQL_USER]; END" 33 | -------------------------------------------------------------------------------- /tests/mssql/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2.1' 2 | services: 3 | onlyoffice-documentserver: 4 | container_name: onlyoffice-documentserver 5 | build: 6 | context: ../../. 7 | dockerfile: Dockerfile 8 | depends_on: 9 | - onlyoffice-mssql 10 | environment: 11 | - DB_TYPE=${DB_TYPE:-mssql} 12 | - DB_HOST=${DB_HOST:-onlyoffice-mssql} 13 | - DB_PORT=${DB_PORT:-1433} 14 | - DB_NAME=${DB_NAME:-onlyoffice} 15 | - DB_USER=${DB_USER:-onlyoffice} 16 | - DB_PWD=${DB_PWD:-onlyoffice} 17 | stdin_open: true 18 | restart: always 19 | ports: 20 | - '80:80' 21 | 22 | onlyoffice-mssql: 23 | container_name: onlyoffice-mssql 24 | build: 25 | context: . 26 | dockerfile: mssql.Dockerfile 27 | args: 28 | - MSSQL_DATABASE=${DB_NAME:-onlyoffice} 29 | - MSSQL_USER=${DB_USER:-onlyoffice} 30 | - MSSQL_PASSWORD=${DB_PWD:-onlyoffice} 31 | restart: always 32 | volumes: 33 | - mssql_data:/var/opt/mssql 34 | expose: 35 | - '1433' 36 | 37 | volumes: 38 | mssql_data: 39 | -------------------------------------------------------------------------------- /tests/mssql/mssql.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/mssql/server:2022-latest as onlyoffice-mssql 2 | 3 | ENV ACCEPT_EULA=Y 4 | 5 | SHELL ["/bin/bash", "-c"] 6 | 7 | COPY create_db_user.sh /tmp/create_db_user.sh 8 | 9 | RUN bash /tmp/create_db_user.sh 10 | -------------------------------------------------------------------------------- /tests/mysql.yml: -------------------------------------------------------------------------------- 1 | version: '2.1' 2 | services: 3 | onlyoffice-documentserver: 4 | container_name: onlyoffice-documentserver 5 | build: 6 | context: ../. 7 | depends_on: 8 | - onlyoffice-mysql 9 | environment: 10 | - DB_TYPE=${DB_TYPE:-mysql} 11 | - DB_HOST=${DB_HOST:-onlyoffice-mysql} 12 | - DB_PORT=${DB_PORT:-3306} 13 | - DB_NAME=${DB_NAME:-onlyoffice} 14 | - DB_USER=${DB_USER:-onlyoffice} 15 | - DB_PWD=${DB_PWD:-onlyoffice} 16 | stdin_open: true 17 | restart: always 18 | ports: 19 | - '80:80' 20 | 21 | onlyoffice-mysql: 22 | container_name: onlyoffice-mysql 23 | image: mysql:${MYSQL_VERSION:-5.7} 24 | command: --default-authentication-plugin=mysql_native_password 25 | environment: 26 | - MYSQL_DATABASE=${MYSQL_DATABASE:-onlyoffice} 27 | - MYSQL_USER=${MYSQL_USER:-onlyoffice} 28 | - MYSQL_PASSWORD=${MYSQL_PASSWORD:-onlyoffice} 29 | - MYSQL_ALLOW_EMPTY_PASSWORD=${MYSQL_ALLOW_EMPTY_PASSWORD:-yes} 30 | restart: always 31 | volumes: 32 | - mysql_data:/var/lib/mysql 33 | expose: 34 | - '3306' 35 | 36 | volumes: 37 | mysql_data: 38 | -------------------------------------------------------------------------------- /tests/oracle/README.md: -------------------------------------------------------------------------------- 1 | ## Stand Documentserver with oracle 2 | 3 | ### How it works 4 | 5 | For deploy stand: 6 | 7 | **STEP 1**: Build you own images: 8 | 9 | ```bash 10 | sudo docker-compose build 11 | ``` 12 | 13 | **STEP 2**: Wait build complete and when: 14 | 15 | ```bash 16 | sudo docker-compose up -d 17 | ``` 18 | -------------------------------------------------------------------------------- /tests/oracle/create_db_user.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | CONNECTION_STR="sqlplus sys/$ORACLE_PASSWORD@//localhost:1521/$ORACLE_DATABASE as sysdba" 4 | 5 | export ORACLE_PWD=$ORACLE_PASSWORD 6 | 7 | #start db 8 | /opt/oracle/runOracle.sh & 9 | 10 | #wait for db up 11 | for (( i=1; i <= 20; i++ )); do 12 | RES=$(echo "SELECT version FROM V\$INSTANCE;" | $CONNECTION_STR 2>/dev/null | grep "Connected" | wc -l) 13 | if [ "$RES" -ne "0" ]; then 14 | echo "Database is ready" 15 | break 16 | fi 17 | sleep 10 18 | done 19 | 20 | sleep 1 21 | 22 | #create new db user 23 | $CONNECTION_STR < an unique provider name 4 | - name: 'default-provider' 5 | # org id. will default to orgId 1 if not specified 6 | orgId: 1 7 | # name of the dashboard folder. Required 8 | folder: dashboards 9 | # folder UID. will be automatically generated if not specified 10 | folderUid: '' 11 | # provider type. Required 12 | type: file 13 | # disable dashboard deletion 14 | disableDeletion: false 15 | # enable dashboard editing 16 | editable: true 17 | # how often Grafana will scan for changed dashboards 18 | updateIntervalSeconds: 10 19 | options: 20 | # path to dashboard files on disk. Required 21 | path: /opt/bitnami/grafana/dashboards 22 | # enable folders creation for dashboards 23 | #foldersFromFilesStructure: true 24 | -------------------------------------------------------------------------------- /tests/prometheus/grafana/conf/prometheus.yml: -------------------------------------------------------------------------------- 1 | apiVersion: 1 2 | datasources: 3 | - name: Prometheus 4 | type: prometheus 5 | url: http://onlyoffice-prometheus:9090 6 | editable: true 7 | -------------------------------------------------------------------------------- /tests/prometheus/prometheus-scrape/statsd-exporter.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: 'statsd' 3 | scrape_interval: 30s 4 | static_configs: 5 | - targets: 6 | - onlyoffice-statsd-exporter:9102 7 | -------------------------------------------------------------------------------- /tests/rabbitmq-old.yml: -------------------------------------------------------------------------------- 1 | version: '2.1' 2 | services: 3 | onlyoffice-documentserver: 4 | container_name: onlyoffice-documentserver 5 | build: 6 | context: ../. 7 | environment: 8 | - AMQP_SERVER_TYPE=${AMQP_SERVER_TYPE:-rabbitmq} 9 | - AMQP_SERVER_URL=${AMQP_SERVER_URL:-amqp://guest:guest@onlyoffice-rabbitmq} 10 | stdin_open: true 11 | restart: always 12 | ports: 13 | - '80:80' 14 | - '443:443' 15 | networks: 16 | - onlyoffice 17 | 18 | onlyoffice-rabbitmq: 19 | container_name: onlyoffice-rabbitmq 20 | image: rabbitmq 21 | restart: always 22 | networks: 23 | - onlyoffice 24 | expose: 25 | - '5672' 26 | 27 | networks: 28 | onlyoffice: 29 | driver: 'bridge' 30 | -------------------------------------------------------------------------------- /tests/rabbitmq.yml: -------------------------------------------------------------------------------- 1 | version: '2.1' 2 | services: 3 | onlyoffice-documentserver: 4 | container_name: onlyoffice-documentserver 5 | build: 6 | context: ../. 7 | environment: 8 | - AMQP_TYPE=${AMQP_TYPE:-rabbitmq} 9 | - AMQP_URI=${AMQP_URI:-amqp://guest:guest@onlyoffice-rabbitmq} 10 | stdin_open: true 11 | restart: always 12 | ports: 13 | - '80:80' 14 | - '443:443' 15 | networks: 16 | - onlyoffice 17 | 18 | onlyoffice-rabbitmq: 19 | container_name: onlyoffice-rabbitmq 20 | image: rabbitmq:${RABBITMQ_VERSION:-latest} 21 | restart: always 22 | networks: 23 | - onlyoffice 24 | expose: 25 | - '5672' 26 | 27 | networks: 28 | onlyoffice: 29 | driver: 'bridge' 30 | -------------------------------------------------------------------------------- /tests/redis.yml: -------------------------------------------------------------------------------- 1 | version: '2.1' 2 | services: 3 | onlyoffice-documentserver: 4 | container_name: onlyoffice-documentserver 5 | build: 6 | context: ../. 7 | args: 8 | - PRODUCT_NAME=${PRODUCT_NAME:-documentserver} 9 | environment: 10 | - REDIS_SERVER_HOST=${REDIS_SERVER_HOST:-onlyoffice-redis} 11 | - REDIS_SERVER_PORT=${REDIS_SERVER_PORT:-6379} 12 | stdin_open: true 13 | restart: always 14 | ports: 15 | - '80:80' 16 | - '443:443' 17 | networks: 18 | - onlyoffice 19 | 20 | onlyoffice-redis: 21 | container_name: onlyoffice-redis 22 | image: redis:${REDIS_VERSION:-latest} 23 | restart: always 24 | networks: 25 | - onlyoffice 26 | expose: 27 | - '6379' 28 | 29 | networks: 30 | onlyoffice: 31 | driver: 'bridge' 32 | -------------------------------------------------------------------------------- /tests/standalone.yml: -------------------------------------------------------------------------------- 1 | version: '2.1' 2 | services: 3 | onlyoffice-documentserver: 4 | container_name: onlyoffice-documentserver 5 | build: 6 | context: ../. 7 | args: 8 | - PRODUCT_NAME=${PRODUCT_NAME:-documentserver} 9 | stdin_open: true 10 | restart: always 11 | ports: 12 | - '80:80' 13 | -------------------------------------------------------------------------------- /tests/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ssl=${ssl:-false} 4 | private_key=${private_key:-tls.key} 5 | certificate_request=${certificate_request:-tls.csr} 6 | certificate=${certificate:-tls.crt} 7 | 8 | # Generate certificate 9 | if [[ $ssl == "true" ]]; then 10 | url=${url:-"https://localhost"} 11 | 12 | mkdir -p data/certs 13 | pushd data/certs 14 | 15 | openssl genrsa -out ${private_key} 2048 16 | openssl req \ 17 | -new \ 18 | -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.example.com" \ 19 | -key ${private_key} \ 20 | -out ${certificate_request} 21 | openssl x509 -req -days 365 -in ${certificate_request} -signkey ${private_key} -out ${certificate} 22 | openssl dhparam -out dhparam.pem 2048 23 | chmod 400 ${private_key} 24 | 25 | popd 26 | else 27 | url=${url:-"http://localhost"} 28 | fi 29 | 30 | # Check if the yml exists 31 | if [[ ! -f $config ]]; then 32 | echo "File $config doesn't exist!" 33 | exit 1 34 | fi 35 | 36 | # Run test environment 37 | docker-compose -p ds -f $config up -d 38 | 39 | wakeup_timeout=90 40 | 41 | # Get documentserver healthcheck status 42 | echo "Wait for service wake up" 43 | sleep $wakeup_timeout 44 | healthcheck_res=$(wget --no-check-certificate -qO - ${url}/healthcheck) 45 | 46 | # Fail if it isn't true 47 | if [[ $healthcheck_res == "true" ]]; then 48 | echo "Healthcheck passed." 49 | else 50 | echo "Healthcheck failed!" 51 | exit 1 52 | fi 53 | 54 | docker-compose -p ds -f $config down 55 | --------------------------------------------------------------------------------