Skip to content

Commit

Permalink
Merge branch 'hotfix/v2.6.1' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeniy-antonyuk committed Aug 26, 2024
1 parent 2907786 commit 04368d2
Show file tree
Hide file tree
Showing 29 changed files with 477 additions and 360 deletions.
93 changes: 75 additions & 18 deletions .github/workflows/ci-oci-docker-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,31 @@ on:
- 'install/OneClickInstall/install-Docker.sh'
workflow_dispatch:
inputs:
script-branch:
description: 'Branch for OCI script docker'
offline:
description: 'Publish 4testing offline archive'
required: true
type: string
default: master
default: false
type: boolean

jobs:
Install-OneClickInstall-Docker:
runs-on: ubuntu-22.04
steps:
- name: Test OCI docker scripts
- name: Determine Branch Name
run: |
BRANCH_NAME=$([ "${{ github.event_name }}" = "pull_request" ] && echo "${{ github.event.pull_request.head.ref }}" || echo "${GITHUB_REF#refs/heads/}")
echo "BRANCH_NAME=${BRANCH_NAME:-master}" >> $GITHUB_ENV
- name: Free Disk Space
run: |
sudo docker image prune --all --force
BRANCH_NAME=$(
case "${{ github.event_name }}" in
pull_request) echo "${{ github.event.pull_request.head.ref }}";;
workflow_dispatch) echo "${{ github.event.inputs.script-branch }}";;
push) echo "${GITHUB_REF#refs/heads/}";;
esac
)
wget https://download.onlyoffice.com/docspace/docspace-install.sh
sed '/bash install-Docker.sh/i sed -i "1i set -x" install-Docker.sh' -i docspace-install.sh
sudo bash docspace-install.sh docker -skiphc true -noni true $([ $BRANCH_NAME != "master" ] && echo "-gb $BRANCH_NAME -s 4testing-") || exit $?
- name: Test OCI docker scripts
run: |
wget https://download.onlyoffice.com/docspace/docspace-enterprise-install.sh
sed '/bash install-Docker.sh/i sed -i "1i set -x" install-Docker.sh' -i docspace-enterprise-install.sh
sed '/bash install-Docker.sh/i sed -i "/docker-compose.*up -d/ s/$/ --quiet-pull/" install-Docker.sh' -i docspace-enterprise-install.sh
sudo bash docspace-enterprise-install.sh docker -docsi onlyoffice/documentserver-ee -skiphc true -noni true $([ ${{ env.BRANCH_NAME }} != "master" ] && echo "-gb ${{ env.BRANCH_NAME }} -s 4testing-") || exit $?
echo -n "Waiting for all containers to start..."
timeout 300 bash -c 'while docker ps | grep -q "starting"; do sleep 5; done' && echo "OK" || echo "container_status=timeout" >> $GITHUB_ENV
Expand All @@ -46,7 +46,7 @@ jobs:
"no healthcheck") color="\033[0;33m" ;; # yellow
*) color="\033[0;31m"; echo "container_status=red" >> $GITHUB_ENV ;; # red
esac;
printf "%-30s ${color}%s\033[0m\n" "{}:" "$status";
printf "%-50s ${color}%s\033[0m\n" "{}:" "$status";
'
- name: Print logs for crashed container
Expand All @@ -66,3 +66,60 @@ jobs:
red) echo "One or more containers have status 'red'. Job will fail."; exit 1 ;;
esac
- name: Checkout repository
if: ${{ github.event.inputs.offline == 'true' }}
uses: actions/checkout@v4
with:
ref: ${{ env.BRANCH_NAME }}

