Merge pull request #11796 from opf/maintenance/45102/remove-deprecated-envs

Remove deprecated packager environment variables
pull/11868/head
Oliver Günther 2 years ago committed by GitHub
commit 8db2e22822
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      docker-compose.yml
  2. 6
      docker/prod/Dockerfile
  3. 10
      docker/prod/entrypoint.sh
  4. 4
      docker/pullpreview/docker-compose.yml
  5. 21
      docs/installation-and-operations/bim-edition/README.md
  6. 16
      docs/installation-and-operations/configuration/README.md
  7. 11
      docs/installation-and-operations/misc/migration/README.md
  8. 11
      packaging/addons/openproject/bin/postinstall
  9. 3
      packaging/conf/configuration.yml
  10. 8
      packaging/scripts/backup

@ -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

@ -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

@ -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"

@ -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

@ -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`

@ -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: {}*

@ -70,12 +70,21 @@ pg_restore -h <dbhost> -u <dbuser> -W --dbname <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 <dump>.tar.gz`, creating it beforehand if needed.
Simply extract your attachments dump into that folder with `tar -xvzf <dump>.tar.gz`,
creating it beforehand if needed. Ensure that this is writable by the `openproject` user.

@ -63,16 +63,19 @@ rake_commands="db:migrate db:seed"
# set rails_cache_store
memcached_servers="$(${CLI} config:get MEMCACHED_SERVERS || echo "")"
if [ -z "$memcached_servers" ]; then
${CLI} config:set RAILS_CACHE_STORE=file_store
${CLI} config:set OPENPROJECT_RAILS__CACHE__STORE=file_store
else
${CLI} config:set RAILS_CACHE_STORE=memcache
${CLI} config:set OPENPROJECT_RAILS__CACHE__STORE=memcache
fi
${CLI} config:unset RAILS_CACHE_STORE
# create attachments folder
attachments_path=$(${CLI} config:get ATTACHMENTS_STORAGE_PATH || echo "/var/db/${APP_NAME}/files")
attachments_path=$(${CLI} config:get OPENPROJECT_ATTACHMENTS__STORAGE__PATH || ${CLI} config:get ATTACHMENTS_STORAGE_PATH || echo "/var/db/${APP_NAME}/files")
mkdir -p "${attachments_path}"
chown ${APP_USER}.${APP_GROUP} "${attachments_path}"
${CLI} config:set ATTACHMENTS_STORAGE_PATH="${attachments_path}"
${CLI} config:set OPENPROJECT_ATTACHMENTS__STORAGE__PATH="${attachments_path}"
${CLI} config:unset ATTACHMENTS_STORAGE_PATH
# set web host
${CLI} config:set HOST=127.0.0.1

@ -35,9 +35,6 @@
#################################################################
default:
rails_cache_store: <%= ENV.fetch('RAILS_CACHE_STORE') { :memcache }.to_sym %>
session_store: <%= ENV.fetch('SESSION_STORE') { :active_record_store }.to_sym %>
attachments_storage_path: <%= ENV.fetch('ATTACHMENTS_STORAGE_PATH') { "/var/db/_APP_NAME_/files" } %>
<% git_configured = ENV['GIT_REPOSITORIES'].present? %>
<% svn_configured = ENV['SVN_REPOSITORIES'].present? %>
<% if git_configured || svn_configured %>

@ -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

Loading…
Cancel
Save