From 82a21ed7ed8f2b7ae4f90b026501529cc5daa7f0 Mon Sep 17 00:00:00 2001 From: liberodark Date: Thu, 15 Nov 2018 11:44:00 +0100 Subject: [PATCH] Merge Beta Work to Master --- README.md | 12 +-- conf/default.json | 241 ++++++++++++++++++++++++++++++++++++++++++++++ conf/nginx.conf | 3 +- manifest.json | 90 ++++++++--------- scripts/install | 51 ++++++---- 5 files changed, 322 insertions(+), 75 deletions(-) create mode 100644 conf/default.json diff --git a/README.md b/README.md index 8544113..79b1e1f 100644 --- a/README.md +++ b/README.md @@ -9,23 +9,15 @@ OnlyOffice Document Server [![Install OnlyOffice with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=onlyoffice) -### Branch - -1. Master = Stable is version respect yunohost type install - -2. Beta = Beta is version for multi-instances (add possibility to install on same domain as nextcloud) - -3. Beta_work = Working version but run official commands of onlyoffice (two depots are installed nodejs and onlyoffice) - ### Installing guide 1. App can be installed by YunoHost **admin web-interface** or by **running following command**: - $ sudo yunohost app install https://github.com/liberodark/onlyoffice_ynh + $ sudo yunohost app install --debug https://github.com/liberodark/onlyoffice_ynh/tree/beta_work 1. Admin username is : **root**. ### Upgrade this package: - $ sudo yunohost app upgrade --verbose example -u https://github.com/liberodark/onlyoffice_ynh + $ sudo yunohost app upgrade --verbose example -u https://github.com/liberodark/onlyoffice_ynh/tree/beta diff --git a/conf/default.json b/conf/default.json new file mode 100644 index 0000000..0d0796f --- /dev/null +++ b/conf/default.json @@ -0,0 +1,241 @@ +{ + "statsd": { + "useMetrics": false, + "host": "localhost", + "port": "8125", + "prefix": "ds." + }, + "log": { + "filePath": "", + "options": { "reloadSecs": 60 } + }, + "queue": { + "visibilityTimeout": 300, + "retentionPeriod": 900 + }, + "storage": { + "name": "storage-fs", + "fs": { + "folderPath": "", + "urlExpires": 900, + "secretString": "onlyoffice" + }, + "region": "", + "endpoint": "http://localhost/s3", + "bucketName": "cache", + "storageFolderName": "files", + "urlExpires": 604800, + "accessKeyId": "AKID", + "secretAccessKey": "SECRET", + "useRequestToGetUrl": false, + "useSignedUrl": false, + "externalHost": "" + }, + "rabbitmq": { + "url": "amqp://guest:guest@localhost:5672", + "socketOptions": {}, + "exchangepubsub": "ds.pubsub", + "queueconverttask": "ds.converttask", + "queueconvertresponse": "ds.convertresponse", + "exchangeconvertdead": "ds.exchangeconvertdead", + "queueconvertdead": "ds.convertdead" + }, + "dnscache": { + "enable" : true, + "ttl" : 300, + "cachesize" : 1000 + }, + "services": { + "CoAuthoring": { + "server": { + "port": 8000, + "workerpercpu": 1, + "mode": "development", + "limits_tempfile_upload": 104857600, + "limits_image_size": 26214400, + "limits_image_download_timeout": 120, + "callbackRequestTimeout": 120, + "healthcheckfilepath": "../public/healthcheck.docx", + "savetimeoutdelay": 5000, + "edit_singleton": false, + "forgottenfiles": "forgotten", + "forgottenfilesname": "output", + "maxRequestChanges": 20000, + "openProtectedFile": true + }, + "requestDefaults": { + "headers": { + "userAgent": "Node.js/6.13" + }, + "rejectUnauthorized": false + }, + "autoAssembly": { + "enable": false, + "interval": "5m", + "step": "1m" + }, + "utils": { + "utils_common_fontdir": "null", + "utils_fonts_search_patterns": "*.ttf;*.ttc;*.otf", + "resource_expires": 31536000, + "limits_image_types_upload": "jpg;png;gif;bmp" + }, + "sql": { + "type": "postgres", + "tableChanges": "doc_changes", + "tableResult": "task_result", + "dbHost": "localhost", + "dbPort": 5432, + "dbName": "onlyoffice", + "dbUser": "onlyoffice", + "dbPass": "onlyoffice", + "charset": "utf8", + "connectionlimit": 10, + "max_allowed_packet": 1048575 + }, + "redis": { + "name": "redis", + "prefix": "ds:", + "host": "localhost", + "port": 6379 + }, + "pubsub": { + "name": "pubsubRabbitMQ", + "maxChanges": 1000 + }, + "expire": { + "saveLock": 60, + "presence": 300, + "locks": 604800, + "changeindex": 86400, + "lockDoc": 30, + "message": 86400, + "lastsave": 604800, + "forcesave": 604800, + "saved": 3600, + "documentsCron": "0 */2 * * * *", + "files": 86400, + "filesCron": "00 00 */1 * * *", + "filesremovedatonce": 100, + "sessionidle": "0", + "sessionabsolute": "30d", + "sessionclosecommand": "2m", + "pemStdTTL": "1h", + "pemCheckPeriod": "10m", + "updateVersionStatus": "5m" + }, + "ipfilter": { + "rules": [{"address": "*", "allowed": true}], + "useforrequest": false, + "errorcode": 401 + }, + "secret": { + "browser": {"string": "secret", "file": "", "tenants": {}}, + "inbox": {"string": "secret", "file": "", "tenants": {}}, + "outbox": {"string": "secret", "file": ""}, + "session": {"string": "secret", "file": ""} + }, + "token": { + "enable": { + "browser": false, + "request": { + "inbox": false, + "outbox": true + } + }, + "browser": { + "secretFromInbox": true + }, + "inbox": { + "header": "Authorization", + "prefix": "Bearer ", + "inBody": false + }, + "outbox": { + "header": "Authorization", + "prefix": "Bearer ", + "algorithm": "HS256", + "expires": "5m", + "inBody": false + }, + "session": { + "algorithm": "HS256", + "expires": "30d" + } + }, + "plugins": { + "uri": "/sdkjs-plugins", + "autostart": [] + }, + "editor":{ + "spellcheckerUrl": "/spellchecker", + "reconnection":{ + "attempts": 50, + "delay": "2s" + } + }, + "sockjs": { + "sockjs_url": "", + "websocket": true + } + } + }, + "license" : { + "license_file": "", + "warning_limit_percents": "70" + }, + "FileConverter": { + "converter": { + "maxDownloadBytes": 104857600, + "downloadTimeout": 120, + "downloadAttemptMaxCount": 3, + "downloadAttemptDelay": 1000, + "maxprocesscount": 1, + "fontDir": "null", + "presentationThemesDir": "null", + "x2tPath": "null", + "docbuilderPath": "null", + "docbuilderAllFontsPath": "null", + "args": "", + "spawnOptions": {}, + "errorfiles": "", + "streamWriterBufferSize": 8388608, + "maxRedeliveredCount": 2, + "inputLimits": [ + { + "type": "docx;dotx;docm;dotm", + "zip": { + "uncompressed": "50MB", + "template": "*.xml" + } + }, + { + "type": "xlsx;xltx;xlsm;xltm", + "zip": { + "uncompressed": "300MB", + "template": "*.xml" + } + }, + { + "type": "pptx;ppsx;potx;pptm;ppsm;potm", + "zip": { + "uncompressed": "50MB", + "template": "*.xml" + } + } + ] + } + }, + "FileStorage": { + "host": "", + "port": 4567, + "directory": "", + "silent": true + }, + "SpellChecker": { + "server": { + "port": 8080, + "mode": "development" + } + } +} \ No newline at end of file diff --git a/conf/nginx.conf b/conf/nginx.conf index 5f749a9..e50388e 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -6,7 +6,8 @@ location / { proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Host $server_name; - + add_header X-Frame-Options "ALLOW-FROM https://__DOMAIN__/"; + proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; diff --git a/manifest.json b/manifest.json index 2f71345..a874298 100644 --- a/manifest.json +++ b/manifest.json @@ -1,49 +1,49 @@ { - "name": "OnlyOffice", - "id": "onlyoffice", - "packaging_format": 1, - "description": { - "en": "OnlyOffice package for YunoHost.", - "fr": "OnlyOffice pour YunoHost." + "name": "OnlyOffice", + "id": "onlyoffice", + "packaging_format": 1, + "description": { + "en": "OnlyOffice package for YunoHost.", + "fr": "OnlyOffice pour YunoHost." + }, + "url": "https://", + "license": "free", + "maintainer": { + "name": "liberodark", + "email": "liberodark@gmail.com", + "url": "https://onlyoffice.com" + }, + "requirements": { + "yunohost": ">= 2.7.2" + }, + "multi_instance": false, + "services": [ + "nginx", + "php5-fpm", + "mysql" + ], + "arguments": { + "install": [{ + "name": "domain", + "type": "domain", + "ask": { + "en": "Choose a domain name for onlyoffice", + "fr": "Choisissez un nom de domaine pour onlyoffice" + }, + "example": "example.com" }, - "url": "https://", - "license": "free", - "maintainer": { - "name": "liberodark", - "email": "liberodark@gmail.com", - "url": "https://onlyoffice.com" - }, - "requirements": { - "yunohost": ">= 2.7.2" - }, - "multi_instance": false, - "services": [ - "nginx", - "php5-fpm", - "mysql" - ], - "arguments": { - "install": [{ - "name": "domain", - "type": "domain", - "ask": { - "en": "Choose a domain name for onlyoffice", - "fr": "Choisissez un nom de domaine pour onlyoffice" - }, - "example": "example.com" - }, - { - "name": "path", - "type": "path", - "ask": { - "en": "Choose a path for OnlyOffice / is accepted", - "fr": "Choisissez un chemin pour OnlyOffice uniquement / est accepté" - }, - "example": "/", - "default": "/" - } - - ] + { + "name": "path", + "type": "path", + "ask": { + "en": "Choose a path for OnlyOffice", + "fr": "Choisissez un chemin pour OnlyOffice" + }, + "example": "/onlyoffice", + "default": "/onlyoffice" } -} \ No newline at end of file + + ] +} +} diff --git a/scripts/install b/scripts/install index e76e3ad..c79448c 100644 --- a/scripts/install +++ b/scripts/install @@ -26,6 +26,7 @@ ynh_abort_if_errors # Retrieve arguments domain=$YNH_APP_ARG_DOMAIN +#path_url=$YNH_APP_ARG_PATH #port=$YNH_APP_ARG_PORT ### If it's a multi-instance app, meaning it can be installed several times independently @@ -82,12 +83,12 @@ ynh_app_setting_set $app port $port #============================================== # INSTALL POSTGRES #============================================== -#Next for new test 5 -ynh_install_app_dependencies postgresql redis-server apt-transport-https libasound2 libboost-regex-dev libboost1.62-dev libdrm-amdgpu1 libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libdrm2 libfontenc1 libgail-common libgail18 libgconf-2-4 libgconf2-4 libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa libglu1-mesa libgtk2.0-0 libgtk2.0-bin libgtk2.0-common libgtkglext1 libice6 libicu-dev libllvm3.9 libpangox-1.0-0 libpciaccess0 librsvg2-2 librsvg2-common libsm6 libtxc-dxtn-s2tc libx11-xcb1 libxaw7 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0 libxcb-sync1 libxcomposite1 libxcursor1 libxdamage1 libxfixes3 libxfont1 libxfont2 libxi6 libxinerama1 libxkbfile1 libxmu6 libxrandr2 libxshmfence1 libxt6 libxtst6 libxxf86vm1 postgresql-client pwgen python-meld3 supervisor x11-xkb-utils xfonts-base xfonts-encodings xfonts-utils xserver-common xvfb +#Master +#ynh_install_app_dependencies postgresql redis-server apt-transport-https libasound2 libboost-regex-dev libboost1.62-dev libdrm-amdgpu1 libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libdrm2 libfontenc1 libgail-common libgail18 libgconf-2-4 libgconf2-4 libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa libglu1-mesa libgtk2.0-0 libgtk2.0-bin libgtk2.0-common libgtkglext1 libice6 libicu-dev libllvm3.9 libpangox-1.0-0 libpciaccess0 librsvg2-2 librsvg2-common libsm6 libtxc-dxtn-s2tc libx11-xcb1 libxaw7 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0 libxcb-sync1 libxcomposite1 libxcursor1 libxdamage1 libxfixes3 libxfont1 libxfont2 libxi6 libxinerama1 libxkbfile1 libxmu6 libxrandr2 libxshmfence1 libxt6 libxtst6 libxxf86vm1 postgresql-client pwgen python-meld3 supervisor x11-xkb-utils xfonts-base xfonts-encodings xfonts-utils xserver-common xvfb -#Work in commit : add yes -#sudo apt-get install -y postgresql redis-server rabbitmq-server apt-transport-https +#Beta +sudo apt-get install -y postgresql redis-server rabbitmq-server apt-transport-https #Old # ynh_install_app_dependencies postgresql redis-server rabbitmq-server apt-transport-https @@ -98,19 +99,20 @@ ynh_install_app_dependencies postgresql redis-server apt-transport-https libasou #================================================= # Use Helper instead of package from the repo -ynh_install_nodejs 8.12.0 +#Master +#ynh_install_nodejs 8.12.0 -#Work in commit : add yes -#curl -sL https://deb.nodesource.com/setup_8.x | sudo bash - +#Beta +curl -sL https://deb.nodesource.com/setup_8.x | sudo bash - #=============================================== # ADD ONLYOFFCE REPOSITORY #=============================================== -#Work in commit : add yes -#apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5 -#echo "deb http://download.onlyoffice.com/repo/debian squeeze main" | sudo tee /etc/apt/sources.list.d/onlyoffice.list -#ynh_package_update +#Beta no for Master version +apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5 +echo "deb http://download.onlyoffice.com/repo/debian squeeze main" | sudo tee /etc/apt/sources.list.d/onlyoffice.list +ynh_package_update #============================================== # CREATE DB @@ -130,13 +132,14 @@ echo onlyoffice-documentserver onlyoffice/ds-port select ${port} | sudo debconf- # INSTALL ONLYOFFICE #============================================== -ynh_package_install_from_equivs ../conf/fakenode-deps.control -ynh_package_install_from_equivs ../conf/fakepostgres-deps.control -wget --no-verbose https://github.com/ONLYOFFICE/DocumentServer/releases/download/ONLYOFFICE-DocumentServer-5.2.3/onlyoffice-documentserver_amd64.deb -dpkg --install onlyoffice-documentserver_amd64.deb +#Master +#ynh_package_install_from_equivs ../conf/fakenode-deps.control +#ynh_package_install_from_equivs ../conf/fakepostgres-deps.control +#wget --no-verbose https://github.com/ONLYOFFICE/DocumentServer/releases/download/ONLYOFFICE-DocumentServer-5.2.3/onlyoffice-documentserver_amd64.deb +#dpkg --install onlyoffice-documentserver_amd64.deb -#Work in commit : add yes -#sudo apt-get install -y onlyoffice-documentserver +#Beta +sudo apt-get install -y onlyoffice-documentserver #================================================= # NGINX CONFIGURATION @@ -155,9 +158,18 @@ ynh_system_user_create $app #================================================= # MODIFY A CONFIG FILE #================================================= + +# Fix https://github.com/ONLYOFFICE/onlyoffice-owncloud/issues/172#issuecomment-411746394 +cp -a ../conf/default.json /etc/onlyoffice/documentserver/default.json + +# Fix Nextcloud http://dev.onlyoffice.org/viewtopic.php?f=53&t=10001 +#sed -i "/# Add headers to serve security.*/a \ \ \ \ add_header X-Frame-Options \"ALLOW-FROM https://$domain/\";" /etc/nginx/conf.d/$nextcloud_domain.d/nextcloud.conf + +# Fix OnlyOffice http://dev.onlyoffice.org/viewtopic.php?f=53&t=10001 +#sed -i "/# Add headers to serve security.*/a \ \ \ \ add_header X-Frame-Options \"ALLOW-FROM https://$domain/\";" /etc/nginx/conf.d/$domain.d/onlyoffice.conf + #cp -a ../conf/onlyoffice-documentserver.conf /etc/onlyoffice/documentserver/nginx/onlyoffice-documentserver.conf #ynh_replace_string "__NEXTCLOUDDOMAIN__" "$nextcloud_domain" "/etc/loolwsd/loolwsd.xml" -#ynh_replace_string "__PASSWORD__" "$password" "/etc/loolwsd/loolwsd.xml" #================================================= # STORE THE CONFIG FILE CHECKSUM @@ -168,7 +180,7 @@ ynh_system_user_create $app ### you can make a backup of this file before modifying it again if the admin had modified it. # Calculate and store the config file checksum into the app settings -ynh_store_file_checksum "/etc/onlyoffice/documentserver/nginx/onlyoffice-documentserver.conf" +#ynh_store_file_checksum "/etc/onlyoffice/documentserver/nginx/onlyoffice-documentserver.conf" #================================================= @@ -194,3 +206,4 @@ ynh_app_setting_set $app unprotected_uris "/" # Reload services systemctl restart nginx +supervisorctl restart all