Hey, I’ve been struggling with this for a while already.
What I want to achieve is to create a React app (already in place) that will let me include a form via <DocumentEditor>
from @onlyoffice/document-editor-react
. This will only be used by me and never released to production so I don’t need any form of security, JWT, authentication and so forth. I just want to see how OnlyOffice performs with React and if it’s good for my use case. Will be used only on my localhost. Simple as that.
What I need here is basically the document server (if I understand it correctly).
So I spin up a Docker image:
sudo docker run -e JWT_ENABLED=false -i -t -d -p 80:80 \
-v ~/app/onlyoffice/files/logs:/var/log/onlyoffice \
-v ~/app/onlyoffice/files/data:/var/www/onlyoffice/Data onlyoffice/documentserver
(HINT: can’t use /app/whatever
as stated in docs because you can’t write to /app/
on MacOS, I strongly recommend changing this line in all of the docs to something else that’s writable in other OSes, this also will make all automatic sh installation scripts using /app/
fail on MacOS)
Now when I open localhost:80 I can see pretty OnlyOffice landing. But what would be the next step here? How do I create a new document or form and include it in my React app? Do I need to setup external db manually (aka “document storage service”)? Why can’t I just start editing documents right away? It’s confusing. Even if I click on integration link on your document server page: ONLYOFFICE Api Documentation - Basic concepts I can see an example that looks something like this:
config = {
"document": {
"fileType": "docx",
"key": "Khirz6zTPdfd7",
"title": "Example Document Title.docx",
"url": "https://example.com/url-to-example-document.docx"
},
"documentType": "word",
"editorConfig": {
"callbackUrl": "https://example.com/url-to-callback.ashx"
}
};
Where does this url-to-example-document.docx
comes from along with its key? I can’t create in on my localhost:80 :o
The only other idea I had was to runsudo docker exec {containerId} sudo supervisorctl start ds:example
then I can go to http://localhost/example/ but “Save” there is turned off and turning it on inside docker container @ /etc/onlyoffice/documentserver-example/local.json
as follows:
{
"services": {
"CoAuthoring": {
"autoAssembly": {
"enable": true,
"interval": "5m"
}
}
}
"server": {
"token": {
"enable": false,
"secret": "Tt5D4mcdyNliXeiJFIDh",
"authorizationHeader": "Authorization"
}
}
}
Does not help much, still can’t save Example does not even seem to have any database settings in config so I guess it can’t be connected to my React app anyway? As it won’t save files anywhere even if somehow tricked to?
Thanks for any hints and explanations!