Configuring OpenProject services (revision 1.1)

Introduction

This page describes how Alexis Huxley installed OpenProject Community Edition.

Hardware prerequisites: 2GB RAM; 2 CPUs

Installation

This is as according to the official documentation.

  1. Run:
    wget -qO - https://dl.packager.io/srv/opf/openproject/key | apt-key add -
    wget -O /etc/apt/sources.list.d/openproject.list https://dl.packager.io/srv/opf/openproject/stable/12/installer/debian/11.repo
    apt update
    apt install -y openproject

Proxying connections to the OpenProject server

  1. See Configuring web services (revision 2). (For my first installation I did not get an SSL certificate for the front-end Apache server.)

New installation only: configuration

Note that we run an SSL front-end webserver with a non-SSL back-end server. But many of the back-end application’s settings are for the front-end (e.g. enable SSL).

  1. Run:
    openproject configure

    and answer as follows:

    • Do you want to use this wizard to help setup your PostgreSQL database: install
    • Do you want to use this wizard to help setup your web server: install
    • Your fully qualified domain name: <front-end-fully-qualified-hostname>
    • Server path prefix: <none>
    • Do you want to enable SSL for your web server: yes (note that using https on the front-end but http on the backend results in log in attempts, including for the admin account, being blocked with the error message:
    • Path to your SSL certificate: /etc/ssl/certs/ssl-cert-snakeoil.pem
      Path to your private SSL key: /etc/ssl/private/ssl-cert-snakeoil.key
    • Path to the CA bundle: <none>
    • Do you want to use this wizard to setup Subversion repositories support for openproject: skip
    • Do you want to use this wizard to setup Git repositories support for openproject: skip
    • What do you want to use to send emails from openproject: sendmail
    • Administrator email: <your-email> (this will also be used for password recovery for the admin account, so be sure it is valid!)
    • Do you want to install a memcached server: install
    • Be sure to enable/disable SSL according to the *front-end* webserver, not the backend one! Otherwise later on you will get this when attempting to log in:port regarding this can be found here, but it looks to me as if this is impossible to correct post-installation (since you need to log in in order to fix it).
  2. Go to the OpenProject web interface and log with the default credentials (admin/admin).
  3. When prompted. change the admin password.
  4. When prompted, set the preferred language.
  5. Take the tour.
  6. Go to OA –> Adminstration –> Email –> Email Notifications.
  7. Set the emission address, disable BCCing.
  8. Go to OA –> Adminstration –> Users –> Settings.
  9. Set user accounts deletable by admins.
  10. Go to OA –> Adminstration –> Authentication –> Settings.
  11. Temporarily set Authentication required.
  12. Set self-registration to disabled.
  13. I would delete unwanted work packages (i.e. change request types) but that would probably be premature. I’ll come back to this once I am more familiar with OpenProject.
  14. In Jira. my project is ‘Released Software; its workflow is:and its issue types are ‘Bug’ and ‘New feature. In addition it has custom field listing the following modules:Recreate this in OpenProject as follows:
    1. Go to Select a project –> View all projects.
    2. Delete all projects.
    3. Go to OA –> Adminstration –> Work packages –> Types.
    4. Delete all work package types (i.e. issue types).
    5. Go to OA –> Adminstration –> Work packages –> Status.
    6. Delete all statuses except ‘New’ (it’s not possible to delete this until we add another status that will become the default status).
    7. Add status ‘to do’, make it the default. set its colour to ‘Gray (dark)’.
    8. Delete status ‘New’.
    9. Add statuses ‘in analysis’, ‘in devel, testing & release’, ‘suspended’ (there is a limit to name lengths), ‘in cool off’ with suitable colours.
    10. Add statuses ‘completed’, ‘rejected’ and ‘suspended’ with ‘work package closed’ enabled and with suitable colours.
    11. Go to OA –> Adminstration –> Work packages –> Types.
    12. Add types ‘bug’ and ‘new feature’ with ‘Activated for new projects by default’ enabled.
    13. Go to OA –> Adminstration –> Work packages –> Workflow.
    14. For the combination member/bug click edit and allow:
      1. to do –> in analysis
      2. in analysis –> in dev testing & release, rejected, suspended
      3. in dev, testing & release –> in analysis, in cool off
      4. in cool off –> in analysis, completed
      5. suspended –> in analysis
      6. completed –> <none>
      7. rejected –> <none>
    15. For the combination member/new feature the member/bug workflow can be cloned by clicking ‘Copy’.
    16. Go to OA –> Adminstration –> Custom fields –> Work packages.
    17. Add custom field ‘modules’ of format list, multi-select is not required (nor possible without a license), mark it required, used as a filter and searchable.
    18. Go to Select a project –> + Project.
    19. Add a new project called ‘release software’ with identifier ‘soft’, public.
    20. Go to Select a project –> release software –> Project settings –> Modules.
    21. Disable wiki, time tracking, meetings, news.
  15. Go to OA –> Adminstration –>System settings –> General.
  16. Disable the Welcome block.
  17. Go to OA –> Adminstration –> Users and Permissions –> Users and Permissions.
  18. Add users.
  19. Set up short cuts to project bug pages (here is a page containing such a link) then edit /etc/apache2/sites-enabled/openproject.conf and add a stanza line this one:
      #  The following paragraph added by Alexis. The short URLs are mentioned
      #  at pasta.freemyip.com/computing/software/ and the long URLs are the
      #  WPs with suitable filters.
      #  First stop the ProxyPass directive at the end from proxying the stuff 
      #  we're about to redirect.
      ProxyPass /bugs/ !
      #  Then redirect - module by module.
      Redirect /bugs/ade/ /projects/software/work_packages?query_props=%7B%22c%22%3A%5B%22id%22%2C%22type%22%2C%22subject%22%2C%22status%22%5D%2C%22tv%22%3Afalse%2C%22hl%22%3A%22none%22%2C%22hi%22%3Atrue%2C%22g%22%3A%22%22%2C%22t%22%3A%22id%3Aasc%22%2C%22f%22%3A%5B%7B%22n%22%3A%22customField1%22%2C%22o%22%3A%22%3D%22%2C%22v%22%3A%5B%221%22%5D%7D%2C%7B%22n%22%3A%22status%22%2C%22o%22%3A%22o%22%2C%22v%22%3A%5B%5D%7D%5D%2C%22pa%22%3A1%2C%22pp%22%3A20%7D
      Redirect /bugs/bs/ /projects/software/work_packages?query_props=%7B%22c%22%3A%5B%22id%22%2C%22type%22%2C%22subject%22%2C%22status%22%5D%2C%22tv%22%3Afalse%2C%22hl%22%3A%22none%22%2C%22hi%22%3Atrue%2C%22g%22%3A%22%22%2C%22t%22%3A%22id%3Aasc%22%2C%22f%22%3A%5B%7B%22n%22%3A%22customField1%22%2C%22o%22%3A%22%3D%22%2C%22v%22%3A%5B%222%22%5D%7D%2C%7B%22n%22%3A%22status%22%2C%22o%22%3A%22o%22%2C%22v%22%3A%5B%5D%7D%5D%2C%22pa%22%3A1%2C%22pp%22%3A20%7D 
      Redirect /bugs/fad/ /projects/software/work_packages?query_props=%7B%22c%22%3A%5B%22id%22%2C%22type%22%2C%22subject%22%2C%22status%22%5D%2C%22tv%22%3Afalse%2C%22hl%22%3A%22none%22%2C%22hi%22%3Atrue%2C%22g%22%3A%22%22%2C%22t%22%3A%22id%3Aasc%22%2C%22f%22%3A%5B%7B%22n%22%3A%22customField1%22%2C%22o%22%3A%22%3D%22%2C%22v%22%3A%5B%223%22%5D%7D%2C%7B%22n%22%3A%22status%22%2C%22o%22%3A%22o%22%2C%22v%22%3A%5B%5D%7D%5D%2C%22pa%22%3A1%2C%22pp%22%3A20%7D
      Redirect /bugs/js/ /projects/software/work_packages?query_props=%7B%22c%22%3A%5B%22id%22%2C%22type%22%2C%22subject%22%2C%22status%22%5D%2C%22tv%22%3Afalse%2C%22hl%22%3A%22none%22%2C%22hi%22%3Atrue%2C%22g%22%3A%22%22%2C%22t%22%3A%22id%3Aasc%22%2C%22f%22%3A%5B%7B%22n%22%3A%22customField1%22%2C%22o%22%3A%22%3D%22%2C%22v%22%3A%5B%225%22%5D%7D%2C%7B%22n%22%3A%22status%22%2C%22o%22%3A%22o%22%2C%22v%22%3A%5B%5D%7D%5D%2C%22pa%22%3A1%2C%22pp%22%3A20%7D
      Redirect /bugs/paa/ /projects/software/work_packages?query_props=%7B%22c%22%3A%5B%22id%22%2C%22type%22%2C%22subject%22%2C%22status%22%5D%2C%22tv%22%3Afalse%2C%22hl%22%3A%22none%22%2C%22hi%22%3Atrue%2C%22g%22%3A%22%22%2C%22t%22%3A%22id%3Aasc%22%2C%22f%22%3A%5B%7B%22n%22%3A%22customField1%22%2C%22o%22%3A%22%3D%22%2C%22v%22%3A%5B%227%22%5D%7D%2C%7B%22n%22%3A%22status%22%2C%22o%22%3A%22o%22%2C%22v%22%3A%5B%5D%7D%5D%2C%22pa%22%3A1%2C%22pp%22%3A20%7D
      Redirect /bugs/rocon/ /projects/software/work_packages?query_props=%7B%22c%22%3A%5B%22id%22%2C%22type%22%2C%22subject%22%2C%22status%22%5D%2C%22tv%22%3Afalse%2C%22hl%22%3A%22none%22%2C%22hi%22%3Atrue%2C%22g%22%3A%22%22%2C%22t%22%3A%22id%3Aasc%22%2C%22f%22%3A%5B%7B%22n%22%3A%22customField1%22%2C%22o%22%3A%22%3D%22%2C%22v%22%3A%5B%2210%22%5D%7D%2C%7B%22n%22%3A%22status%22%2C%22o%22%3A%22o%22%2C%22v%22%3A%5B%5D%7D%5D%2C%22pa%22%3A1%2C%22pp%22%3A20%7D
      Redirect /bugs/wra/ /projects/software/work_packages?query_props=%7B%22c%22%3A%5B%22id%22%2C%22type%22%2C%22subject%22%2C%22status%22%5D%2C%22tv%22%3Afalse%2C%22hl%22%3A%22none%22%2C%22hi%22%3Atrue%2C%22g%22%3A%22%22%2C%22t%22%3A%22id%3Aasc%22%2C%22f%22%3A%5B%7B%22n%22%3A%22customField1%22%2C%22o%22%3A%22%3D%22%2C%22v%22%3A%5B%2212%22%5D%7D%2C%7B%22n%22%3A%22status%22%2C%22o%22%3A%22o%22%2C%22v%22%3A%5B%5D%7D%5D%2C%22pa%22%3A1%2C%22pp%22%3A20%7D

    (The URLs can be determined by just filtering the bug reports (‘WPs’) in OpenProject.)

Migration only: migrating the service

  1. On the new server run:
    apt -y install postgresql
    sleep 30
    netstat -plutn
    

    and note the port the database server is listening on.

  2. On the old OpenProject server run:
    systemctl stop openproject
    openproject run backup
    
  3. Put ssh keys in place to allow rsync between the two systems
  4. Make sure that the following directories on the target do not exist or are empty and then transfer them from the old server to the new server:
    • /var/db/openproject/backup/
    • /etc/openproject/installer.dat
    • /etc/openproject/conf.d/
    • /var/db/openproject/files/          #  actually, this is slightly wrong, I should restore one of the files that ‘openproject run backup’ created
  5. Make sure that the database is world readable (the ‘postgres’ use will need to read it shortly.)
  6. On the new server review the contents of all files under /etc/openproject and adjust according to what is needed for the new server; pay paticular attention to the TCP port the database server uses.
  7. On the old server list the databases with their parameters and users with their privileges:
    su - postgres
    psql -l
    psql -U postgres
    \du
    \q
    exit
    
  8. On the old server get the OpenProject database password:
    sed -n 's@postgres/db_password @@p' /etc/openproject/installer.dat
  9. On the new server create the same postgres user (with same password) and then the same database:
    su - postgres
    psql -U postgres
    create user openproject with superuser createrole createdb replication bypassrls password '<the-password>'; 
    create database openproject with owner openproject encoding 'UTF8' LC_COLLATE 'en_GB.UTF-8' LC_CTYPE 'en_GB.UTF-8';
    \q
    exit
  10. On the new server restore the database, entering the password when prompted for it:
    su - postgres
    pg_restore -h localhost -U openproject -d openproject --clean /var/db/openproject/backup/postgresql-dump-20211203114553.pgdump
    exit

    (Expect a lot of errors about attempting to drop things that don’t exist.)

  11. On the new server to a basic check that dump has been loaded:
    su - postgres
    psql
    \c openproject
    \dt
    \q
    exit
  12. As root run:
    openproject configure
  13. Reboot the new server.
  14. Wait 60 seconds.
  15. Test it.
  16. Make the dump files readable by the owner only.

See also