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. 5
      docs/installation-and-operations/bim-edition/README.md
  6. 6
      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

@ -98,10 +98,10 @@ 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
@ -109,4 +109,3 @@ x-op-app: &app
```
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
@ -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

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