Last active
December 29, 2021 00:10
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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