[develop] Modify readme

This commit is contained in:
Sergey Konovalov
2023-01-26 16:43:04 +03:00
parent 69107bb48c
commit 15f7a39997

View File

@ -71,8 +71,8 @@ along with the relative paths to the required folders.
The folders `sdkjs` and `web-apps` are required for proper development workflow.
The folders `server` is optional
**Note**: server start with `sdkjs` and `web-apps` takes 20 minutes
and takes 30 minutes with `server`
**Note**: server start with `sdkjs` and `web-apps` takes 10 minutes
and takes 15 minutes with `server`
### Windows (cmd)
@ -91,11 +91,11 @@ run with `sdkjs`, `web-apps` and `server`
docker run -i -t -p 80:80 --restart=always ^
-v %cd%/sdkjs:/var/www/onlyoffice/documentserver/sdkjs ^
-v %cd%/web-apps:/var/www/onlyoffice/documentserver/web-apps ^
-v %cd%/server:/var/www/onlyoffice/documentserver/server-src ^
-v %cd%/server:/var/www/onlyoffice/documentserver/server ^
documentserver-develop
```
### Linux or macOS
### Linux or macOS (bash)
run with `sdkjs` and `web-apps`
@ -112,18 +112,40 @@ run with `sdkjs`, `web-apps` and `server`
docker run -i -t -p 80:80 --restart=always \
-v $(pwd)/sdkjs:/var/www/onlyoffice/documentserver/sdkjs \
-v $(pwd)/web-apps:/var/www/onlyoffice/documentserver/web-apps \
-v $(pwd)/server:/var/www/onlyoffice/documentserver/server-src \
-v $(pwd)/server:/var/www/onlyoffice/documentserver/server \
documentserver-develop
```
### Open editor
After server succesfully starts you will see docker log messages like this
_[Date] [WARN] [localhost] [docId] [userId] nodeJS
- Express server listening on port 8000 in production-linux mode. Version: *.*.*. Build: *_
To try the document editor, open a tab and type
After the server starts successfully, you will see Docker log messages like this.
*[Date] [WARN] [localhost] [docId] [userId] nodeJS
- Express server listening on port 8000 in production-linux mode. Version:*
To try the document editor, open a browser tab and type
[http://localhost/example](http://localhost/example) into the URL bar.
### Modify sources
To change something in `sdkjs` do the following things
1. Edit source file. Let's insert an image url into any open document. Do the following command.
sed -i "s,this.sendEvent('asc_onDocumentContentReady');,this.sendEvent('asc_onDocumentContentReady');\n
this.AddImageUrl(['http://localhost/example/images/logo.png']);," sdkjs\common\apiBase.js
2. Delete browser cache or hard reload the page `Ctrl + Shift + R`
3. Open new file in browser
To change something in `server` do the following things
1. Edit source file. Let's send `"Hello World!"` chart message every time a document is opened.Do the following command
sed -i 's#sendAuthInfo(ctx, conn, bIsRestore, participantsMap, opt_hasForgotten, opt_openedAt)
{#sendAuthInfo(ctx, conn, bIsRestore, participantsMap, opt_hasForgotten, opt_openedAt)
{\nyield* onMessage(ctx, conn, {"message": "Hello World!"});#' server\DocService\sources\DocsCoServer.js
2. Restart document server process
```bash
docker exec -it CONTAINER_ID supervisorctl restart all
```
3. Open new file in browser