Skip to content

Instantly share code, notes, and snippets.

@janpekar
Last active December 29, 2021 00:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save janpekar/0d506647f77aa2261ee10b0fd21337e3 to your computer and use it in GitHub Desktop.
Save janpekar/0d506647f77aa2261ee10b0fd21337e3 to your computer and use it in GitHub Desktop.
Docker for starting onlyoffice documentserver with autoAssembly (coauthoring) value set - see https://api.onlyoffice.com/editors/save#forcesave
#!/bin/bash
#Requires jq (apt install jq)
imageName=${1?docker documentserver image}
interval=5m
tmpDir=$(mktemp -d)
trap "rm $tmpDir/*; rmdir $tmpDir" EXIT
cat <<EOF >$tmpDir/coauthoring.json
{
"services": {
"CoAuthoring": {
"autoAssembly": {
"enable": true,
"interval": "${interval}"
}
}
}
}
EOF
docker cp $imageName:/etc/onlyoffice/documentserver/local.json $tmpDir/local-orig.json
jq -s '.[0] * .[1]' $tmpDir/coauthoring.json $tmpDir/local-orig.json >$tmpDir/local.json
chmod a+r $tmpDir/local.json
docker cp $tmpDir/local.json $imageName:/etc/onlyoffice/documentserver/local.json
docker restart $imageName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment