diff --git a/deploy/docker/compose/src/main/compose/2_connector-common.yml b/deploy/docker/compose/src/main/compose/2_connector-common.yml index 4913f9c..fb939f2 100644 --- a/deploy/docker/compose/src/main/compose/2_connector-common.yml +++ b/deploy/docker/compose/src/main/compose/2_connector-common.yml @@ -29,6 +29,9 @@ services: ONLYOFFICE_DOCUMENT_SERVER: "${SERVICES_EDU_CONNECTOR_ONLYOFFICE_DOCUMENT_SERVER:-}" ONLYOFFICE_PLUGIN_URL: "${SERVICES_EDU_CONNECTOR_ONLYOFFICE_PLUGIN_URL:-}" ONLYOFFICE_JWT_SECRET: "${SERVICES_EDU_CONNECTOR_ONLYOFFICE_JWT_SECRET:-}" + UPLOAD_FILE_SIZE: "${SERVICES_EDU_CONNECTOR_UPLOAD_FILE_SIZE:-512M}" + POST_MAX_SIZE: "${SERVICES_EDU_CONNECTOR_POST_MAX_SIZE:-513M}" + MEMORY_LIMIT: "${SERVICES_EDU_CONNECTOR_MEMORY_LIMIT:-1024M}" MOODLE_BASE_DIR: "${SERVICES_EDU_CONNECTOR_MOODLE_BASE_DIR:-}" MOODLE_TOKEN: "${SERVICES_EDU_CONNECTOR_MOODLE_TOKEN:-}" volumes: diff --git a/deploy/docker/helm/src/main/chart/templates/statefulset.yml b/deploy/docker/helm/src/main/chart/templates/statefulset.yml index 7720a8a..ce7cd8a 100644 --- a/deploy/docker/helm/src/main/chart/templates/statefulset.yml +++ b/deploy/docker/helm/src/main/chart/templates/statefulset.yml @@ -44,6 +44,12 @@ spec: value: {{ .Values.moodleBaseDir | default "" }} - name: MOODLE_TOKEN value: {{ .Values.moodleToken | default "" }} + - name: UPLOAD_FILE_SIZE + value: {{ .Values.uploadFileSize | default "512M" }} + - name: POST_MAX_SIZE + value: {{ .Values.postMaxSize | default "513M" }} + - name: MEMORY_LIMIT + value: {{ .Values.memoryLimit | "1024M" }} livenessProbe: httpGet: path: /metadata diff --git a/service/Dockerfile b/service/Dockerfile index d5bca27..d7ae033 100755 --- a/service/Dockerfile +++ b/service/Dockerfile @@ -86,7 +86,8 @@ RUN set -eux \ && adduser www-data appuser RUN set -eux \ - && chown -R appuser:appuser /etc/apache2 $ROOT $DATA + && chown -R appuser:appuser /etc/apache2 $ROOT $DATA \ + && chown -R appuser:appuser $PHP_INI_DIR USER appuser diff --git a/service/src/main/docker/entrypoint.sh b/service/src/main/docker/entrypoint.sh index 650c831..2336a72 100644 --- a/service/src/main/docker/entrypoint.sh +++ b/service/src/main/docker/entrypoint.sh @@ -23,6 +23,10 @@ connector_database_name=${DATABASE_NAME//\/&/\\&} # OPTIONALS +upload_max_filesize="${UPLOAD_FILE_SIZE:-512M}" +post_max_size="${POST_MAX_SIZE:-513M}" +memory_limit="${MEMORY_LIMIT:-1024M}" + only_office_document_server="${ONLYOFFICE_DOCUMENT_SERVER:-}" only_office_plugin_url="${ONLYOFFICE_PLUGIN_URL:-}" only_office_jwt_secret="${ONLYOFFICE_JWT_SECRET:-}" @@ -32,6 +36,8 @@ moodle_base_dir="${MOODLE_BASE_DIR:-}" # shellcheck disable=SC2153 moodle_token="${MOODLE_TOKEN:-}" +php_ini=$PHP_INI_DIR/php.ini + sed -i "s|define('WWWURL', '.*')|define('WWWURL', '${connector_url}')|g" "${conf}" sed -i "s|define('DOCROOT', '.*')|define('DOCROOT', '${ROOT}')|g" "${conf}" sed -i "s|define('DATA', '.*')|define('DATA', '${DATA}')|g" "${conf}" @@ -43,6 +49,10 @@ sed -i "s|define('DBUSER', '.*')|define('DBUSER', '${connector_database_user}')| sed -i "s|define('DBPASSWORD', '.*')|define('DBPASSWORD', '${connector_database_password}')|g" "${conf}" sed -i "s|define('DBNAME', '.*')|define('DBNAME', '${connector_database_name}')|g" "${conf}" +sed -i -r "s|upload_max_filesize.*|upload_max_filesize = ${upload_max_filesize}|" "${php_ini}" +sed -i -r "s|post_max_size.*|post_max_size = ${post_max_size}|" "${php_ini}" +sed -i -r "s|memory_limit.*|memory_limit = ${memory_limit}|" "${php_ini}" + sed -i "s|define('ONLYOFFICE_DOCUMENT_SERVER', '.*')|define('ONLYOFFICE_DOCUMENT_SERVER', '${only_office_document_server}')|g" "${conf}" sed -i "s|define('ONLYOFFICE_PLUGIN_URL', '.*')|define('ONLYOFFICE_PLUGIN_URL', '${only_office_plugin_url}')|g" "${conf}" sed -i "s|define('ONLYOFFICE_JWT_SECRET', '.*')|define('ONLYOFFICE_JWT_SECRET', '${only_office_jwt_secret}')|g" "${conf}"