Docker does not install OnlyOffice by default
https://github.com/cryptpad/cryptpad/issues/1416
This commit is contained in:
parent
f5833a9430
commit
15ec7d74fd
3 changed files with 38 additions and 25 deletions
|
@ -15,6 +15,10 @@ services:
|
|||
- CPAD_SANDBOX_DOMAIN=https://your-sandbox-domain.com
|
||||
- CPAD_CONF=/cryptpad/config/config.js
|
||||
|
||||
# Uncomment the next line, when you want to use OnlyOffice on
|
||||
# your installation. TODO add link to license
|
||||
# - CPAD_INSTALL_ONLYOFFICE=yes
|
||||
|
||||
volumes:
|
||||
- ./data/blob:/cryptpad/blob
|
||||
- ./data/block:/cryptpad/block
|
||||
|
|
|
@ -29,12 +29,16 @@ if [ ! -f "$CPAD_CONF" ]; then
|
|||
fi
|
||||
|
||||
cd $CPAD_HOME
|
||||
|
||||
if [ "$CPAD_INSTALL_ONLYOFFICE" == "yes" ]; then
|
||||
eval "$(ssh-agent -s)" # TODO remove this when repo is public
|
||||
ssh-add install-onlyoffice-docker.key
|
||||
mkdir -p ~/.ssh
|
||||
chmod 0700 ~/.ssh
|
||||
ssh-keyscan github.com > ~/.ssh/known_hosts
|
||||
./install-onlyoffice.sh -c -l # TODO run only when OnlyOffice is enabled
|
||||
./install-onlyoffice.sh -c -l
|
||||
fi
|
||||
|
||||
npm run build
|
||||
|
||||
exec "$@"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euxo pipefail
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
BUILDS_DIR=$SCRIPT_DIR/onlyoffice-builds.git
|
||||
|
@ -90,12 +90,14 @@ ensure_commit_exists () {
|
|||
LAST_DIR=$(pwd)
|
||||
cd "$BUILDS_DIR"
|
||||
if ! git cat-file -e "$1"; then
|
||||
echo Fetch new OnlyOffice version...
|
||||
git fetch
|
||||
fi
|
||||
cd "$LAST_DIR"
|
||||
return
|
||||
fi
|
||||
|
||||
echo Downloading OnlyOffice...
|
||||
git clone --bare git@github.com:cryptpad/onlyoffice-builds.git "$BUILDS_DIR" # TODO use https here, when repo is public
|
||||
}
|
||||
|
||||
|
@ -106,8 +108,7 @@ install_version () {
|
|||
local LAST_DIR
|
||||
LAST_DIR=$(pwd)
|
||||
|
||||
if [ ! -e "$FULL_DIR"/.commit ]; then
|
||||
if [ "$(cat "$FULL_DIR"/.commit)" != "$COMMIT" ]; then
|
||||
if [ ! -e "$FULL_DIR"/.commit ] || [ "$(cat "$FULL_DIR"/.commit)" != "$COMMIT" ]; then
|
||||
ensure_commit_exists "$COMMIT"
|
||||
|
||||
if [ ! -e "$FULL_DIR"/.git ]; then
|
||||
|
@ -125,8 +126,12 @@ install_version () {
|
|||
cd "$LAST_DIR"
|
||||
|
||||
echo "$COMMIT" > "$FULL_DIR"/.commit
|
||||
|
||||
echo "$DIR" updated
|
||||
else
|
||||
echo "$DIR" was up to date
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if [ ${CLEAR+x} ]; then
|
||||
rm -f "$FULL_DIR"/.git
|
||||
|
|
Loading…
Reference in a new issue