From 6788f3dd5957d157e662726356f894af7a0264b2 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 1 Mar 2019 00:22:03 +0100 Subject: [PATCH] Cleanup --- conf/default.json | 244 ---------------------------- conf/fakenode-deps.control | 7 - conf/fakepostgres-deps.control | 7 - conf/onlyoffice-documentserver.conf | 70 -------- scripts/install | 7 +- 5 files changed, 4 insertions(+), 331 deletions(-) delete mode 100644 conf/default.json delete mode 100644 conf/fakenode-deps.control delete mode 100644 conf/fakepostgres-deps.control delete mode 100644 conf/onlyoffice-documentserver.conf diff --git a/conf/default.json b/conf/default.json deleted file mode 100644 index e02588f..0000000 --- a/conf/default.json +++ /dev/null @@ -1,244 +0,0 @@ -{ - "statsd": { - "useMetrics": false, - "host": "localhost", - "port": "8125", - "prefix": "ds." - }, - "log": { - "filePath": "", - "options": { - "reloadSecs": 60, - "replaceConsole": true - } - }, - "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" - } - } -} diff --git a/conf/fakenode-deps.control b/conf/fakenode-deps.control deleted file mode 100644 index d2e2a26..0000000 --- a/conf/fakenode-deps.control +++ /dev/null @@ -1,7 +0,0 @@ -Section: misc -Priority: optional -Package: nodejs -Version: 8.0.0 -Depends: -Architecture: all -Description: Fake package for nodejs \ No newline at end of file diff --git a/conf/fakepostgres-deps.control b/conf/fakepostgres-deps.control deleted file mode 100644 index 150e26f..0000000 --- a/conf/fakepostgres-deps.control +++ /dev/null @@ -1,7 +0,0 @@ -Section: misc -Priority: optional -Package: postgresql-client -Version: 9.1 -Depends: -Architecture: all -Description: Fake package for postgresql-client diff --git a/conf/onlyoffice-documentserver.conf b/conf/onlyoffice-documentserver.conf deleted file mode 100644 index 153d2f7..0000000 --- a/conf/onlyoffice-documentserver.conf +++ /dev/null @@ -1,70 +0,0 @@ -include /etc/nginx/includes/onlyoffice-http.conf; - -## Normal HTTP host -server { - listen 0.0.0.0:80; - listen [::]:80 default_server; - server_name _; - server_tokens off; - - ## Redirects all traffic to the HTTPS host - root /nowhere; ## root doesn't have to be a valid path since we are redirecting - rewrite ^ https://$host$request_uri? permanent; -} - -#HTTP host for internal services -server { - listen 127.0.0.1:80; - listen [::1]:80; - server_name localhost; - server_tokens off; - - include /etc/nginx/includes/onlyoffice-documentserver-common.conf; - include /etc/nginx/includes/onlyoffice-documentserver-docservice.conf; -} - -## HTTPS host -server { - listen 0.0.0.0:443 ssl; - listen [::]:443 ssl default_server; - server_tokens off; - root /usr/share/nginx/html; - - ## Strong SSL Security - ## https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html - ssl on; - ssl_certificate {{SSL_CERTIFICATE_PATH}}; - ssl_certificate_key {{SSL_KEY_PATH}}; - ssl_verify_client off; - - ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH"; - - ssl_protocols TLSv1 TLSv1.1 TLSv1.2; - ssl_session_cache builtin:1000 shared:SSL:10m; - - ssl_prefer_server_ciphers on; - - add_header Strict-Transport-Security max-age=31536000; - # add_header X-Frame-Options SAMEORIGIN; - add_header X-Content-Type-Options nosniff; - - ## [Optional] If your certficate has OCSP, enable OCSP stapling to reduce the overhead and latency of running SSL. - ## Replace with your ssl_trusted_certificate. For more info see: - ## - https://medium.com/devops-programming/4445f4862461 - ## - https://www.ruby-forum.com/topic/4419319 - ## - https://www.digitalocean.com/community/tutorials/how-to-configure-ocsp-stapling-on-apache-and-nginx - # ssl_stapling on; - # ssl_stapling_verify on; - # ssl_trusted_certificate /etc/nginx/ssl/stapling.trusted.crt; - # resolver 208.67.222.222 208.67.222.220 valid=300s; # Can change to your DNS resolver if desired - # resolver_timeout 10s; - - ## [Optional] Generate a stronger DHE parameter: - ## cd /etc/ssl/certs - ## sudo openssl dhparam -out dhparam.pem 4096 - ## - # ssl_dhparam /etc/ssl/certs/dhparam.pem; - - include /etc/nginx/includes/onlyoffice-documentserver-*.conf; - -} diff --git a/scripts/install b/scripts/install index 048ae97..daead8f 100644 --- a/scripts/install +++ b/scripts/install @@ -194,10 +194,11 @@ ynh_package_install onlyoffice-documentserver #================================================= # MODIFY A CONFIG FILE #================================================= -ynh_print_info "Fix config file..." -# Fix https://github.com/ONLYOFFICE/onlyoffice-owncloud/issues/172#issuecomment-411746394 -#cp -f ../conf/default.json /etc/onlyoffice/documentserver/default.json +### `ynh_replace_string` is used to replace a string in a file. +### (It's compatible with sed regular expressions syntax) + +#ynh_replace_string "match_string" "replace_string" "$final_path/CONFIG_FILE" #================================================= # STORE THE CONFIG FILE CHECKSUM