Skip to content

Commit

Permalink
Merge pull request #1441 from ONLYOFFICE/hotfix/v1.0.1
Browse files Browse the repository at this point in the history
Hotfix/v1.0.1
  • Loading branch information
alexeybannov authored May 29, 2023
2 parents a6023af + 161857e commit 4058e2b
Show file tree
Hide file tree
Showing 853 changed files with 61,183 additions and 31,825 deletions.
25 changes: 11 additions & 14 deletions .github/workflows/4testing-multi-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@ name: 4testing multiarch-build

on:
push:
branches: ["release/v1.0.0"]
branches:
- 'hotfix/v**'
- 'release/v**'
env:
DOCKER_PATH: "/build/install/docker"
REPO: "onlyoffice"
DOCKER_IMAGE_PREFIX: "4testing-docspace"
DOCKERFILE: "Dockerfile.app"

jobs:
build:
Expand All @@ -25,21 +32,11 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build 4testing
run: |
export BUILD_NUMBER="$(date "+%Y%m%d%H")"
cd ./build/install/docker
REPO="onlyoffice" \
DOCKER_IMAGE_PREFIX="4testing-docspace" \
DOCKER_TAG=v1.0.0 \
DOCKERFILE="Dockerfile.app" \
cd .${DOCKER_PATH}
export DOCKER_TAG=$(echo "${GITHUB_REF_NAME}" | sed '/^release\b\|^hotfix\b/s/release.*\/\|hotfix.*\///')
docker buildx bake -f build.yml \
--set *.args.GIT_BRANCH=$GITHUB_REF_NAME \
--set *.platform=linux/amd64 \
--push
REPO="onlyoffice" \
DOCKER_IMAGE_PREFIX="4testing-docspace" \
DOCKER_TAG=v1.0.0-$BUILD_NUMBER \
DOCKERFILE="Dockerfile.app" \
docker buildx bake -f build.yml \
--set *.args.GIT_BRANCH=$GITHUB_REF_NAME \
--push
shell: bash
3 changes: 2 additions & 1 deletion .github/workflows/build-ffvideo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ name: ffvideo build
on:
push:
branches:
- release/v1.0.0
- 'hotfix/v**'
- 'release/v**'
paths:
- 'build/install/docker/**.ffvideo'

Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/oci-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Upload OneСlickInstall scripts on S3

on:
push:
branches:
- master
paths:
- 'build/install/OneClickInstall/**'
workflow_dispatch:

env:
SCRIPT_DIR: 'build/install/OneClickInstall'
PRODUCT: $(echo "${{ github.event.repository.name }}" | tr '[:upper:]' '[:lower:]' )

jobs:
release:
name: Scripts release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Creating an enterprise script
run: |
cp ${{ env.SCRIPT_DIR }}/${{ env.PRODUCT }}-install.sh ${{ env.SCRIPT_DIR }}/${{ env.PRODUCT }}-enterprise-install.sh
sed -i 's/\(PARAMETERS -it\).*";/\1 ENTERPRISE";/' ${{ env.SCRIPT_DIR }}/${{ env.PRODUCT }}-enterprise-install.sh
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
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 scripts
run: |
cd ${{ env.SCRIPT_DIR }}
aws s3 cp . ${{ secrets.AWS_BUCKET_URL_OCI }}/ \
--recursive \
--acl public-read \
--content-type application/x-sh \
--metadata-directive REPLACE \
--exclude '*' \
--include="${{ env.PRODUCT }}-install.sh" \
--include="${{ env.PRODUCT }}-enterprise-install.sh"
- name: Invalidate AWS CloudFront cache
run: |
aws cloudfront create-invalidation \
--distribution-id ${{ secrets.AWS_DISTRIBUTION_ID_OCI }} \
--paths \
"/${{ env.PRODUCT }}-install.sh" \
"/${{ env.PRODUCT }}-enterprise-install.sh"
45 changes: 45 additions & 0 deletions build/install/OneClickInstall/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

## Install ONLYOFFICE DocSpace using OneClickInstall script

### Enterprise version
#### Get the installation script:

wget https://download.onlyoffice.com/docspace/docspace-enterprise-install.sh

#### Install ONLYOFFICE DocSpace RPM\DEB using script:

bash docspace-enterprise-install.sh package

#### Install ONLYOFFICE DocSpace Docker using script:

bash docspace-enterprise-install.sh docker

#### Display available script RPM\DEB parameters:

