Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2459863430 | |||
| 52c11fa3a1 | |||
| 86d2fc1399 | |||
| d2f77d857d | |||
| 4ec7e46736 | |||
| 8c433b2867 | |||
| c3922de50c | |||
| 29f7beff3c | |||
| 0a8df9cb5d | |||
| 08b752411b | |||
| c6a2007c6a | |||
| 847e4ce6d9 | |||
| 152083ed4e | |||
| d594870c87 | |||
| ce0bbca5b2 | |||
| e6831fa52f | |||
| ffa686e0a2 | |||
| 730cc09520 |
6
.github/workflows/artifact-csharp-mvc.yml
vendored
@ -21,11 +21,9 @@ jobs:
|
||||
cwd=$(pwd)
|
||||
git submodule update --init --recursive
|
||||
cd ./web/documentserver-example/csharp-mvc
|
||||
mkdir -p ./deploy/'DotNet (Csharp MVN) Example'
|
||||
mkdir -p ./deploy/'DotNet (Csharp MVC) Example'
|
||||
rsync -av --exclude='deploy' ./ ./deploy/'DotNet (Csharp MVC) Example'
|
||||
cd ./deploy/'DotNet (Csharp MVC) Example'/assets
|
||||
rm -rf ./.git/
|
||||
rm .git
|
||||
rm -rf ./deploy/'DotNet (Csharp MVC) Example'/assets/.git
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
|
||||
5
.github/workflows/artifact-csharp.yml
vendored
@ -18,14 +18,11 @@ jobs:
|
||||
- name: Build Artifact
|
||||
run: |
|
||||
cd ${{ github.workspace }}
|
||||
cwd=$(pwd)
|
||||
git submodule update --init --recursive
|
||||
cd ./web/documentserver-example/csharp
|
||||
mkdir -p ./deploy/'DotNet (Csharp) Example'
|
||||
rsync -av --exclude='deploy' ./ ./deploy/'DotNet (Csharp) Example'
|
||||
cd ./deploy/'DotNet (Csharp) Example'/assets
|
||||
rm -rf ./.git/
|
||||
rm .git
|
||||
rm -rf ./deploy/'DotNet (Csharp) Example'/assets/.git
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
|
||||
6
.github/workflows/artifact-java.yml
vendored
@ -18,14 +18,12 @@ jobs:
|
||||
- name: Build Artifact
|
||||
run: |
|
||||
cd ${{ github.workspace }}
|
||||
cwd=$(pwd)
|
||||
git submodule update --init --recursive
|
||||
cd ./web/documentserver-example/java
|
||||
mkdir -p ./deploy/'Java Example'
|
||||
rsync -av --exclude='deploy' ./ ./deploy/'Java Example'
|
||||
cd ./deploy/'Java Example'/src/main/resources/assets
|
||||
rm -rf ./.git/
|
||||
rm .git
|
||||
rm -rf ./deploy/'Java Example'/src/main/resources/assets/document-formats/.git
|
||||
rm -rf ./deploy/'Java Example'/src/main/resources/assets/document-templates/.git
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
|
||||
6
.github/workflows/artifact-node.yml
vendored
@ -18,14 +18,12 @@ jobs:
|
||||
- name: Build Artifact
|
||||
run: |
|
||||
cd ${{ github.workspace }}
|
||||
cwd=$(pwd)
|
||||
git submodule update --init --recursive
|
||||
cd ./web/documentserver-example/nodejs
|
||||
mkdir -p ./deploy/'Node.js Example'
|
||||
rsync -av --exclude='deploy' ./ ./deploy/'Node.js Example'
|
||||
cd ./deploy/'Node.js Example'/public/assets
|
||||
rm -rf ./.git/
|
||||
rm .git
|
||||
rm -rf ./deploy/'Node.js Example'/public/assets/document-formats/.git
|
||||
rm -rf ./deploy/'Node.js Example'/public/assets/document-templates/.git
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
|
||||
6
.github/workflows/artifact-php.yml
vendored
@ -18,14 +18,12 @@ jobs:
|
||||
- name: Build Artifact
|
||||
run: |
|
||||
cd ${{ github.workspace }}
|
||||
cwd=$(pwd)
|
||||
git submodule update --init --recursive
|
||||
cd ./web/documentserver-example/php
|
||||
mkdir -p ./deploy/'PHP Example'
|
||||
rsync -av --exclude='deploy' ./ ./deploy/'PHP Example'
|
||||
cd ./deploy/'PHP Example'/assets
|
||||
rm -rf ./.git/
|
||||
rm .git
|
||||
rm -rf ./deploy/'PHP Example'/assets/document-formats/.git
|
||||
rm -rf ./deploy/'PHP Example'/assets/document-templates/.git
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
|
||||
6
.github/workflows/artifact-python.yml
vendored
@ -18,14 +18,12 @@ jobs:
|
||||
- name: Build Artifact
|
||||
run: |
|
||||
cd ${{ github.workspace }}
|
||||
cwd=$(pwd)
|
||||
git submodule update --init --recursive
|
||||
cd ./web/documentserver-example/python
|
||||
mkdir -p ./deploy/'Python Example'
|
||||
rsync -av --exclude='deploy' ./ ./deploy/'Python Example'
|
||||
cd ./deploy/'Python Example'/assets
|
||||
rm -rf ./.git/
|
||||
rm .git
|
||||
rm -rf ./deploy/'Python Example'/assets/document-formats/.git
|
||||
rm -rf ./deploy/'Python Example'/assets/document-templates/.git
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
|
||||
6
.github/workflows/artifact-ruby.yml
vendored
@ -18,14 +18,12 @@ jobs:
|
||||
- name: Build Artifact
|
||||
run: |
|
||||
cd ${{ github.workspace }}
|
||||
cwd=$(pwd)
|
||||
git submodule update --init --recursive
|
||||
cd ./web/documentserver-example/ruby
|
||||
mkdir -p ./deploy/'Ruby Example'
|
||||
rsync -av --exclude='deploy' ./ ./deploy/'Ruby Example'
|
||||
cd ./deploy/'Ruby Example'/public/assets
|
||||
rm -rf ./.git/
|
||||
rm .git
|
||||
rm -rf ./deploy/'Ruby Example'/public/assets/document-formats/.git
|
||||
rm -rf ./deploy/'Ruby Example'/public/assets/document-templates/.git
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
|
||||
5
.github/workflows/artifact-spring.yml
vendored
@ -23,9 +23,8 @@ jobs:
|
||||
cd ./web/documentserver-example/java-spring
|
||||
mkdir -p ./deploy/'Java Spring Example'
|
||||
rsync -av --exclude='deploy' ./ ./deploy/'Java Spring Example'
|
||||
cd ./deploy/'Java Spring Example'/src/main/resources/assets
|
||||
rm -rf ./.git/
|
||||
rm .git
|
||||
rm -rf ./deploy/'Java Spring Example'/src/main/resources/assets/document-formats/.git
|
||||
rm -rf ./deploy/'Java Spring Example'/src/main/resources/assets/document-templates/.git
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
|
||||
6
.github/workflows/lint-python.yml
vendored
@ -32,9 +32,9 @@ jobs:
|
||||
|
||||
- name: Lint Flake8
|
||||
run: |
|
||||
flake8 ./**/*.py --count --select=E9,F63,F7,F82 --show-source --statistics
|
||||
flake8 ./**/*.py --count --max-complexity=10 --max-line-length=79 --statistics
|
||||
flake8 --count --select=E9,F63,F7,F82 --show-source --statistics
|
||||
flake8 --count --max-complexity=10 --max-line-length=79 --statistics
|
||||
|
||||
- name: Lint Pylint
|
||||
run: |
|
||||
pylint ./**/*.py
|
||||
find . -type f -name "*.py" | xargs pylint
|
||||
|
||||
32
.github/workflows/lint-ruby.yml
vendored
@ -16,16 +16,22 @@ jobs:
|
||||
run:
|
||||
working-directory: ./web/documentserver-example/ruby
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
- uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: '3.0'
|
||||
bundler-cache: true
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
bundle install
|
||||
- name: Rubocop
|
||||
run: |
|
||||
gem install rubocop
|
||||
rubocop
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: '3.2.2'
|
||||
|
||||
- name: Update Submodules
|
||||
run: |
|
||||
git submodule update --init --recursive
|
||||
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
bundle update
|
||||
|
||||
- name: Rubocop
|
||||
run: |
|
||||
bundle exec rubocop
|
||||
|
||||
59
.github/workflows/release.yml
vendored
@ -13,8 +13,10 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Install Zip
|
||||
run: sudo apt-get install zip
|
||||
- name: Clone Submodules
|
||||
run: |
|
||||
cd ${{ github.workspace }}
|
||||
git submodule update --init --recursive
|
||||
- name: Get Info
|
||||
run: |
|
||||
echo "version=$(grep -Eo '[0-9]+(\.[0-9]+)+' CHANGELOG.md | head -n 1)" >> $GITHUB_OUTPUT
|
||||
@ -25,91 +27,66 @@ jobs:
|
||||
- name: Build Csharp MVC Artifact
|
||||
run: |
|
||||
cd ${{ github.workspace }}
|
||||
cwd=$(pwd)
|
||||
git submodule update --init --recursive
|
||||
cd ./web/documentserver-example/csharp-mvc
|
||||
mkdir -p ./'DotNet (Csharp MVC) Example'
|
||||
rsync -av --exclude='DotNet (Csharp MVC) Example' ./ ./'DotNet (Csharp MVC) Example'
|
||||
cd ./'DotNet (Csharp MVC) Example'/assets
|
||||
rm -rf ./.git/
|
||||
rm .git
|
||||
rm -rf .git
|
||||
- name: Build Csharp Artifact
|
||||
run: |
|
||||
cd ${{ github.workspace }}
|
||||
cwd=$(pwd)
|
||||
git submodule update --init --recursive
|
||||
cd ./web/documentserver-example/csharp
|
||||
mkdir -p ./'DotNet (Csharp) Example'
|
||||
rsync -av --exclude='DotNet (Csharp) Example' ./ ./'DotNet (Csharp) Example'
|
||||
cd ./'DotNet (Csharp) Example'/assets
|
||||
rm -rf ./.git/
|
||||
rm .git
|
||||
rm -rf ./'DotNet (Csharp) Example'/assets/.git
|
||||
- name: Build Java Artifact
|
||||
run: |
|
||||
cd ${{ github.workspace }}
|
||||
cwd=$(pwd)
|
||||
git submodule update --init --recursive
|
||||
cd ./web/documentserver-example/java
|
||||
mkdir -p ./'Java Example'
|
||||
rsync -av --exclude='Java Example' ./ ./'Java Example'
|
||||
cd ./'Java Example'/src/main/resources/assets
|
||||
rm -rf ./.git/
|
||||
rm .git
|
||||
rm -rf ./'Java Example'/src/main/resources/assets/document-formats/.git
|
||||
rm -rf ./'Java Example'/src/main/resources/assets/document-templates/.git
|
||||
- name: Build Nodejs Artifact
|
||||
run: |
|
||||
cd ${{ github.workspace }}
|
||||
cwd=$(pwd)
|
||||
git submodule update --init --recursive
|
||||
cd ./web/documentserver-example/nodejs
|
||||
mkdir -p ./'Node.js Example'
|
||||
rsync -av --exclude='Node.js Example' ./ ./'Node.js Example'
|
||||
cd ./'Node.js Example'/public/assets
|
||||
rm -rf ./.git/
|
||||
rm .git
|
||||
rm -rf ./'Node.js Example'/public/assets/document-formats/.git
|
||||
rm -rf ./'Node.js Example'/public/assets/document-templates/.git
|
||||
- name: Build PHP Artifact
|
||||
run: |
|
||||
cd ${{ github.workspace }}
|
||||
cwd=$(pwd)
|
||||
git submodule update --init --recursive
|
||||
cd ./web/documentserver-example/php
|
||||
mkdir -p ./'PHP Example'
|
||||
rsync -av --exclude='PHP Example' ./ ./'PHP Example'
|
||||
cd ./'PHP Example'/assets
|
||||
rm -rf ./.git/
|
||||
rm .git
|
||||
rm -rf ./'PHP Example'/assets/document-formats/.git
|
||||
rm -rf ./'PHP Example'/assets/document-templates/.git
|
||||
- name: Build Python Artifact
|
||||
run: |
|
||||
cd ${{ github.workspace }}
|
||||
cwd=$(pwd)
|
||||
git submodule update --init --recursive
|
||||
cd ./web/documentserver-example/python
|
||||
mkdir -p ./'Python Example'
|
||||
rsync -av --exclude='Python Example' ./ ./'Python Example'
|
||||
cd ./'Python Example'/assets
|
||||
rm -rf ./.git/
|
||||
rm .git
|
||||
rm -rf ./'Python Example'/assets/document-formats/.git
|
||||
rm -rf ./'Python Example'/assets/document-templates/.git
|
||||
- name: Build Ruby Artifact
|
||||
run: |
|
||||
cd ${{ github.workspace }}
|
||||
cwd=$(pwd)
|
||||
git submodule update --init --recursive
|
||||
cd ./web/documentserver-example/ruby
|
||||
mkdir -p ./'Ruby Example'
|
||||
rsync -av --exclude='Ruby Example' ./ ./'Ruby Example'
|
||||
cd ./'Ruby Example'/public/assets
|
||||
rm -rf ./.git/
|
||||
rm .git
|
||||
rm -rf ./'Ruby Example'/public/assets/document-formats/.git
|
||||
rm -rf ./'Ruby Example'/public/assets/document-templates/.git
|
||||
- name: Build Spring Artifact
|
||||
run: |
|
||||
cd ${{ github.workspace }}
|
||||
cwd=$(pwd)
|
||||
git submodule update --init --recursive
|
||||
cd ./web/documentserver-example/java-spring
|
||||
mkdir -p ./'Java Spring Example'
|
||||
rsync -av --exclude='Java Spring Example' ./ ./'Java Spring Example'
|
||||
cd ./'Java Spring Example'/src/main/resources/assets
|
||||
rm -rf ./.git/
|
||||
rm .git
|
||||
rm -rf ./'Java Spring Example'/src/main/resources/assets/document-formats/.git
|
||||
rm -rf ./'Java Spring Example'/src/main/resources/assets/document-templates/.git
|
||||
- name: Pack Artifacts
|
||||
run: |
|
||||
cd ${{ github.workspace }}/web/documentserver-example/csharp-mvc
|
||||
|
||||
@ -1,19 +1,20 @@
|
||||
# Change Log
|
||||
|
||||
## 1.7.0
|
||||
- nodejs: onRequestSelectDocument method
|
||||
- nodejs: onRequestSelectSpreadsheet method
|
||||
- nodejs: onRequestOpen
|
||||
- nodejs: submitForm
|
||||
- nodejs: key in referenceData
|
||||
- nodejs: change reference source
|
||||
- php: using a repo with a list of formats
|
||||
- nodejs: using a repo with a list of formats
|
||||
- nodejs: delete file without reloading the page
|
||||
- nodejs: getting history by a separate request
|
||||
- nodejs: restore from history
|
||||
- php: using a repo with a list of formats
|
||||
- php: restore from history
|
||||
- python: restore from history
|
||||
- ruby: restore from history
|
||||
- php: restore from history
|
||||
- csharp-mvc: getting history by a separate request
|
||||
- csharp-mvc: restore from history
|
||||
- csharp: getting history by a separate request
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0"?>
|
||||
<appSettings>
|
||||
<clear />
|
||||
<add key="version" value="1.6.0"/>
|
||||
<add key="version" value="1.7.0"/>
|
||||
|
||||
<add key="filesize-max" value="52428800"/>
|
||||
<add key="storage-path" value=""/>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<appSettings>
|
||||
<clear />
|
||||
<add key="version" value="1.6.0"/>
|
||||
<add key="version" value="1.7.0"/>
|
||||
|
||||
<add key="filesize-max" value="52428800"/>
|
||||
<add key="storage-path" value=""/>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
server.version=1.6.0
|
||||
server.version=1.7.0
|
||||
|
||||
server.address=
|
||||
server.port=4000
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
version=1.6.0
|
||||
version=1.7.0
|
||||
|
||||
filesize-max=5242880
|
||||
storage-folder=app_data
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2023
|
||||
*
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "1.6.0",
|
||||
"version": "1.7.0",
|
||||
"log": {
|
||||
"appenders": [
|
||||
{
|
||||
|
||||
@ -152,9 +152,9 @@ DocManager.prototype.saveFileData = function saveFileData(fileName, userid, user
|
||||
// get full creation date of the document
|
||||
const dateCreate = fileSystem.statSync(this.storagePath(fileName, address)).mtime;
|
||||
const minutes = (dateCreate.getMinutes() < 10 ? '0' : '') + dateCreate.getMinutes().toString();
|
||||
const month = (dateCreate.getMonth() < 10 ? '0' : '') + (parseInt(dateCreate.getMonth().toString(), 10) + 1);
|
||||
const month = (dateCreate.getMonth() < 9 ? '0' : '') + (parseInt(dateCreate.getMonth().toString(), 10) + 1);
|
||||
const sec = (dateCreate.getSeconds() < 10 ? '0' : '') + dateCreate.getSeconds().toString();
|
||||
const dateFormat = `${dateCreate.getFullYear()}-${month}-${dateCreate.getDate()}`
|
||||
const dateFormat = `${dateCreate.getFullYear()}-${month}-${dateCreate.getDate()} `
|
||||
+ `${dateCreate.getHours()}:${minutes}:${sec}`;
|
||||
|
||||
const fileInfo = this.historyPath(fileName, address, true); // get file history information
|
||||
@ -534,7 +534,7 @@ DocManager.prototype.getHistory = function getHistory(fileName, content, keyVers
|
||||
|
||||
if (content && contentJson) {
|
||||
userNameFromJson = oldVersion ? contentJson.username : contentJson.user.name;
|
||||
userIdFromJson = oldVersion ? contentJson.userid : contentJson.user.userid;
|
||||
userIdFromJson = oldVersion ? contentJson.userid : contentJson.user.id;
|
||||
createdFromJson = oldVersion ? contentJson.date : contentJson.created;
|
||||
}
|
||||
|
||||
|
||||
@ -34,13 +34,15 @@ const requestDiscovery = async function requestDiscovery(url) {
|
||||
urllib.request(urlModule.parse(url + configServer.get('wopi.discovery')), { method: 'GET' }, (err, data) => {
|
||||
if (data) {
|
||||
// create the discovery XML file with the parameters from the response
|
||||
const discovery = xmlParser.parse(data.toString(), {
|
||||
const xmlParseOptions = {
|
||||
attributeNamePrefix: '',
|
||||
ignoreAttributes: false,
|
||||
parseAttributeValue: true,
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
attrValueProcessor: (val, attrName) => he.decode(val, { isAttributeValue: true }),
|
||||
});
|
||||
attrValueProcessor: (val) => he.decode(val, { isAttributeValue: true }),
|
||||
};
|
||||
const parser = new xmlParser.XMLParser(xmlParseOptions);
|
||||
// create the discovery XML file with the parameters from the response
|
||||
const discovery = parser.parse(data.toString());
|
||||
if (discovery['wopi-discovery']) {
|
||||
discovery['wopi-discovery']['net-zone'].app.forEach((app) => {
|
||||
let appAction = app.action;
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
"debug": "^4.2.0",
|
||||
"ejs": "^3.1.5",
|
||||
"express": "^4.17.1",
|
||||
"fast-xml-parser": "^3.19.0",
|
||||
"fast-xml-parser": "^4.3.1",
|
||||
"formidable": "^1.2.2",
|
||||
"he": "^1.2.0",
|
||||
"jsonwebtoken": "^9.0.0",
|
||||
@ -1509,15 +1509,24 @@
|
||||
"integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc="
|
||||
},
|
||||
"node_modules/fast-xml-parser": {
|
||||
"version": "3.19.0",
|
||||
"resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-3.19.0.tgz",
|
||||
"integrity": "sha512-4pXwmBplsCPv8FOY1WRakF970TjNGnGnfbOnLqjlYvMiF1SR3yOHyxMR/YCXpPTOspNF5gwudqktIP4VsWkvBg==",
|
||||
"bin": {
|
||||
"xml2js": "cli.js"
|
||||
"version": "4.3.1",
|
||||
"resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.3.1.tgz",
|
||||
"integrity": "sha512-viVv3xb8D+SiS1W4cv4tva3bni08kAkx0gQnWrykMM8nXPc1FxqZPU00dCEVjkiCg4HoXd2jC4x29Nzg/l2DAA==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "paypal",
|
||||
"url": "https://paypal.me/naturalintelligence"
|
||||
},
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/NaturalIntelligence"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"strnum": "^1.0.5"
|
||||
},
|
||||
"funding": {
|
||||
"type": "paypal",
|
||||
"url": "https://paypal.me/naturalintelligence"
|
||||
"bin": {
|
||||
"fxparser": "src/cli/cli.js"
|
||||
}
|
||||
},
|
||||
"node_modules/fastq": {
|
||||
@ -3515,6 +3524,11 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/strnum": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz",
|
||||
"integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA=="
|
||||
},
|
||||
"node_modules/supports-color": {
|
||||
"version": "5.5.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
|
||||
@ -4993,9 +5007,12 @@
|
||||
"integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc="
|
||||
},
|
||||
"fast-xml-parser": {
|
||||
"version": "3.19.0",
|
||||
"resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-3.19.0.tgz",
|
||||
"integrity": "sha512-4pXwmBplsCPv8FOY1WRakF970TjNGnGnfbOnLqjlYvMiF1SR3yOHyxMR/YCXpPTOspNF5gwudqktIP4VsWkvBg=="
|
||||
"version": "4.3.1",
|
||||
"resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.3.1.tgz",
|
||||
"integrity": "sha512-viVv3xb8D+SiS1W4cv4tva3bni08kAkx0gQnWrykMM8nXPc1FxqZPU00dCEVjkiCg4HoXd2jC4x29Nzg/l2DAA==",
|
||||
"requires": {
|
||||
"strnum": "^1.0.5"
|
||||
}
|
||||
},
|
||||
"fastq": {
|
||||
"version": "1.13.0",
|
||||
@ -6511,6 +6528,11 @@
|
||||
"integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
|
||||
"dev": true
|
||||
},
|
||||
"strnum": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz",
|
||||
"integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA=="
|
||||
},
|
||||
"supports-color": {
|
||||
"version": "5.5.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
"debug": "^4.2.0",
|
||||
"ejs": "^3.1.5",
|
||||
"express": "^4.17.1",
|
||||
"fast-xml-parser": "^3.19.0",
|
||||
"fast-xml-parser": "^4.3.1",
|
||||
"formidable": "^1.2.2",
|
||||
"he": "^1.2.0",
|
||||
"jsonwebtoken": "^9.0.0",
|
||||
|
||||
@ -1,8 +1 @@
|
||||
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M0 3C0 1.34315 1.34315 0 3 0H21.674C22.4697 0 23.2327 0.316071 23.7953 0.87868L29.1213 6.20465C29.6839 6.76726 30 7.53032 30 8.32597V37C30 38.6569 28.6569 40 27 40H3C1.34315 40 0 38.6569 0 37V3Z" fill="#3779A6"/>
|
||||
<path d="M22.9167 0L30.0001 7.08333H25.9167C24.2599 7.08333 22.9167 5.74019 22.9167 4.08333V0Z" fill="#1D5880"/>
|
||||
<path d="M6.17627 14.7059H23.8233V15.8823H6.17627V14.7059Z" fill="white"/>
|
||||
<path d="M6.17627 18.5294H23.8233V19.7059H6.17627V18.5294Z" fill="white"/>
|
||||
<path d="M6.17627 22.3529H23.8233V23.5294H6.17627V22.3529Z" fill="white"/>
|
||||
<path d="M6.17627 26.1765H23.8233V27.3529H6.17627V26.1765Z" fill="white"/>
|
||||
</svg>
|
||||
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 3c0-1.65685 1.34315-3 3-3h20l7 7v30c0 1.6569-1.3431 3-3 3H3c-1.65685 0-3-1.3431-3-3V3z" fill="#1E7AAA"/><path d="M23 0l7 7h-4c-1.6569 0-3-1.34315-3-3V0z" fill="#000" fill-opacity=".25"/><path d="M6 15h18v1H6v-1zM6 19h18v1H6v-1zM6 23h18v1H6v-1zM6 27h18v1H6v-1z" fill="#fff"/></svg>
|
||||
|
Before Width: | Height: | Size: 738 B After Width: | Height: | Size: 387 B |
@ -1,6 +1 @@
|
||||
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M0 3C0 1.34315 1.34315 0 3 0H22.9167L30 7.08333V37C30 38.6569 28.6569 40 27 40H3C1.34315 40 0 38.6569 0 37V3Z" fill="#27ABA3"/>
|
||||
<path d="M22.9165 0L29.9998 7.08333H25.9165C24.2597 7.08333 22.9165 5.74019 22.9165 4.08333V0Z" fill="#008078"/>
|
||||
<rect x="6.5" y="15.5" width="17" height="5" stroke="white"/>
|
||||
<rect x="6.5" y="23.5" width="17" height="5" stroke="white"/>
|
||||
</svg>
|
||||
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 3c0-1.65685 1.34315-3 3-3h20l7 7v30c0 1.6569-1.3431 3-3 3H3c-1.65685 0-3-1.3431-3-3V3z" fill="#27ABA3"/><path d="M23 0l7 7h-4c-1.6569 0-3-1.34315-3-3V0z" fill="#008078"/><path fill-rule="evenodd" clip-rule="evenodd" d="M24 14H6v7h18v-7zm-.8182 5.9978H6.81818V15H23.1818v4.9978zM24 23H6v7h18v-7zm-.8182 5.9978H6.81818V24H23.1818v4.9978z" fill="#fff"/></svg>
|
||||
|
Before Width: | Height: | Size: 477 B After Width: | Height: | Size: 463 B |
@ -1,8 +1 @@
|
||||
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M0 3C0 1.34315 1.34315 0 3 0H22.9167L30 7.08333V37C30 38.6569 28.6569 40 27 40H3C1.34315 40 0 38.6569 0 37V3Z" fill="#F36700"/>
|
||||
<path d="M22.9167 0L30.0001 7.08333H25.9168C24.2599 7.08333 22.9167 5.74019 22.9167 4.08333V0Z" fill="#AB531F"/>
|
||||
<path d="M6.17627 16.1275H23.8233V17.3039H6.17627V16.1275Z" fill="white"/>
|
||||
<path d="M6.17627 28.7745L6.17627 16.1275L7.35274 16.1275L7.35274 28.7745H6.17627Z" fill="white"/>
|
||||
<path d="M23.8233 16.1275V28.7745H22.6469V16.1275L23.8233 16.1275Z" fill="white"/>
|
||||
<path d="M6.17627 27.598H23.8233V28.7745H6.17627L6.17627 27.598Z" fill="white"/>
|
||||
</svg>
|
||||
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 3c0-1.65685 1.34315-3 3-3h20l7 7v30c0 1.6569-1.3431 3-3 3H3c-1.65685 0-3-1.3431-3-3V3z" fill="#F36700"/><path d="M23 0l7 7h-4c-1.6569 0-3-1.34315-3-3V0z" fill="#000" fill-opacity=".25"/><path stroke="#fff" stroke-opacity=".95" d="M6.5 15.5h17v12h-17z"/></svg>
|
||||
|
Before Width: | Height: | Size: 691 B After Width: | Height: | Size: 366 B |
@ -1,6 +1 @@
|
||||
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M30 7.44186L22 0H3C1.22739 0 0 0.822551 0 2.32558V37.2093C0 38.7123 1.22739 40 3 40H27C28.7726 40 30 38.7123 30 37.2093V7.44186Z" fill="#D0D5DA"/>
|
||||
<path d="M24.1042 7.27273H29.9631L22 0V5.32334C22 6.4105 22.949 7.27273 24.1042 7.27273Z" fill="#646464"/>
|
||||
<path d="M16.9562 22.3485H12.9746V17.803H10.9839L14.9654 14.1667L18.947 17.803H16.9562V22.3485Z" fill="#646464"/>
|
||||
<path d="M20.9378 23.7121C20.9378 24.1666 20.4401 24.6212 19.9424 24.6212H9.98848C9.49078 24.6212 8.99309 24.1666 8.99309 23.7121V22.3485C8.99309 21.8939 9.49078 21.4394 9.98848 21.4394H10.9839V20.0757H9.49078C8.49539 20.0757 7.5 20.9848 7.5 21.8939V24.1666C7.5 25.0757 8.61982 25.9848 9.49078 25.9848H20.4401C21.3111 25.9848 22.4309 25.0757 22.4309 24.1666V21.8939C22.4309 20.9848 21.4355 20.0757 20.4401 20.0757H18.947V21.4394H19.9424C20.4401 21.4394 20.9378 21.8939 20.9378 22.3485V23.7121Z" fill="#646464"/>
|
||||
</svg>
|
||||
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 3c0-1.65685 1.34315-3 3-3h20l7 7v30c0 1.6569-1.3431 3-3 3H3c-1.65685 0-3-1.3431-3-3V3z" fill="#D0D5DA"/><path d="M23 0l7 7h-4c-1.6569 0-3-1.34315-3-3V0z" fill="#646464"/><path fill-rule="evenodd" clip-rule="evenodd" d="M7.5 23c-.27614 0-.5.2239-.5.5v4c0 .2761.22386.5.5.5h15c.2761 0 .5-.2239.5-.5v-4c0-.2761-.2239-.5-.5-.5h-2c-.2761 0-.5-.2239-.5-.5s.2239-.5.5-.5h2c.8284 0 1.5.6716 1.5 1.5v4c0 .8284-.6716 1.5-1.5 1.5h-15c-.82843 0-1.5-.6716-1.5-1.5v-4c0-.8284.67157-1.5 1.5-1.5h2c.27614 0 .5.2239.5.5s-.22386.5-.5.5h-2z" fill="#646464"/><path fill-rule="evenodd" clip-rule="evenodd" d="M20 20.0001L15 14l-5 6.0001h3v4c0 .5523.4477 1 1 1h2c.5523 0 1-.4477 1-1v-4h3z" fill="#646464"/></svg>
|
||||
|
Before Width: | Height: | Size: 992 B After Width: | Height: | Size: 797 B |
@ -1,12 +1 @@
|
||||
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M0 3C0 1.34315 1.34315 0 3 0H22.9167L30 7.08333V37C30 38.6569 28.6569 40 27 40H3C1.34315 40 0 38.6569 0 37V3Z" fill="#78A73B"/>
|
||||
<path d="M22.9167 0L30.0001 7.08333H25.9168C24.2599 7.08333 22.9167 5.74019 22.9167 4.08333V0Z" fill="#5A7D2B"/>
|
||||
<path d="M6.17644 15.2941H23.8235V16.4706H6.17644V15.2941Z" fill="white"/>
|
||||
<path d="M6.17644 19.1177H23.8235V20.2941H6.17644V19.1177Z" fill="white"/>
|
||||
<path d="M6.17644 22.9412H23.8235V24.1177H6.17644V22.9412Z" fill="white"/>
|
||||
<path d="M6.17644 26.7647H23.8235V27.9412H6.17644V26.7647Z" fill="white"/>
|
||||
<path d="M5.88232 27.9412L5.88232 15.2941L7.0588 15.2941L7.0588 27.9412H5.88232Z" fill="white"/>
|
||||
<path d="M11.4706 27.9412L11.4706 15.2941L12.647 15.2941V27.9412H11.4706Z" fill="white"/>
|
||||
<path d="M17.0588 27.9412L17.0588 15.2941L18.2353 15.2941V27.9412H17.0588Z" fill="white"/>
|
||||
<path d="M22.647 27.9412V15.2941H23.8235V27.9412H22.647Z" fill="white"/>
|
||||
</svg>
|
||||
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 3c0-1.65685 1.34315-3 3-3h20l7 7v30c0 1.6569-1.3431 3-3 3H3c-1.65685 0-3-1.3431-3-3V3z" fill="#6AAA1E"/><path d="M23 0l7 7h-4c-1.6569 0-3-1.34315-3-3V0z" fill="#000" fill-opacity=".25"/><path fill-rule="evenodd" clip-rule="evenodd" d="M6 15h18v13H7.00001v-1H12v-3H7v4H6V15zm7 12h4v-3h-4v3zm5 0h5v-3h-5v3zm5-7v3h-5v-3h5zm-6 0v3h-4v-3h4zm-5 0v3H7v-3h5zm11-1v-3h-5v3h5zm-10-3h4v3h-4v-3zm-1 3v-3H7v3h5z" fill="#fff" fill-opacity=".95"/></svg>
|
||||
|
Before Width: | Height: | Size: 1004 B After Width: | Height: | Size: 545 B |
@ -1,212 +1,85 @@
|
||||
## Overview
|
||||
|
||||
This example will help you integrate ONLYOFFICE Docs into your web application written in PHP.
|
||||
This example will help you integrate ONLYOFFICE Docs into your web application written on PHP.
|
||||
|
||||
**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.
|
||||
> [!WARNING]
|
||||
> 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.
|
||||
|
||||
## For Windows
|
||||
## Installation
|
||||
|
||||
### Step 1. Install ONLYOFFICE Docs
|
||||
The PHP example offers various installation options, but we highly recommend using Docker for this purpose.
|
||||
|
||||
Download and install ONLYOFFICE Docs (packaged as Document Server).
|
||||
### Using Docker
|
||||
|
||||
See the detailed guide to learn how to [install Document Server for Windows](https://helpcenter.onlyoffice.com/installation/docs-developer-install-windows.aspx?from=api_php_example).
|
||||
To run the example using [Docker](https://docker.com), you will need [Docker Desktop 4.17.0](https://docs.docker.com/desktop) or [Docker Engine 20.10.23](https://docs.docker.com/engine) with [Docker Compose 2.15.1](https://docs.docker.com/compose). Additionally, you might want to consider installing [GNU Make 4.4.1](https://gnu.org/software/make), although it is optional. These are the minimum versions required for the tools.
|
||||
|
||||
### Step 2. Download the PHP code for the editors integration
|
||||
Once you have everything installed, download the release archive and unarchive it.
|
||||
|
||||
Download the [PHP example](https://api.onlyoffice.com/editors/demopreview) 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.json* file:
|
||||
|
||||
```
|
||||
"storagePath" = "";
|
||||
"docServSiteUrl" = "https://documentserver/";
|
||||
```sh
|
||||
$ curl --output PHP.Example.zip --location https://github.com/ONLYOFFICE/document-server-integration/releases/latest/download/PHP.Example.zip
|
||||
$ unzip PHP.Example.zip
|
||||
```
|
||||
|
||||
where the **documentserver** is the name of the server with the ONLYOFFICE Document Server installed and the **storagePath** is the path 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.
|
||||
Then open the example directory and [up containers](./Makefile#L60).
|
||||
|
||||
If you want to experiment with the editor configuration, modify the [parameters](https://api.onlyoffice.com/editors/advanced) in the *doceditor.php* file.
|
||||
```sh
|
||||
$ cd "PHP Example"
|
||||
$ make compose-prod
|
||||
```
|
||||
|
||||
### Step 3. Install the prerequisites
|
||||
By default, the server starts at `localhost:80`.
|
||||
|
||||
You can use any web server capable of running PHP code to run the example. We will demonstrate how to run the PHP example using the **Internet Information Services (IIS)** web server. To set up and configure PHP on IIS, **PHP Manager for IIS** will be used.
|
||||
To configure the example, you can edit the environment variables in [`docker-compose.yml`](./docker-compose.yml). See [below](#configuration) for more information about environment variables.
|
||||
|
||||
* **IIS**: version 7 or later (refer to [Microsoft official website](https://www.iis.net/learn/application-frameworks/scenario-build-a-php-website-on-iis/configuring-step-1-install-iis-and-php) to learn how to install IIS);
|
||||
* **PHP** (download it from the [http://php.net](https://php.net/downloads.php) site);
|
||||
* **PHP Manager for IIS** (download it from the [Microsoft open source site](https://phpmanager.codeplex.com/releases/view/69115)).
|
||||
* **Composer** (download it from the [Composer official website](https://getcomposer.org/download/)).
|
||||
### On Local Machine
|
||||
|
||||
### Step 4. IIS configuration
|
||||
Before diving into the example, you will need to install ONLYOFFICE Document Server (also known as Docs). Check the detailed guide to learn how to install it on [Windows](https://helpcenter.onlyoffice.com/installation/docs-developer-install-windows.aspx), [Linux](https://helpcenter.onlyoffice.com/installation/docs-developer-install-ubuntu.aspx), or [Docker](https://helpcenter.onlyoffice.com/installation/docs-developer-install-docker.aspx).
|
||||
|
||||
1. **PHP Manager for IIS** configuration.
|
||||
To run the example on your local machine, you will need [PHP 8.2.11](https://php.net) with [Composer 2.6.5](https://getcomposer.org). Additionally, you might want to consider installing [GNU Make 4.4.1](https://gnu.org/software/make), although it is optional. These are the minimum versions required for the tools.
|
||||
|
||||
After PHP Manager for IIS installation is complete, launch the **IIS Manager:**
|
||||
Once you have everything installed, download the release archive and unarchive it.
|
||||
|
||||
**Start** -> **Control Panel** -> **System and Security** -> **Administrative Tools** -> **Internet Information Services (IIS) Manager**
|
||||
```sh
|
||||
$ curl --output PHP.Example.zip --location https://github.com/ONLYOFFICE/document-server-integration/releases/latest/download/PHP.Example.zip
|
||||
$ unzip PHP.Example.zip
|
||||
```
|
||||
|
||||
and find the **PHP Manager** feature in the **Features View** in IIS.
|
||||
Then open the example directory, [install dependencies](./Makefile#L16), and [start the server](./Makefile#L40).
|
||||
|
||||

|
||||
```sh
|
||||
$ cd "PHP Example"
|
||||
$ make prod
|
||||
$ make server-prod
|
||||
```
|
||||
|
||||
You need to register the installed PHP version in IIS using PHP Manager.
|
||||
By default, the server starts at `0.0.0.0:9000`.
|
||||
|
||||
Double-click **PHP Manager** to open it, click the **Register new PHP version** task and specify the full path to the main PHP executable file location. For example: *C:\Program Files\PHP\php-cgi.exe*.
|
||||
To configure the example, you can pass the environment variables before the command that starts the server. See [below](#configuration) for more information about environment variables.
|
||||
|
||||

|
||||
|
||||
After clicking **OK**, the new **PHP version** will be registered with IIS and will become active.
|
||||
|
||||

|
||||
|
||||
2. Configure IIS to handle PHP requests.
|
||||
|
||||
For IIS to host PHP applications, you must add handler mapping that tells IIS to pass all the PHP-specific requests to the PHP application framework by using the **FastCGI** protocol.
|
||||
|
||||
Double-click the **Handler Mappings** feature:
|
||||
|
||||

|
||||
|
||||
In the **Action** panel, click **Add Module Mapping**. In the **Add Module Mapping** dialog box, specify the configuration settings as follows:
|
||||
|
||||
* **Request path**: *.php,
|
||||
* **Module**: FastCgiModule,
|
||||
* **Executable**: "C:\[Path to your PHP installation]\php-cgi.exe",
|
||||
* **Name**: PHP via FastCGI.
|
||||
|
||||
Click **OK**.
|
||||
|
||||

|
||||
|
||||
After IIS manager configuration is complete, everything is ready for running the PHP example.
|
||||
|
||||
### Step 5. Run *composer install*:
|
||||
|
||||
```
|
||||
php composer.phar install
|
||||
```
|
||||
|
||||
### Step 6. Run your website with the editors
|
||||
|
||||
1. Add your website in the IIS Manager.
|
||||
|
||||
On the **Connections** panel right-click the **Sites** node in the tree, then click **Add Website**.
|
||||
|
||||

|
||||
|
||||
2. In the **Add Website** dialog box, specify the name of the folder with the PHP project in the **Site name** box.
|
||||
|
||||
Specify the path to the folder with your project in the **Physical path** box.
|
||||
|
||||
Specify the unique value used only for this website in the **Port** box.
|
||||
|
||||

|
||||
|
||||
3. Browse your website with the IIS manager:
|
||||
|
||||
Right-click the site -> **Manage Website** -> **Browse**
|
||||
|
||||

|
||||
|
||||
### Step 7. Check accessibility
|
||||
## Post Installation
|
||||
|
||||
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.
|
||||
|
||||
## For Linux
|
||||
## Configuration
|
||||
|
||||
### Step 1. Install ONLYOFFICE Docs
|
||||
The example is configured by changing environment variables.
|
||||
|
||||
Download and install ONLYOFFICE Docs (packaged as Document Server).
|
||||
| Name | Description | Example |
|
||||
| ----------------------------- | ----------------------------------------------------------------------- | ----------------------- |
|
||||
| `ADDRESS` | The address where the server should be started. | `0.0.0.0` |
|
||||
| `PORT` | The port on which the server should be running. | `80` |
|
||||
| `DOCUMENT_SERVER_PRIVATE_URL` | The URL through which the server will communicate with Document Server. | `http://proxy:8080` |
|
||||
| `DOCUMENT_SERVER_PUBLIC_URL` | The URL through which a user will communicate with Document Server. | `http://localhost:8080` |
|
||||
| `EXAMPLE_URL` | The URL through which Document Server will communicate with the server. | `http://proxy` |
|
||||
| `JWT_SECRET` | JWT authorization secret. Leave blank to disable authorization. | `your-256-bit-secret` |
|
||||
|
||||
See the detailed guide to learn how to [install Document Server for Linux](https://helpcenter.onlyoffice.com/installation/docs-developer-install-ubuntu.aspx?from=api_php_example).
|
||||
|
||||
### Step 2. Install the prerequisites and run the website with the editors
|
||||
|
||||
1. Install **Apache** and **PHP**:
|
||||
|
||||
```
|
||||
apt-get install -y apache2 php7.0 libapache2-mod-php7.0
|
||||
```
|
||||
|
||||
2. Install **Composer**:
|
||||
|
||||
To install composer globally, use the following command which will download and install Composer as a system-wide command named composer, under /usr/local/bin:
|
||||
|
||||
```
|
||||
curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.php
|
||||
sudo php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer
|
||||
```
|
||||
|
||||
3. Download the archive with the PHP example and unpack the archive:
|
||||
|
||||
```
|
||||
cd /var/www/html
|
||||
```
|
||||
|
||||
```
|
||||
wget https://api.onlyoffice.com/app_data/editor/PHP%20Example.zip
|
||||
```
|
||||
|
||||
```
|
||||
unzip PHP\ Example.zip
|
||||
```
|
||||
|
||||
4. Change the current directory for the project directory:
|
||||
|
||||
```
|
||||
cd PHP\ Example/
|
||||
```
|
||||
|
||||
5. Edit the *config.json* configuration file. Specify the name of your local server with the ONLYOFFICE Document Server installed.
|
||||
|
||||
```
|
||||
nano config.json
|
||||
```
|
||||
|
||||
Edit the following lines:
|
||||
|
||||
```
|
||||
"storagePath" = "";
|
||||
"docServSiteUrl" = "https://documentserver/";
|
||||
```
|
||||
|
||||
where the **documentserver** is the name of the server with the ONLYOFFICE Document Server installed and the **STORAGE_PATH** is the path where files will be created and stored. You can set an absolute path.
|
||||
|
||||
6. Run *composer install*:
|
||||
|
||||
```
|
||||
php composer.phar install
|
||||
```
|
||||
7. Set permission for site:
|
||||
|
||||
```
|
||||
chown -R www-data:www-data /var/www/html
|
||||
```
|
||||
|
||||
8. Restart apache:
|
||||
|
||||
```
|
||||
service apache2 restart
|
||||
```
|
||||
|
||||
9. See the result in your browser using the address:
|
||||
|
||||
```
|
||||
http://localhost/PHP%20Example/
|
||||
```
|
||||
|
||||
### Step 3. Check accessibility
|
||||
|
||||
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.
|
||||
|
||||
## Important security info
|
||||
## Security Info
|
||||
|
||||
Please keep in mind the following security aspects when you are using test examples:
|
||||
|
||||
* There is no protection of the storage from unauthorized access since there is no need for authorization.
|
||||
* There are no checks against parameter substitution in links, since the parameters are generated by the code according to the pre-arranged scripts.
|
||||
* There are no data checks in requests of saving the file after editing, since each test example is intended for requests only from ONLYOFFICE Document Server.
|
||||
* There are no prohibitions on using test examples from other sites, since they are intended to interact with ONLYOFFICE Document Server from another domain.
|
||||
- There is no protection of the storage from unauthorized access since there is no need for authorization.
|
||||
- There are no checks against parameter substitution in links, since the parameters are generated by the code according to the pre-arranged scripts.
|
||||
- There are no data checks in requests of saving the file after editing, since each test example is intended for requests only from ONLYOFFICE Document Server.
|
||||
- There are no prohibitions on using test examples from other sites, since they are intended to interact with ONLYOFFICE Document Server from another domain.
|
||||
|
||||
@ -3,7 +3,7 @@ version: "3.8"
|
||||
services:
|
||||
document-server:
|
||||
container_name: document-server
|
||||
image: onlyoffice/documentserver:7.3.3.50
|
||||
image: onlyoffice/documentserver:7.5
|
||||
expose:
|
||||
- "80"
|
||||
environment:
|
||||
|
||||
@ -22,7 +22,7 @@ use Example\Common\URL;
|
||||
|
||||
class ConfigurationManager
|
||||
{
|
||||
public string $version = '1.6.0';
|
||||
public string $version = '1.7.0';
|
||||
|
||||
public function exampleURL(): ?URL
|
||||
{
|
||||
|
||||
86
web/documentserver-example/python/README.md
Executable file
@ -0,0 +1,86 @@
|
||||
## Overview
|
||||
|
||||
This example will help you integrate ONLYOFFICE Docs into your web application written on Python.
|
||||
|
||||
> [!WARNING]
|
||||
> 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.
|
||||
|
||||
## Installation
|
||||
|
||||
The Python example offers various installation options, but we highly recommend using Docker for this purpose.
|
||||
|
||||
### Using Docker
|
||||
|
||||
To run the example using [Docker](https://docker.com), you will need [Docker Desktop 4.17.0](https://docs.docker.com/desktop) or [Docker Engine 20.10.23](https://docs.docker.com/engine) with [Docker Compose 2.15.1](https://docs.docker.com/compose). Additionally, you might want to consider installing [GNU Make 4.4.1](https://gnu.org/software/make), although it is optional. These are the minimum versions required for the tools.
|
||||
|
||||
Once you have everything installed, download the release archive and unarchive it.
|
||||
|
||||
```sh
|
||||
$ curl --output Python.Example.zip --location https://github.com/ONLYOFFICE/document-server-integration/releases/latest/download/Python.Example.zip
|
||||
$ unzip Python.Example.zip
|
||||
```
|
||||
|
||||
Then open the example directory and [up containers](./Makefile#L38).
|
||||
|
||||
```sh
|
||||
$ cd "Python Example"
|
||||
$ make compose-prod
|
||||
```
|
||||
|
||||
By default, the server starts at `localhost:80`.
|
||||
|
||||
To configure the example, you can edit the environment variables in [`compose-base.yml`](./compose-base.yml). See [below](#configuration) for more information about environment variables.
|
||||
|
||||
### On Local Machine
|
||||
|
||||
Before diving into the example, you will need to install ONLYOFFICE Document Server (also known as Docs). Check the detailed guide to learn how to install it on [Windows](https://helpcenter.onlyoffice.com/installation/docs-developer-install-windows.aspx), [Linux](https://helpcenter.onlyoffice.com/installation/docs-developer-install-ubuntu.aspx), or [Docker](https://helpcenter.onlyoffice.com/installation/docs-developer-install-docker.aspx).
|
||||
|
||||
To run the example on your local machine, you will need [Python 3.11.4](https://python.org) with [pip 23.1.2](https://pip.pypa.io). Additionally, you might want to consider installing [GNU Make 4.4.1](https://gnu.org/software/make), although it is optional. These are the minimum versions required for the tools.
|
||||
|
||||
Once you have everything installed, download the release archive and unarchive it.
|
||||
|
||||
```sh
|
||||
$ curl --output Python.Example.zip --location https://github.com/ONLYOFFICE/document-server-integration/releases/latest/download/Python.Example.zip
|
||||
$ unzip Python.Example.zip
|
||||
```
|
||||
|
||||
Then open the example directory, [install dependencies](./Makefile#L13), and [start the server](./Makefile#L21).
|
||||
|
||||
```sh
|
||||
$ cd "Python Example"
|
||||
$ make prod
|
||||
$ make server-prod
|
||||
```
|
||||
|
||||
By default, the server starts at `0.0.0.0:8000`.
|
||||
|
||||
To configure the example, you can pass the environment variables before the command that starts the server. See [below](#configuration) for more information about environment variables.
|
||||
|
||||
## Post Installation
|
||||
|
||||
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.
|
||||
|
||||
## Configuration
|
||||
|
||||
The example is configured by changing environment variables.
|
||||
|
||||
| Name | Description | Example |
|
||||
| ----------------------------- | ----------------------------------------------------------------------- | ----------------------- |
|
||||
| `DEBUG` | Disable or enable debug mode. | `false` |
|
||||
| `ADDRESS` | The address where the server should be started. | `0.0.0.0` |
|
||||
| `PORT` | The port on which the server should be running. | `80` |
|
||||
| `DOCUMENT_SERVER_PRIVATE_URL` | The URL through which the server will communicate with Document Server. | `http://proxy:8080` |
|
||||
| `DOCUMENT_SERVER_PUBLIC_URL` | The URL through which a user will communicate with Document Server. | `http://localhost:8080` |
|
||||
| `EXAMPLE_URL` | The URL through which Document Server will communicate with the server. | `http://proxy` |
|
||||
| `JWT_SECRET` | JWT authorization secret. Leave blank to disable authorization. | `your-256-bit-secret` |
|
||||
|
||||
## Security Info
|
||||
|
||||
Please keep in mind the following security aspects when you are using test examples:
|
||||
|
||||
- There is no protection of the storage from unauthorized access since there is no need for authorization.
|
||||
- There are no checks against parameter substitution in links, since the parameters are generated by the code according to the pre-arranged scripts.
|
||||
- There are no data checks in requests of saving the file after editing, since each test example is intended for requests only from ONLYOFFICE Document Server.
|
||||
- There are no prohibitions on using test examples from other sites, since they are intended to interact with ONLYOFFICE Document Server from another domain.
|
||||
@ -3,7 +3,7 @@ version: "3.8"
|
||||
services:
|
||||
document-server:
|
||||
container_name: document-server
|
||||
image: onlyoffice/documentserver:7.3.3.50
|
||||
image: onlyoffice/documentserver:7.5
|
||||
expose:
|
||||
- "80"
|
||||
environment:
|
||||
|
||||
@ -1,82 +0,0 @@
|
||||
## Overview
|
||||
|
||||
This example will help you integrate ONLYOFFICE Docs into your web application written in Python.
|
||||
|
||||
**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.
|
||||
|
||||
## Step 1. Install ONLYOFFICE Docs
|
||||
|
||||
Download and install ONLYOFFICE Docs (packaged as Document Server).
|
||||
|
||||
See the detailed guide to learn how to install Document Server [for Windows](https://helpcenter.onlyoffice.com/installation/docs-developer-install-windows.aspx?from=api_python_example), [for Linux](https://helpcenter.onlyoffice.com/installation/docs-developer-install-ubuntu.aspx?from=api_python_example), or [for Docker](https://helpcenter.onlyoffice.com/server/developer-edition/docker/docker-installation.aspx?from=api_python_example).
|
||||
|
||||
## Step 2. Install the prerequisites and run the website with the editors
|
||||
|
||||
1. **Python** comes preinstalled on most Linux distributions, and is available as a package on all others. Python 3.9 is required. Please proceed to [official documentation](https://docs.python.org/3/using/unix.html) if you have any troubles.
|
||||
|
||||
2. Download the archive with the Python example and unpack it:
|
||||
|
||||
```
|
||||
wget "https://api.onlyoffice.com/app_data/editor/Python%20Example.zip"
|
||||
```
|
||||
|
||||
```
|
||||
unzip Python\ Example.zip
|
||||
```
|
||||
|
||||
3. Change the current directory for the project directory:
|
||||
|
||||
```
|
||||
cd Python\ Example
|
||||
```
|
||||
|
||||
4. Install the dependencies:
|
||||
|
||||
```
|
||||
pip install Django==3.1.3
|
||||
pip install requests==2.25.0
|
||||
pip install pyjwt==2.6.0
|
||||
pip install python-magic
|
||||
```
|
||||
|
||||
5. Edit the *config.py* configuration file. Specify the name of your local server with the ONLYOFFICE Document Server installed. And specify the name of the server on which example is installed.
|
||||
|
||||
```
|
||||
nano config.py
|
||||
```
|
||||
|
||||
Edit the following lines:
|
||||
|
||||
```
|
||||
STORAGE_PATH = 'app_data'
|
||||
DOC_SERV_SITE_URL = 'https://documentserver/'
|
||||
```
|
||||
|
||||
where the **documentserver** is the name of the server with the ONLYOFFICE Document Server installed and the **STORAGE_PATH** is the path 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.
|
||||
|
||||
6. Run the **Python** server:
|
||||
|
||||
```
|
||||
python manage.py runserver 0.0.0.0:8000
|
||||
```
|
||||
|
||||
7. See the result in your browser using the address:
|
||||
|
||||
```
|
||||
http://localhost:8000
|
||||
```
|
||||
|
||||
## Step 3. Check accessibility
|
||||
|
||||
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.
|
||||
|
||||
## Important security info
|
||||
|
||||
Please keep in mind the following security aspects when you are using test examples:
|
||||
|
||||
* There is no protection of the storage from unauthorized access since there is no need for authorization.
|
||||
* There are no checks against parameter substitution in links, since the parameters are generated by the code according to the pre-arranged scripts.
|
||||
* There are no data checks in requests of saving the file after editing, since each test example is intended for requests only from ONLYOFFICE Document Server.
|
||||
* There are no prohibitions on using test examples from other sites, since they are intended to interact with ONLYOFFICE Document Server from another domain.
|
||||
@ -21,7 +21,7 @@ from urllib.parse import ParseResult, urlparse, urljoin
|
||||
from src.common import string
|
||||
|
||||
class ConfigurationManager:
|
||||
version = '1.6.0'
|
||||
version = '1.7.0'
|
||||
|
||||
def example_url(self) -> Optional[ParseResult]:
|
||||
url = environ.get('EXAMPLE_URL')
|
||||
|
||||
@ -2,89 +2,84 @@
|
||||
|
||||
This example will help you integrate ONLYOFFICE Docs into your web application written on Ruby.
|
||||
|
||||
**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.
|
||||
> [!WARNING]
|
||||
> 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.
|
||||
|
||||
## Step 1. Install ONLYOFFICE Docs
|
||||
## Installation
|
||||
|
||||
Download and install ONLYOFFICE Docs (packaged as Document Server).
|
||||
The Ruby example offers various installation options, but we highly recommend using Docker for this purpose.
|
||||
|
||||
See the detailed guide to learn how to install Document Server [for Windows](https://helpcenter.onlyoffice.com/installation/docs-developer-install-windows.aspx), [for Linux](https://helpcenter.onlyoffice.com/installation/docs-developer-install-ubuntu.aspx), or [for Docker](https://helpcenter.onlyoffice.com/server/developer-edition/docker/docker-installation.aspx).
|
||||
### Using Docker
|
||||
|
||||
## Step 2. Install the prerequisites and run the website with the editors
|
||||
To run the example using [Docker](https://docker.com), you will need [Docker Desktop 4.17.0](https://docs.docker.com/desktop) or [Docker Engine 20.10.23](https://docs.docker.com/engine) with [Docker Compose 2.15.1](https://docs.docker.com/compose). Additionally, you might want to consider installing [GNU Make 4.4.1](https://gnu.org/software/make), although it is optional. These are the minimum versions required for the tools.
|
||||
|
||||
1. Install **Ruby Version Manager (RVM)** and the latest stable **Ruby** version:
|
||||
Once you have everything installed, download the release archive and unarchive it.
|
||||
|
||||
```
|
||||
gpg --keyserver "hkp://keys.gnupg.net" --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
|
||||
```
|
||||
```sh
|
||||
$ curl --output Ruby.Example.zip --location https://github.com/ONLYOFFICE/document-server-integration/releases/latest/download/Ruby.Example.zip
|
||||
$ unzip Ruby.Example.zip
|
||||
```
|
||||
|
||||
```
|
||||
\curl -sSL https://get.rvm.io | bash -s stable --ruby
|
||||
```
|
||||
Then open the example directory and [up containers](./Makefile#L46).
|
||||
|
||||
2. Download the archive with the Ruby example and unpack the archive:
|
||||
```sh
|
||||
$ cd "Ruby Example"
|
||||
$ make compose-prod
|
||||
```
|
||||
|
||||
```
|
||||
wget "https://api.onlyoffice.com/app_data/editor/Ruby%20Example.zip"
|
||||
```
|
||||
By default, the server starts at `localhost:80`.
|
||||
|
||||
```
|
||||
unzip Ruby\ Example.zip
|
||||
```
|
||||
To configure the example, you can edit the environment variables in [`compose-base.yml`](./compose-base.yml). See [below](#configuration) for more information about environment variables.
|
||||
|
||||
3. Change the current directory for the project directory:
|
||||
### On Local Machine
|
||||
|
||||
```
|
||||
cd Ruby\ Example
|
||||
```
|
||||
Before diving into the example, you will need to install ONLYOFFICE Document Server (also known as Docs). Check the detailed guide to learn how to install it on [Windows](https://helpcenter.onlyoffice.com/installation/docs-developer-install-windows.aspx), [Linux](https://helpcenter.onlyoffice.com/installation/docs-developer-install-ubuntu.aspx), or [Docker](https://helpcenter.onlyoffice.com/installation/docs-developer-install-docker.aspx).
|
||||
|
||||
4. Install the dependencies:
|
||||
To run the example on your local machine, you will need [Ruby 3.2.2](https://ruby-lang.org) with [Bundler 2.4.10](https://bundler.io). Additionally, you might want to consider installing [GNU Make 4.4.1](https://gnu.org/software/make), although it is optional. These are the minimum versions required for the tools.
|
||||
|
||||
```
|
||||
bundle install
|
||||
```
|
||||
Once you have everything installed, download the release archive and unarchive it.
|
||||
|
||||
5. Edit the *application.rb* configuration file. Specify the name of your local server with the ONLYOFFICE Document Server installed.
|
||||
```sh
|
||||
$ curl --output Ruby.Example.zip --location https://github.com/ONLYOFFICE/document-server-integration/releases/latest/download/Ruby.Example.zip
|
||||
$ unzip Ruby.Example.zip
|
||||
```
|
||||
|
||||
```
|
||||
nano config/application.rb
|
||||
```
|
||||
Then open the example directory, [install dependencies](./Makefile#L33), and [start the server](./Makefile#L42).
|
||||
|
||||
Edit the following lines:
|
||||
```sh
|
||||
$ cd "Ruby Example"
|
||||
$ make prod
|
||||
$ make server-prod
|
||||
```
|
||||
|
||||
```
|
||||
Rails.configuration.storagePath="app_data"
|
||||
Rails.configuration.urlSite="https://documentserver/"
|
||||
```
|
||||
By default, the server starts at `0.0.0.0:3000`.
|
||||
|
||||
where the **documentserver** is the name of the server with the ONLYOFFICE Document Server installed and the **storagePath** is the path 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.
|
||||
To configure the example, you can pass the environment variables before the command that starts the server. See [below](#configuration) for more information about environment variables.
|
||||
|
||||
6. Run the **Rails** application:
|
||||
|
||||
```
|
||||
rails server -u webrick
|
||||
rails s -b 0.0.0.0 -p 80
|
||||
```
|
||||
|
||||
7. See the result in your browser using the address:
|
||||
|
||||
```
|
||||
http://localhost
|
||||
```
|
||||
|
||||
If you want to experiment with the editor configuration, modify the [parameters](https://api.onlyoffice.com/editors/advanced) in the *views\home\editor.html.erb* file.
|
||||
|
||||
## Step 3. Check accessibility
|
||||
## Post Installation
|
||||
|
||||
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.
|
||||
|
||||
## Important security info
|
||||
## Configuration
|
||||
|
||||
The example is configured by changing environment variables.
|
||||
|
||||
| Name | Description | Example |
|
||||
| ------------- | ------------- | ------------- |
|
||||
| `BINDING` | The address where the server should be started. | `0.0.0.0` |
|
||||
| `DOCUMENT_SERVER_PRIVATE_URL` | The URL through which the server will communicate with Document Server. | `http://proxy:8080` |
|
||||
| `DOCUMENT_SERVER_PUBLIC_URL` | The URL through which a user will communicate with Document Server. | `http://localhost:8080` |
|
||||
| `EXAMPLE_URL` | The URL through which Document Server will communicate with the server. | `http://proxy` |
|
||||
| `JWT_SECRET` | JWT authorization secret. Leave blank to disable authorization. | `your-256-bit-secret` |
|
||||
| `PORT` | The port on which the server should be running. | `80` |
|
||||
|
||||
## Security Info
|
||||
|
||||
Please keep in mind the following security aspects when you are using test examples:
|
||||
|
||||
* There is no protection of the storage from unauthorized access since there is no need for authorization.
|
||||
* There are no checks against parameter substitution in links, since the parameters are generated by the code according to the pre-arranged scripts.
|
||||
* There are no data checks in requests of saving the file after editing, since each test example is intended for requests only from ONLYOFFICE Document Server.
|
||||
* There are no prohibitions on using test examples from other sites, since they are intended to interact with ONLYOFFICE Document Server from another domain.
|
||||
- There is no protection of the storage from unauthorized access since there is no need for authorization.
|
||||
- There are no checks against parameter substitution in links, since the parameters are generated by the code according to the pre-arranged scripts.
|
||||
- There are no data checks in requests of saving the file after editing, since each test example is intended for requests only from ONLYOFFICE Document Server.
|
||||
- There are no prohibitions on using test examples from other sites, since they are intended to interact with ONLYOFFICE Document Server from another domain.
|
||||
|
||||
@ -30,7 +30,7 @@ class ConfigurationManager
|
||||
|
||||
sig { void }
|
||||
def initialize
|
||||
@version = '1.6.0'
|
||||
@version = '1.7.0'
|
||||
end
|
||||
|
||||
sig { returns(T.nilable(URI::Generic)) }
|
||||
|
||||
@ -3,7 +3,7 @@ version: "3.8"
|
||||
services:
|
||||
document-server:
|
||||
container_name: document-server
|
||||
image: onlyoffice/documentserver:7.3.3.50
|
||||
image: onlyoffice/documentserver:7.5
|
||||
expose:
|
||||
- "80"
|
||||
environment:
|
||||
|
||||