mirror of
https://github.com/ONLYOFFICE/build_tools.git
synced 2026-02-10 20:45:38 +08:00
Update README.md
This commit is contained in:
194
README.md
194
README.md
@ -1,140 +1,142 @@
|
|||||||
# build_tools
|
<h1>ONLYOFFICE Build Tools</h1>
|
||||||
|
|
||||||
## Overview
|
Welcome to the ```build_tools``` repository! This powerful toolkit simplifies the process of compiling [ONLYOFFICE](https://github.com/ONLYOFFICE) products from source on Linux.
|
||||||
|
|
||||||
**build_tools** allow you to automatically get and install all the components
|
It automatically fetches all the required dependencies and source code to build the latest versions of:
|
||||||
necessary for the compilation process, all the dependencies required for the
|
|
||||||
**ONLYOFFICE Document Server**, **Document Builder** and **Desktop Editors**
|
|
||||||
correct work, as well as to get the latest version of
|
|
||||||
**ONLYOFFICE products** source code and build all their components.
|
|
||||||
|
|
||||||
**Important!** We can only guarantee the correct work of the products built
|
* [Docs (Document Server)](https://www.onlyoffice.com/docs?utm_source=github&utm_medium=cpc&utm_campaign=GitHubBuildTools)
|
||||||
from the `master` branch.
|
* [Desktop Editors](https://www.onlyoffice.com/desktop?utm_source=github&utm_medium=cpc&utm_campaign=GitHubBuildTools)
|
||||||
|
* [Document Builder](https://www.onlyoffice.com/document-builder?utm_source=github&utm_medium=cpc&utm_campaign=GitHubBuildTools)
|
||||||
|
|
||||||
## How to use - Linux
|
**A quick note:** For the most stable and reliable builds, we strongly recommend compiling from the ```master``` branch of this repository.
|
||||||
|
|
||||||
**Note**: The solution has been tested on **Ubuntu 16.04**.
|
## **How do I use it on Linux? 🐧**
|
||||||
|
|
||||||
### Installing dependencies
|
>This guide has been tested and verified on **Ubuntu 16.04**.
|
||||||
|
|
||||||
You might need to install **Python**, depending on your version of Ubuntu:
|
### **Step 1: Install dependencies**
|
||||||
|
|
||||||
|
First, let's make sure you have **Python** installed, as it's needed to run the build scripts.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo apt-get install -y python
|
sudo apt-get install -y python
|
||||||
```
|
```
|
||||||
|
|
||||||
### Building ONLYOFFICE products source code
|
### **Step 2: Build the source code**
|
||||||
|
|
||||||
1. Clone the build_tools repository:
|
Now, you're ready to build the ONLYOFFICE products.
|
||||||
|
|
||||||
|
1. **Clone the build_tools repository:**
|
||||||
|
|
||||||
|
This command downloads the build tools to your machine using Git:
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/ONLYOFFICE/build_tools.git
|
git clone https://github.com/ONLYOFFICE/build_tools.git
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Go to the `build_tools/tools/linux` directory:
|
2. **Navigate to the scripts directory:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd build_tools/tools/linux
|
cd build_tools/tools/linux
|
||||||
```
|
```
|
||||||
|
3. **Run the automation script:**
|
||||||
|
|
||||||
3. Run the `automate.py` script:
|
This is where the magic happens! Running the script without any options will build all three products: Document Server, Document Builder, and Desktop Editors.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./automate.py
|
./automate.py
|
||||||
```
|
```
|
||||||
|
You can also build ONLYOFFICE products separately. Just run the script with the parameter corresponding to the necessary product. For example, to build *Desktop Editors* and *Document Server*
|
||||||
If you run the script without any parameters this allows to build **ONLYOFFICE
|
|
||||||
Document Server**, **Document Builder** and **Desktop Editors**.
|
|
||||||
|
|
||||||
The result will be available in the `./out` directory.
|
|
||||||
|
|
||||||
To build **ONLYOFFICE** products separately run the script with the parameter
|
|
||||||
corresponding to the necessary product.
|
|
||||||
|
|
||||||
It’s also possible to build several products at once as shown in the example
|
|
||||||
below.
|
|
||||||
|
|
||||||
**Example**: Building **Desktop Editors** and **Document Server**
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./automate.py desktop server
|
./automate.py desktop server
|
||||||
```
|
```
|
||||||
|
|
||||||
### Using Docker
|
**Perfect!** Once the script finishes, you will find the compiled products in the ```./out``` directory.
|
||||||
|
|
||||||
You can also build all **ONLYOFFICE products** at once using Docker.
|
## **Advanced options & different workflows 🚀**
|
||||||
Build the `onlyoffice-document-editors-builder` Docker image using the
|
|
||||||
provided `Dockerfile` and run the corresponding Docker container.
|
### **How to use Docker**
|
||||||
|
|
||||||
|
If you prefer using Docker, you can build all products inside a container. This is a great way to keep your local system clean.
|
||||||
|
|
||||||
|
1. **Create an output directory:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
mkdir out
|
mkdir out
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Build the Docker image:**
|
||||||
|
|
||||||
|
```bash
|
||||||
docker build --tag onlyoffice-document-editors-builder .
|
docker build --tag onlyoffice-document-editors-builder .
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Run the container to start the build:**
|
||||||
|
|
||||||
|
This command mounts your local out directory into the container, so the final build files will appear on your machine.
|
||||||
|
|
||||||
|
```bash
|
||||||
docker run -v $PWD/out:/build_tools/out onlyoffice-document-editors-builder
|
docker run -v $PWD/out:/build_tools/out onlyoffice-document-editors-builder
|
||||||
```
|
```
|
||||||
|
|
||||||
The result will be available in the `./out` directory.
|
You've done it! The results will be in the ```./out``` directory you created.
|
||||||
|
|
||||||
### Building and running ONLYOFFICE products separately
|
## **How to build and run the products separately ▶️**
|
||||||
|
|
||||||
#### Document Builder
|
Don't need everything? You can save time by building only the products you need. Just add the product name as an argument to the script.
|
||||||
|
|
||||||
##### Building Document Builder
|
### Need just the [Document Builder](https://github.com/ONLYOFFICE/DocumentBuilder)❓
|
||||||
|
* How to build
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./automate.py builder
|
./automate.py builder
|
||||||
```
|
```
|
||||||
|
* How to run
|
||||||
##### Running Document Builder
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd ../../out/linux_64/onlyoffice/documentbuilder
|
cd ../../out/linux_64/onlyoffice/documentbuilder
|
||||||
./docbuilder
|
./docbuilder
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Desktop Editors
|
### Need just the [Desktop Editors](https://github.com/ONLYOFFICE/DesktopEditors)❓
|
||||||
|
|
||||||
##### Building Desktop Editors
|
|
||||||
|
|
||||||
|
* How to build
|
||||||
```bash
|
```bash
|
||||||
./automate.py desktop
|
./automate.py desktop
|
||||||
```
|
```
|
||||||
|
* How to run
|
||||||
##### Running Desktop Editors
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd ../../out/linux_64/onlyoffice/desktopeditors
|
cd ../../out/linux_64/onlyoffice/desktopeditors
|
||||||
LD_LIBRARY_PATH=./ ./DesktopEditors
|
LD_LIBRARY_PATH=./ ./DesktopEditors
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Document Server
|
### Need just the [Docs (Document Server)](https://github.com/ONLYOFFICE/DocumentServer)❓
|
||||||
|
* How to build
|
||||||
##### Building Document Server
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./automate.py server
|
./automate.py server
|
||||||
```
|
```
|
||||||
|
* How to run
|
||||||
|
|
||||||
##### Installing and configuring Document Server dependencies
|
Running the Document Server is a multi-step process because it relies on a few background services. Let's break it down step by step.
|
||||||
|
|
||||||
**Document Server** uses **NGINX** as a web server and **PostgreSQL** as a database.
|
#### **Step 1. Set up dependencies**
|
||||||
**RabbitMQ** is also required for **Document Server** to work correctly.
|
|
||||||
|
|
||||||
###### Installing and configuring NGINX
|
The Document Server needs a few things to run correctly:
|
||||||
|
|
||||||
1. Install NGINX:
|
* **NGINX**: Acts as a web server to handle requests.
|
||||||
|
* **PostgreSQL**: Used as the database to store information.
|
||||||
|
* **RabbitMQ**: A message broker that helps different parts of the server communicate.
|
||||||
|
|
||||||
|
Here are the commands to install and configure them.
|
||||||
|
|
||||||
|
#### **Install and configure NGINX**
|
||||||
|
|
||||||
|
1. Install NGINX
|
||||||
```bash
|
```bash
|
||||||
sudo apt-get install nginx
|
sudo apt-get install nginx
|
||||||
```
|
```
|
||||||
|
2. Disable the default NGINX site
|
||||||
2. Disable the default website:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo rm -f /etc/nginx/sites-enabled/default
|
sudo rm -f /etc/nginx/sites-enabled/default
|
||||||
```
|
```
|
||||||
|
3. Set up the new website. To do that create the ```/etc/nginx/sites-available/onlyoffice-documentserver``` file with the following contents:
|
||||||
3. Set up the new website. To do that create the `/etc/nginx/sites-available/onlyoffice-documentserver`
|
|
||||||
file with the following contents:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
map $http_host $this_host {
|
map $http_host $this_host {
|
||||||
@ -170,52 +172,47 @@ LD_LIBRARY_PATH=./ ./DesktopEditors
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
4. Add the symlink to the newly created website to the
|
4. Enable the new site by creating a symbolic link
|
||||||
`/etc/nginx/sites-available` directory:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo ln -s /etc/nginx/sites-available/onlyoffice-documentserver /etc/nginx/sites-enabled/onlyoffice-documentserver
|
sudo ln -s /etc/nginx/sites-available/onlyoffice-documentserver /etc/nginx/sites-enabled/onlyoffice-documentserver
|
||||||
```
|
```
|
||||||
|
5. Restart NGINX to apply the changes
|
||||||
5. Restart NGINX to apply the changes:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo nginx -s reload
|
sudo nginx -s reload
|
||||||
```
|
```
|
||||||
|
#### **Install and configure PostgreSQL**
|
||||||
|
|
||||||
###### Installing and configuring PostgreSQL
|
1. Install PostgreSQL
|
||||||
|
|
||||||
1. Install PostgreSQL:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo apt-get install postgresql
|
sudo apt-get install postgresql
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Create the PostgreSQL database and user:
|
2. Create a database and user.
|
||||||
|
|
||||||
**Note**: The created database must have **onlyoffice** both for user and password.
|
|
||||||
|
|
||||||
|
**Note**: The user and password must both be **'onlyoffice'.**
|
||||||
```bash
|
```bash
|
||||||
sudo -i -u postgres psql -c "CREATE USER onlyoffice WITH PASSWORD 'onlyoffice';"
|
sudo -i -u postgres psql -c "CREATE USER onlyoffice WITH PASSWORD 'onlyoffice';"
|
||||||
sudo -i -u postgres psql -c "CREATE DATABASE onlyoffice OWNER onlyoffice;"
|
sudo -i -u postgres psql -c "CREATE DATABASE onlyoffice OWNER onlyoffice;"
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Configure the database:
|
3. Configure the database:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
psql -hlocalhost -Uonlyoffice -d onlyoffice -f ../../out/linux_64/onlyoffice/documentserver/server/schema/postgresql/createdb.sql
|
psql -hlocalhost -Uonlyoffice -d onlyoffice -f ../../out/linux_64/onlyoffice/documentserver/server/schema/postgresql/createdb.sql
|
||||||
```
|
```
|
||||||
|
|
||||||
**Note**: Upon that, you will be asked to provide a password for the **onlyoffice**
|
Upon that, you will be asked to provide a password for the onlyoffice PostgreSQL user. Please enter the **onlyoffice** password.
|
||||||
PostgreSQL user. Please enter the **onlyoffice** password.
|
|
||||||
|
|
||||||
###### Installing RabbitMQ
|
|
||||||
|
|
||||||
|
#### **Install RabbitMQ**
|
||||||
```bash
|
```bash
|
||||||
sudo apt-get install rabbitmq-server
|
sudo apt-get install rabbitmq-server
|
||||||
```
|
```
|
||||||
|
|
||||||
###### Generate fonts data
|
Now that you have all the dependencies installed, it's time to generate server files.
|
||||||
|
#### **Step 2. Generate server files**
|
||||||
|
|
||||||
|
Before running the server, you need to generate font and theme data.
|
||||||
|
|
||||||
|
##### **Generate fonts data**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd out/linux_64/onlyoffice/documentserver/
|
cd out/linux_64/onlyoffice/documentserver/
|
||||||
@ -230,8 +227,7 @@ LD_LIBRARY_PATH=${PWD}/server/FileConverter/bin server/tools/allfontsgen \
|
|||||||
--use-system="true"
|
--use-system="true"
|
||||||
```
|
```
|
||||||
|
|
||||||
###### Generate presentation themes
|
##### **Generate presentation themes**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd out/linux_64/onlyoffice/documentserver/
|
cd out/linux_64/onlyoffice/documentserver/
|
||||||
LD_LIBRARY_PATH=${PWD}/server/FileConverter/bin server/tools/allthemesgen \
|
LD_LIBRARY_PATH=${PWD}/server/FileConverter/bin server/tools/allthemesgen \
|
||||||
@ -240,14 +236,11 @@ LD_LIBRARY_PATH=${PWD}/server/FileConverter/bin server/tools/allthemesgen \
|
|||||||
--output="${PWD}/sdkjs/common/Images"
|
--output="${PWD}/sdkjs/common/Images"
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Running Document Server
|
#### **Step 3. Run the Document Server services**
|
||||||
|
|
||||||
**Note**: All **Document Server** components run as foreground processes. Thus
|
All Document Server components run as foreground processes. Thus you need separate terminal consoles to run them or specific tools which will allow to run foreground processes in background mode.
|
||||||
you need separate terminal consoles to run them or specific tools which will
|
|
||||||
allow to run foreground processes in background mode.
|
|
||||||
|
|
||||||
1. Start the **FileConverter** service:
|
|
||||||
|
|
||||||
|
* **Start the FileConverter service:**
|
||||||
```bash
|
```bash
|
||||||
cd out/linux_64/onlyoffice/documentserver/server/FileConverter
|
cd out/linux_64/onlyoffice/documentserver/server/FileConverter
|
||||||
LD_LIBRARY_PATH=$PWD/bin \
|
LD_LIBRARY_PATH=$PWD/bin \
|
||||||
@ -256,11 +249,26 @@ allow to run foreground processes in background mode.
|
|||||||
./converter
|
./converter
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Start the **DocService** service:
|
* **Start the DocService service:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd out/linux_64/onlyoffice/documentserver/server/DocService
|
cd out/linux_64/onlyoffice/documentserver/server/DocService
|
||||||
NODE_ENV=development-linux \
|
NODE_ENV=development-linux \
|
||||||
NODE_CONFIG_DIR=$PWD/../Common/config \
|
NODE_CONFIG_DIR=$PWD/../Common/config \
|
||||||
./docservice
|
./docservice
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## And it's a wrap! 🎉
|
||||||
|
Congratulations! You have successfully used the ```build_tools``` to compile your desired ONLYOFFICE products from the latest source code.
|
||||||
|
|
||||||
|
Everything is now set up. You can go ahead and run your brand-new, self-compiled ONLYOFFICE applications.
|
||||||
|
|
||||||
|
## Need help or have an idea? 💡
|
||||||
|
|
||||||
|
* **🐞 Found a bug?** Please report it by creating an [issue](https://github.com/ONLYOFFICE/build_tools/issues).
|
||||||
|
* **❓ Have a question?** Ask our community and developers on the [ONLYOFFICE Forum](https://community.onlyoffice.com).
|
||||||
|
* **💡 Want to suggest a feature?** Share your ideas on our [feedback platform](https://feedback.onlyoffice.com/forums/966080-your-voice-matters).
|
||||||
|
* **🧑💻 Need help for developers?** Check our [API documentation](https://api.onlyoffice.com/?utm_source=github&utm_medium=cpc&utm_campaign=GitHubBuildTools).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<p align="center"> Made with ❤️ by the ONLYOFFICE Team </p>
|
||||||
|
|||||||
Reference in New Issue
Block a user