diff --git a/docker-compose.yml b/docker-compose.yml index 4115b33915..5965fdd39b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -41,8 +41,8 @@ x-op-backend: &backend environment: LOCAL_DEV_CHECK: "${LOCAL_DEV_CHECK:?The docker-compose file for OpenProject has moved to https://github.com/opf/openproject-deploy}" RAILS_ENV: development - RAILS_CACHE_STORE: file_store OPENPROJECT_CACHE__MEMCACHE__SERVER: cache:11211 + OPENPROJECT_RAILS__CACHE__STORE: file_store OPENPROJECT_RAILS__RELATIVE__URL__ROOT: "${OPENPROJECT_RAILS__RELATIVE__URL__ROOT:-}" DATABASE_URL: postgresql://${DB_USERNAME:-postgres}:${DB_PASSWORD:-postgres}@${DB_HOST:-db}:${DB_PORT:-5432}/${DB_DATABASE:-openproject} OPENPROJECT_EDITION: $OPENPROJECT_EDITION diff --git a/docker/prod/Dockerfile b/docker/prod/Dockerfile index b72b4e4270..a2d06e1929 100644 --- a/docker/prod/Dockerfile +++ b/docker/prod/Dockerfile @@ -19,14 +19,14 @@ ENV PGBIN="/usr/lib/postgresql/$PGVERSION/bin" ENV DATABASE_URL=postgres://openproject:openproject@127.0.0.1/openproject ENV RAILS_ENV=production -ENV RAILS_CACHE_STORE=memcache ENV RAILS_GROUPS=production ENV RAILS_LOG_TO_STDOUT=1 ENV RAILS_SERVE_STATIC_FILES=1 -ENV OPENPROJECT_INSTALLATION__TYPE=docker +ENV OPENPROJECT_ATTACHMENTS__STORAGE__PATH=$APP_DATA_PATH/files # Valid values are: standard,bim ENV OPENPROJECT_EDITION=standard -ENV ATTACHMENTS_STORAGE_PATH=$APP_DATA_PATH/files +ENV OPENPROJECT_INSTALLATION__TYPE=docker +ENV OPENPROJECT_RAILS__CACHE__STORE=memcache # Set a default key base, ensure to provide a secure value in production environments! ENV SECRET_KEY_BASE=OVERWRITE_ME diff --git a/docker/prod/entrypoint.sh b/docker/prod/entrypoint.sh index bc644c9eb5..a39d8a1c5e 100755 --- a/docker/prod/entrypoint.sh +++ b/docker/prod/entrypoint.sh @@ -44,9 +44,13 @@ if [ "$(id -u)" = '0' ]; then rm -f $APACHE_PIDFILE || true fi - if [ ! -z "$ATTACHMENTS_STORAGE_PATH" ]; then - mkdir -p "$ATTACHMENTS_STORAGE_PATH" - chown -R "$APP_USER:$APP_USER" "$ATTACHMENTS_STORAGE_PATH" + # Use ATTACHMENTS_STORAGE_PATH value when OPENPROJECT_ATTACHMENTS__STORAGE__PATH is not set + export OPENPROJECT_ATTACHMENTS__STORAGE__PATH=${OPENPROJECT_ATTACHMENTS__STORAGE__PATH:-$ATTACHMENTS_STORAGE_PATH} + unset ATTACHMENTS_STORAGE_PATH + + if [ ! -z "$OPENPROJECT_ATTACHMENTS__STORAGE__PATH" ]; then + mkdir -p "$OPENPROJECT_ATTACHMENTS__STORAGE__PATH" + chown -R "$APP_USER:$APP_USER" "$OPENPROJECT_ATTACHMENTS__STORAGE__PATH" fi mkdir -p "$APP_PATH/log" "$APP_PATH/tmp/pids" "$APP_PATH/files" chown "$APP_USER:$APP_USER" "$APP_PATH" diff --git a/docker/pullpreview/docker-compose.yml b/docker/pullpreview/docker-compose.yml index 07f5d52a66..06865923c0 100644 --- a/docker/pullpreview/docker-compose.yml +++ b/docker/pullpreview/docker-compose.yml @@ -19,10 +19,10 @@ x-defaults: &defaults volumes: - "openproject_data:/var/openproject/assets" environment: - - "RAILS_CACHE_STORE=file_store" - "DATABASE_URL=postgresql://app:p4ssw0rd@db:5432/app?encoding=utf8&pool=5&timeout=5000&reconnect=true" - - "SECRET_KEY_BASE=d4e74f017910ac56c6ebad01165b7e1b37f4c9c02e9716836f8670cdc8d65a231e64e4f6416b19c8" + - "OPENPROJECT_RAILS__CACHE__STORE=file_store" - "RAILS_ENV=production" + - "SECRET_KEY_BASE=d4e74f017910ac56c6ebad01165b7e1b37f4c9c02e9716836f8670cdc8d65a231e64e4f6416b19c8" networks: - backend diff --git a/docs/installation-and-operations/bim-edition/README.md b/docs/installation-and-operations/bim-edition/README.md index 5e393b6d35..07ae1a8f6f 100644 --- a/docs/installation-and-operations/bim-edition/README.md +++ b/docs/installation-and-operations/bim-edition/README.md @@ -11,7 +11,7 @@ sidebar_navigation: For installing the OpenProject BIM edition please follow the general [system requirements](../system-requirements/) and [installation guidelines](../installation/packaged/). Under [Step 1](../installation/packaged/#step-1-select-your-openproject-edition) please select OpenProject BIM. -## Changing to OpenProject BIM edition +## Changing to OpenProject BIM edition An existing OpenProject on-premises (self hosted) installation can easily be switched to the BIM Edition. The BIM Edition extends the capabilities of a normal OpenProject installation with special features for the construction industry. @@ -29,8 +29,8 @@ Now that your OpenProject instance is up to date, you can _reconfigure_ it to be On the command line of your server run the following command. It will open a wizard that guides you through through the most important installation settings of your instance. On the first screen it will ask you to select the edition. Please select _bim_ and click _next_. -You can keep the screens that follow just as they are. You don't need to change any setting. -Your current settings will be preselected for you. You can simply click "next" in every step +You can keep the screens that follow just as they are. You don't need to change any setting. +Your current settings will be preselected for you. You can simply click "next" in every step until the end of the wizard. Finally, this will also trigger the installation of the necessary libraries and tools for 3D model conversion. @@ -40,14 +40,14 @@ Congratulations, you've successfully switched to the BIM Edition. However, for t experience you might consider also the next configuration. You can check that all tools for the IFC model conversion were installed by going to -_-> Administration -> Information_ and check that _IFC conversion pipeline available_ +_-> Administration -> Information_ and check that _IFC conversion pipeline available_ has a check icon (✓) to the right. ### Activating the BCF module per default for every new project (optional) You can enable the BCF module per default for all new projects in the future. -Go to _-> Administration -> System settings -> Projects_ and within the section +Go to _-> Administration -> System settings -> Projects_ and within the section _Settings for new projects_ activate the checkbox for _BCF_. ### Add typical work package types and statuses for BCF management (optional) @@ -57,7 +57,7 @@ installation. In freshly created OpenProject BIM instances those types are already present. However, as you have just switched from a normal OpenProject installation you will need to create -those work package types by hand. Please find detailed instructions on how to add work +those work package types by hand. Please find detailed instructions on how to add work package types in [Manage Work Package Types](../../system-admin-guide/manage-work-packages/work-package-types/). You might consider adding the following typical work package types: @@ -76,7 +76,7 @@ We recommend that each type has the following status options: ### Activating the "OpenProject BIM" theme (optional) -OpenProject installations with a valid Enterprise on-premises edition token can switch to the BIM +OpenProject installations with a valid Enterprise on-premises edition token can switch to the BIM theme. Go to _-> Administration -> Design_ and from the _Themes_ drop down menu choose _OpenProject BIM_. @@ -98,15 +98,14 @@ x-op-app: &app <<: *image <<: *restart_policy environment: - RAILS_CACHE_STORE: "memcache" OPENPROJECT_CACHE__MEMCACHE__SERVER: "cache:11211" - OPENPROJECT_RAILS__RELATIVE__URL__ROOT: "${OPENPROJECT_RAILS__RELATIVE__URL__ROOT:-}" OPENPROJECT_EDITION: "bim" + OPENPROJECT_RAILS__CACHE__STORE: "memcache" + OPENPROJECT_RAILS__RELATIVE__URL__ROOT: "${OPENPROJECT_RAILS__RELATIVE__URL__ROOT:-}" DATABASE_URL: "postgres://postgres:p4ssw0rd@db/openproject" USE_PUMA: "true" # set to true to enable the email receiving feature. See ./docker/cron for more options IMAP_ENABLED: "${IMAP_ENABLED:-false}" ``` -Note: If the current Docker installation does not yet hold important information it is recommended to simply create all docker containers from scratch as the seeded data such as themes, types, and demo projects are different in the BIM edition. The demo data gets seeded only at the very first time run of the container. The Docker volumes are required to be removed e.g. by issuing `docker-compose down --volumes` - +Note: If the current Docker installation does not yet hold important information it is recommended to simply create all docker containers from scratch as the seeded data such as themes, types, and demo projects are different in the BIM edition. The demo data gets seeded only at the very first time run of the container. The Docker volumes are required to be removed e.g. by issuing `docker-compose down --volumes` diff --git a/docs/installation-and-operations/configuration/README.md b/docs/installation-and-operations/configuration/README.md index b02ca19ba7..d857ec4b94 100644 --- a/docs/installation-and-operations/configuration/README.md +++ b/docs/installation-and-operations/configuration/README.md @@ -68,8 +68,8 @@ x-op-app: &app environment: OPENPROJECT_HTTPS: true # ... other configuration - RAILS_CACHE_STORE: "memcache" OPENPROJECT_CACHE__MEMCACHE__SERVER: "cache:11211" + OPENPROJECT_RAILS__CACHE__STORE: "memcache" OPENPROJECT_RAILS__RELATIVE__URL__ROOT: "${OPENPROJECT_RAILS__RELATIVE__URL__ROOT:-}" DATABASE_URL: "${DATABASE_URL:-postgres://postgres:p4ssw0rd@db/openproject?pool=20&encoding=unicode&reconnect=true}" RAILS_MIN_THREADS: 4 @@ -79,7 +79,7 @@ x-op-app: &app volumes: - "${OPDATA:-opdata}:/var/openproject/assets" -# configuration cut off at this point. +# configuration cut off at this point. # Please use the file at https://github.com/opf/openproject-deploy/blob/stable/12/compose/docker-compose.yml ``` @@ -116,7 +116,7 @@ x-op-app: &app OPENPROJECT_HTTPS: ${OPENPROJECT_HTTPS} # ... more environment variables -# configuration cut off at this point. +# configuration cut off at this point. # Please use the file at https://github.com/opf/openproject-deploy/blob/stable/12/compose/docker-compose.yml ``` @@ -135,7 +135,7 @@ If you have a `docker-compose.override.yml` file created, it is also easy to dis To do that, add this section to the file: ```yaml -services: +services: db: deploy: replicas: 0 @@ -205,7 +205,7 @@ To enable, set the configuration option: OPENPROJECT_SESSION__STORE="{ :active_record_store: { drop_old_sessions_on_login: true } }" ``` -**Delete old sessions for the same user when logging out** +**Delete old sessions for the same user when logging out** To disable, set the configuration option: @@ -285,9 +285,9 @@ OPENPROJECT_GRAVATAR__FALLBACK__IMAGE="identicon" ### Attachments storage -You can modify the folder that attachments are stored locally. Use the `attachments_storage_path` configuration variable for that. But ensure that you move the existing paths. To find out the current path on a packaged installation, use `openproject config:get ATTACHMENTS_STORAGE_PATH`. +You can modify the folder where attachments are stored locally. Use the `attachments_storage_path` configuration variable for that. But ensure that you move the existing paths. To find out the current path on a packaged installation, use `openproject config:get OPENPROJECT_ATTACHMENTS__STORAGE__PATH`. -To update the path, use `openproject config:set ATTACHMENTS_STORAGE_PATH="/path/to/new/folder"`. Ensure that this is writable by the `openproject` user. Afterwards issue a restart by `sudo openproject configure` +To update the path, use `openproject config:set OPENPROJECT_ATTACHMENTS__STORAGE__PATH="/path/to/new/folder"`. Ensure that this is writable by the `openproject` user. Afterwards issue a restart by `sudo openproject configure` #### attachment storage type @@ -369,7 +369,7 @@ OPENPROJECT_IMPRESSUM__LINK="https://impressum.example.com" ### hidden menu items admin menu -You can disable specific menu items in the menu sidebar for each main menu (such as Administration and Projects). The configuration can be done through environment variables. You have to define one variable for each menu that shall be hidden. +You can disable specific menu items in the menu sidebar for each main menu (such as Administration and Projects). The configuration can be done through environment variables. You have to define one variable for each menu that shall be hidden. *default: {}* diff --git a/docs/installation-and-operations/misc/migration/README.md b/docs/installation-and-operations/misc/migration/README.md index 32a9af638d..f06f5bf234 100644 --- a/docs/installation-and-operations/misc/migration/README.md +++ b/docs/installation-and-operations/misc/migration/README.md @@ -70,12 +70,21 @@ pg_restore -h -u -W --dbname --clean postgresql-dump- Your storage path on the old installation can be shown using the following command: +``` +openproject config:get OPENPROJECT_ATTACHMENTS__STORAGE__PATH +#=> e.g., /var/db/openproject/files +``` + +On versions prior to 12.5, the environment variable was named differently. Use +the following command to show the storage path: + ``` openproject config:get ATTACHMENTS_STORAGE_PATH #=> e.g., /var/db/openproject/files ``` -Simply extract your attachments dump into that folder with `tar -vxfz .tar.gz`, creating it beforehand if needed. +Simply extract your attachments dump into that folder with `tar -xvzf .tar.gz`, +creating it beforehand if needed. Ensure that this is writable by the `openproject` user. diff --git a/packaging/scripts/backup b/packaging/scripts/backup index 0e8cd7e924..82545593fb 100755 --- a/packaging/scripts/backup +++ b/packaging/scripts/backup @@ -44,11 +44,15 @@ else echo "* No Git repositories folder. Ignoring." >&2 fi -if [ -d "$ATTACHMENTS_STORAGE_PATH" ]; then +# Use ATTACHMENTS_STORAGE_PATH value when OPENPROJECT_ATTACHMENTS__STORAGE__PATH is not set +export OPENPROJECT_ATTACHMENTS__STORAGE__PATH=${OPENPROJECT_ATTACHMENTS__STORAGE__PATH:-$ATTACHMENTS_STORAGE_PATH} +unset ATTACHMENTS_STORAGE_PATH + +if [ -d "$OPENPROJECT_ATTACHMENTS__STORAGE__PATH" ]; then dst="${TARGET}/attachments-${timestamp}.tar.gz" touch "$dst" && chmod 0640 "$dst" echo -n "* Generating attachments backup..." >&2 - if tar czf "$dst" -C "${ATTACHMENTS_STORAGE_PATH}" . ; then + if tar czf "$dst" -C "${OPENPROJECT_ATTACHMENTS__STORAGE__PATH}" . ; then echo " done" >&2 echo "$dst" else