- name: Free Disk Space
if: ${{ github.event.inputs.offline == 'true' }}
run: |
docker stop $(docker ps -a -q) && docker rm $(docker ps -a -q) && docker volume rm $(docker volume ls -q)
sudo rm -rf /usr/local/lib/android /opt/ghc
- name: Creating 4testing offline self-extracting archive
if: ${{ github.event.inputs.offline == 'true' }}
run: |
INSTALL_PATH=${{ github.workspace }}/install
docker images --format "{{.Repository}}:{{.Tag}}" | grep "4testing-" | xargs -I{} bash -c '
docker tag "$1" $(echo "${1/4testing-/}" | sed -E "s/([0-9]+\.[0-9]+\.[0-9]+)\.[0-9]+/\1/")
docker rmi "$1"
' _ {}
sed -i 's~\(OFFLINE_INSTALLATION="\|SKIP_HARDWARE_CHECK="\).*"$~\1true"~' "${INSTALL_PATH}/OneClickInstall/install-Docker.sh"
echo "Creating offline self-extracting archive..."
docker save $(docker images --format "{{.Repository}}:{{.Tag}}") | xz --verbose -T0 -z -9e > ${INSTALL_PATH}/docker_images.tar.xz
cd ${INSTALL_PATH}/docker && tar -czvf ${INSTALL_PATH}/docker.tar.gz --exclude='config/supervisor*' *.yml .env config/
tar -cvf ${INSTALL_PATH}/offline-docspace.tar \
-C "${INSTALL_PATH}/OneClickInstall" install-Docker.sh \
-C "${INSTALL_PATH}" docker_images.tar.xz \
-C "${INSTALL_PATH}" docker.tar.gz
rm -rf ${INSTALL_PATH}/docker_images.tar.xz ${INSTALL_PATH}/docker.tar.gz
echo "ARTIFACT_NAME=${ARTIFACT_NAME:=4testing-offline-docspace-installation.sh}" >> $GITHUB_ENV
cat ${INSTALL_PATH}/common/self-extracting.sh ${INSTALL_PATH}/offline-docspace.tar > ${INSTALL_PATH}/${ARTIFACT_NAME}
chmod +x ${INSTALL_PATH}/${ARTIFACT_NAME}
- name: Configure AWS Credentials
if: ${{ github.event.inputs.offline == 'true' }}
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_OCI }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_OCI }}
aws-region: us-east-1

- name: Upload 4testing offline self-extracting archive
if: ${{ github.event.inputs.offline == 'true' }}
run: |
aws s3 cp ${{ github.workspace }}/install/${{ env.ARTIFACT_NAME }} \
${{ secrets.AWS_BUCKET_URL_OCI }}/${{ env.ARTIFACT_NAME }} \
--acl public-read \
--content-type application/x-xz \
--metadata-directive REPLACE
aws cloudfront create-invalidation \
--distribution-id ${{ secrets.AWS_DISTRIBUTION_ID_OCI }} \
--paths "/docspace/${{ env.ARTIFACT_NAME }}"
45 changes: 45 additions & 0 deletions .github/workflows/offline-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Upload offline self-extracting archive

on:
workflow_dispatch:

jobs:
release:
name: Upload offline self-extracting archive
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set environment variables
run: |
DOCKER_VERSION=$(curl -s https://hub.docker.com/v2/repositories/onlyoffice/4testing-docspace-api/tags/ | jq -r '.results[].name' | grep -oE '^[0-9]+\.[0-9]+\.[0-9]+' | sort -V | tail -n 1)
echo "ARTIFACT_NAME=offline-docspace-installation.sh" >> $GITHUB_ENV
echo "ARTIFACT_VERSION_NAME=offline-docspace-${DOCKER_VERSION}-installation.sh" >> $GITHUB_ENV
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_OCI }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_OCI }}
aws-region: us-east-1

