Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
waly-svalley-onlyoffice
Advanced tools
This example will help you integrate ONLYOFFICE Docs into your web application on Node.js.
Please note: It is intended for testing purposes and demonstrating functionality of the editors. Do NOT use this integration example on your own server without proper code modifications! In case you enabled the test example, disable it before going for production.
Download and install ONLYOFFICE Docs (packaged as Document Server).
See the detailed guide to learn how to install Document Server for Windows.
Download the Node.js example from our site.
To connect the editors to your website, specify the path to the editors installation and the path to the storage folder in the config/default.json file:
"storageFolder": "./files"
"storagePath": "/files"
"siteUrl": "https://documentserver/"
where the documentserver is the name of the server with the ONLYOFFICE Document Server installed, the storageFolder and storagePath are the paths where files will be created and stored. You can set an absolute path. For example, D:\\folder. Please note that on Windows OS the double backslash must be used as a separator.
If you want to experiment with the editor configuration, modify the parameters in the \views\editor.ejs file.
Install the node.js environment which is going to be used to run the Node.js project. Please follow the link at the official website choosing the correct version for your Windows OS (32-bit or 64-bit).
We will run the code in Node.js runtime environment and will interact with it using the command line interface (cmd).
Launch the Command Prompt and switch to the folder with the Node.js project code, for example:
cd /d "C:\Node.js Example"
Node.js comes with a package manager, node package manager (npm), which is automatically installed along with Node.js. To run the Node.js code, install the project modules using the following npm command:
npm install
A new node_modules folder will be created in the project folder.
Run the project using the Command Prompt:
node bin/www
See the result in your browser using the address:
http://localhost:3000
In case the example and Document Server are installed on different computers, make sure that your server with the example installed has access to the Document Server with the address which you specify instead of documentserver in the configuration files.
Make sure that the Document Server has access to the server with the example installed with the address which you specify instead of example.com in the configuration files.
Download and install ONLYOFFICE Docs (packaged as Document Server).
See the detailed guide to learn how to install Document Server for Linux.
Install Node.js:
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs
Download the archive with the Node.js example and unpack it:
wget https://api.onlyoffice.com/app_data/editor/Node.js%20Example.zip
unzip Node.js\ Example.zip
Change the current directory for the project directory:
cd Node.js\ Example/
Install the dependencies:
npm install
Edit the default.json configuration file. Specify the name of your local server with the ONLYOFFICE Document Server installed.
nano config/default.json
Edit the following lines:
"storageFolder": "./files"
"storagePath": "/files"
"siteUrl": "https://documentserver/"
where the documentserver is the name of the server with the ONLYOFFICE Document Server installed, the storageFolder and storagePath are the paths where files will be created and stored. Please note that you must have read and write permissions to the folder. If you do not have them, please use the next command:
sudo chmod -R ugo+rw /{path}
Run the project with Node.js:
nodejs bin/www
See the result in your browser using the address:
http://localhost:3000
In case the example and Document Server are installed on different computers, make sure that your server with the example installed has access to the Document Server with the address which you specify instead of documentserver in the configuration files.
Make sure that the Document Server has access to the server with the example installed with the address which you specify instead of example.com in the configuration files.
Please keep in mind the following security aspects when you are using test examples:
FAQs
OnlineEditorsExampleNodeJS
The npm package waly-svalley-onlyoffice receives a total of 1 weekly downloads. As such, waly-svalley-onlyoffice popularity was classified as not popular.
We found that waly-svalley-onlyoffice demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.