bash docspace-enterprise-install.sh package -h

#### Display available script Docker parameters:

bash docspace-enterprise-install.sh docker -h


### Community version
#### Get the installation script:

wget https://download.onlyoffice.com/docspace/docspace-install.sh

#### Install ONLYOFFICE DocSpace RPM\DEB using script:

bash docspace-install.sh package

#### Install ONLYOFFICE DocSpace Docker using script:

bash docspace-install.sh docker

#### Display available script RPM\DEB parameters:

bash docspace-install.sh package -h

#### Display available script Docker parameters:

bash docspace-install.sh docker -h
28 changes: 20 additions & 8 deletions build/install/OneClickInstall/docspace-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
# terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
#

PARAMETERS="";
PARAMETERS="$PARAMETERS -it COMMUNITY";
DOCKER="";
LOCAL_SCRIPTS="false"
HELP="false";
product="docspace"
GIT_BRANCH="develop"
GIT_BRANCH="master"
FILE_NAME="$(basename "$0")"

while [ "$1" != "" ]; do
case $1 in
Expand All @@ -56,10 +56,23 @@ while [ "$1" != "" ]; do
fi
;;

"-?" | -h | --help )
HELP="true";
docker )
DOCKER="true";
PARAMETERS="$PARAMETERS -ht install-Docker.sh";
shift && continue
;;

package )
DOCKER="false";
shift && continue
;;

"-?" | -h | --help )
if [ -z "$DOCKER" ]; then
echo "Run 'bash $FILE_NAME docker' to install docker version of application or 'bash $FILE_NAME package' to install deb/rpm version."
echo "Run 'bash $FILE_NAME docker -h' or 'bash $FILE_NAME package -h' to get more details."
exit 0;
fi
PARAMETERS="$PARAMETERS -ht $FILE_NAME";
;;
esac
PARAMETERS="$PARAMETERS ${1}";
Expand Down Expand Up @@ -123,11 +136,10 @@ if ! command_exists curl ; then
install_curl;
fi

if [ "$HELP" == "false" ]; then
if [ -z "$DOCKER" ]; then
read_installation_method;
fi

#DOWNLOAD_URL_PREFIX="http://download.onlyoffice.com/install-appserver/"
DOWNLOAD_URL_PREFIX="https://raw.githubusercontent.com/ONLYOFFICE/${product}/${GIT_BRANCH}/build/install/OneClickInstall"

if [ "$DOCKER" == "true" ]; then
Expand Down
40 changes: 36 additions & 4 deletions build/install/OneClickInstall/install-Debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ set -e
package_sysname="onlyoffice";
DS_COMMON_NAME="onlyoffice";
product="docspace"
GIT_BRANCH="develop"
GIT_BRANCH="master"
INSTALLATION_TYPE="ENTERPRISE"
RES_APP_INSTALLED="is already installed";
RES_APP_CHECK_PORTS="uses ports"
RES_CHECK_PORTS="please, make sure that the ports are free.";
Expand All @@ -21,6 +22,27 @@ while [ "$1" != "" ]; do
shift
fi
;;

-je | --jwtenabled )
if [ "$2" != "" ]; then
DS_JWT_ENABLED=$2
shift
fi
;;

-jh | --jwtheader )
if [ "$2" != "" ]; then
DS_JWT_HEADER=$2
shift
fi
;;

-js | --jwtsecret )
if [ "$2" != "" ]; then
DS_JWT_SECRET=$2
shift
fi
;;

-gb | --gitbranch )
if [ "$2" != "" ]; then
Expand All @@ -44,12 +66,23 @@ while [ "$1" != "" ]; do
fi
;;

-it | --installation_type )
if [ "$2" != "" ]; then
INSTALLATION_TYPE=$(echo "$2" | awk '{print toupper($0)}');
shift
fi
;;