- name: Upload offline self-extracting archive (latest)
run: |
aws s3 cp ${{ secrets.AWS_BUCKET_URL_OCI }}/4testing-${{ env.ARTIFACT_NAME }} \
${{ secrets.AWS_BUCKET_URL_OCI }}/${{ env.ARTIFACT_NAME }} \
--acl public-read \
--metadata-directive REPLACE
- name: Upload offline self-extracting archive (versioned)
run: |
aws s3 cp ${{ secrets.AWS_BUCKET_URL_OCI }}/4testing-${{ env.ARTIFACT_NAME }} \
${{ secrets.AWS_BUCKET_URL_OCI }}/${{ env.ARTIFACT_VERSION_NAME }} \
--acl public-read \
--metadata-directive REPLACE
- name: Invalidate AWS CloudFront cache
run: |
aws cloudfront create-invalidation \
--distribution-id ${{ secrets.AWS_DISTRIBUTION_ID_OCI }} \
--paths "/docspace/${{ env.ARTIFACT_NAME }}" "/docspace/${{ env.ARTIFACT_VERSION_NAME }}"
1 change: 1 addition & 0 deletions config/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
"url": ""
},
"legalterms": "https://help.onlyoffice.co/products/files/doceditor.aspx?fileid=5048502&doc=SXhWMEVzSEYxNlVVaXJJeUVtS0kyYk14YWdXTEFUQmRWL250NllHNUFGbz0_IjUwNDg1MDIi0",
"license-url": "",
"support-feedback": "https://helpdesk.onlyoffice.com",
"teamlab-site": "http://www.onlyoffice.com",
"help-center": "https://helpcenter.onlyoffice.com/{ru|de|fr|es|it}",
Expand Down
91 changes: 0 additions & 91 deletions config/autofac.consumers.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,33 +33,6 @@
"appleIdRedirectUrl" : "https://service.teamlab.info/oauth2.aspx"
}
}
},
{
"type": "ASC.FederatedLogin.LoginProviders.BitlyLoginProvider, ASC.FederatedLogin",
"services": [
{
"type": "ASC.Core.Common.Configuration.Consumer, ASC.Core.Common"
},
{
"type": "ASC.FederatedLogin.LoginProviders.BitlyLoginProvider, ASC.FederatedLogin"
},
{
"key": "bitly",
"type": "ASC.Core.Common.Configuration.Consumer, ASC.Core.Common"
},
{
"key": "bitly",
"type": "ASC.FederatedLogin.LoginProviders.BitlyLoginProvider, ASC.FederatedLogin"
}
],
"instanceScope": "perlifetimescope",
"parameters": {
"name": "bitly",
"order": "13",
"props": {
"bitlyToken": ""
}
}
},
{
"type": "ASC.FederatedLogin.LoginProviders.BoxLoginProvider, ASC.FederatedLogin",
Expand Down Expand Up @@ -394,37 +367,6 @@
"twiliosender": ""
}
}
},
{
"type": "ASC.FederatedLogin.LoginProviders.WordpressLoginProvider, ASC.FederatedLogin",
"services": [
{
"type": "ASC.Core.Common.Configuration.Consumer, ASC.Core.Common"
},
{
"type": "ASC.FederatedLogin.LoginProviders.WordpressLoginProvider, ASC.FederatedLogin"
},
{
"key": "wordpress",
"type": "ASC.Core.Common.Configuration.Consumer, ASC.Core.Common"
},
{
"key": "wordpress",
"type": "ASC.FederatedLogin.LoginProviders.WordpressLoginProvider, ASC.FederatedLogin"
}
],
"instanceScope": "perlifetimescope",
"parameters": {
"name": "wordpress",
"order": "15",
"props": {
"wpClientId": "",
"wpClientSecret": ""
},
"additional": {
"wpRedirectUrl" : "https://service.teamlab.info/oauth2.aspx"
}
}
},
{
"type": "ASC.Core.Common.Configuration.DataStoreConsumer, ASC.Core.Common",
Expand Down Expand Up @@ -529,39 +471,6 @@
"region" : ""
}
}
},
{
"type": "ASC.Core.Common.Configuration.DataStoreConsumer, ASC.Core.Common",
"services": [
{
"type": "ASC.Core.Common.Configuration.Consumer, ASC.Core.Common"
},
{
"type": "ASC.Core.Common.Configuration.DataStoreConsumer, ASC.Core.Common"
},
{
"key": "selectel",
"type": "ASC.Core.Common.Configuration.Consumer, ASC.Core.Common"
},
{
"key": "selectel",
"type": "ASC.Core.Common.Configuration.DataStoreConsumer, ASC.Core.Common"
}
],
"instanceScope": "perlifetimescope",
"parameters": {
"name": "selectel",
"order": "23",
"props": {
"authUser": "",
"authPwd": ""
},
"additional": {
"handlerType" : "ASC.Data.Storage.Selectel.SelectelStorage, ASC.Data.Storage",
"public_container" : "",
"private_container" : ""
}
}
},
{
"type": "ASC.FederatedLogin.LoginProviders.ZoomLoginProvider, ASC.FederatedLogin",
Expand Down
5 changes: 3 additions & 2 deletions config/nginx/onlyoffice.conf
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ server {
add_header X-Content-Type-Options "nosniff";
add_header X-Frame-Options $header_x_frame_options;
add_header Cache-Control $cache_control;
add_header Permissions-Policy "autoplay=(), geolocation=(), camera=(), microphone=(), interest-cohort=()";
add_header Permissions-Policy "autoplay=(), geolocation=(), camera=(), interest-cohort=()";

root $public_root;
etag on;
Expand Down Expand Up @@ -105,7 +105,8 @@ server {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $proxy_connection;
proxy_set_header Proxy "";

proxy_max_temp_file_size 0;

set $csp "";
access_by_lua '
local accept_header = ngx.req.get_headers()["Accept"]
Expand Down
Loading

0 comments on commit 04368d2

Please sign in to comment.