-? | -h | --help )
echo " Usage $0 [PARAMETER] [[PARAMETER], ...]"
echo " Parameters:"
echo " -it, --installation_type installation type (COMMUNITY|ENTERPRISE|DEVELOPER)"
echo " -it, --installation_type installation type (community|enterprise)"
echo " -u, --update use to update existing components (true|false)"
echo " -ls, --local_scripts use 'true' to run local scripts (true|false)"
echo " -je, --jwtenabled specifies the enabling the JWT validation (true|false)"
echo " -jh, --jwtheader defines the http header that will be used to send the JWT"
echo " -js, --jwtsecret defines the secret key to validate the JWT in the request"
echo " -ls, --local_scripts use 'true' to run local scripts (true|false)"
echo " -skiphc, --skiphardwarecheck use to skip hardware check (true|false)"
echo " -?, -h, --help this help"
echo
exit 0
Expand Down Expand Up @@ -86,7 +119,6 @@ fi
# add onlyoffice repo
mkdir -p -m 700 $HOME/.gnupg
echo "deb [signed-by=/usr/share/keyrings/onlyoffice.gpg] http://download.onlyoffice.com/repo/debian squeeze main" | tee /etc/apt/sources.list.d/onlyoffice.list
echo "deb [signed-by=/usr/share/keyrings/onlyoffice.gpg] http://static.teamlab.info.s3.amazonaws.com/repo/4testing/debian stable main" | sudo tee /etc/apt/sources.list.d/onlyoffice4testing.list
curl -fsSL https://download.onlyoffice.com/GPG-KEY-ONLYOFFICE | gpg --no-default-keyring --keyring gnupg-ring:/usr/share/keyrings/onlyoffice.gpg --import
chmod 644 /usr/share/keyrings/onlyoffice.gpg

Expand Down
35 changes: 30 additions & 5 deletions build/install/OneClickInstall/install-Debian/install-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,29 @@ cat<<EOF
EOF
apt-get -y update

if [ "$UPDATE" = "true" ] && [ "$DOCUMENT_SERVER_INSTALLED" = "true" ]; then
ds_pkg_installed_name=$(dpkg -l | grep ${package_sysname}-documentserver | tail -n1 | awk '{print $2}');

if [ "$INSTALLATION_TYPE" = "COMMUNITY" ]; then
ds_pkg_name="${package_sysname}-documentserver";
elif [ "$INSTALLATION_TYPE" = "ENTERPRISE" ]; then
ds_pkg_name="${package_sysname}-documentserver-ee";
fi

if [ -n $ds_pkg_name ]; then
if ! dpkg -l ${ds_pkg_name} &> /dev/null; then

debconf-get-selections | grep ^${ds_pkg_installed_name} | sed s/${ds_pkg_installed_name}/${ds_pkg_name}/g | debconf-set-selections

apt-get remove -yq ${ds_pkg_installed_name}

apt-get install -yq ${ds_pkg_name}
else
apt-get install -y --only-upgrade ${ds_pkg_name};
fi
fi
fi

if [ "$DOCUMENT_SERVER_INSTALLED" = "false" ]; then
DS_PORT=${DS_PORT:-8083};

Expand All @@ -20,8 +43,8 @@ if [ "$DOCUMENT_SERVER_INSTALLED" = "false" ]; then
DS_DB_PWD=$DS_COMMON_NAME;

DS_JWT_ENABLED=${DS_JWT_ENABLED:-true};
DS_JWT_SECRET="$(cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 32)";
DS_JWT_HEADER="AuthorizationJwt";
DS_JWT_SECRET=${DS_JWT_SECRET:-$(cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 32)};
DS_JWT_HEADER=${DS_JWT_HEADER:-AuthorizationJwt};

if ! su - postgres -s /bin/bash -c "psql -lqt" | cut -d \| -f 1 | grep -q ${DS_DB_NAME}; then
su - postgres -s /bin/bash -c "psql -c \"CREATE USER ${DS_DB_USER} WITH password '${DS_DB_PWD}';\""
Expand All @@ -36,9 +59,11 @@ if [ "$DOCUMENT_SERVER_INSTALLED" = "false" ]; then
echo ${package_sysname}-documentserver $DS_COMMON_NAME/jwt-secret select ${DS_JWT_SECRET} | sudo debconf-set-selections
echo ${package_sysname}-documentserver $DS_COMMON_NAME/jwt-header select ${DS_JWT_HEADER} | sudo debconf-set-selections

apt-get install -yq ${package_sysname}-documentserver
elif [ "$UPDATE" = "true" ] && [ "$DOCUMENT_SERVER_INSTALLED" = "true" ]; then
apt-get install -y --only-upgrade ${package_sysname}-documentserver
if [ "$INSTALLATION_TYPE" = "COMMUNITY" ]; then
apt-get install -yq ${package_sysname}-documentserver
else
apt-get install -yq ${package_sysname}-documentserver-ee
fi
fi

if [ "$PRODUCT_INSTALLED" = "false" ]; then
Expand Down
Loading

0 comments on commit 4058e2b

Please sign in to comment.