Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata


Setup:

printf 'SECRET_KEY_BASE=%16s\n' $(openssl rand -hex 16) >> /opt/openproject/.env
cat << 'EOF' >>/opt/openproject/backups/openproject_docker.sh
#!/bin/bash
docker run -d -p 6000:80 --name openproject \
-v /opt/openproject/pgdata:/var/openproject/pgdata \
-v /opt/openproject/data:/var/openproject/assets \
-v /opt/openproject/apache2/sites-enabled/:/etc/apache2/sites-available \
-v /opt/openproject/apache2/ssl:/etc/apache2/ssl \
-e DATABASE_URL=postgres://openproject:openproject@192.168.1.1:5432/openproject \
--env-file /opt/openproject/.env \
openproject/community:10
EOF
chmod +x /opt/openproject/backups/openproject_docker.sh
/opt/openproject/backups/openproject_docker.sh
SSL Setup:
-v /opt/openproject/apache2/sites-enabled/:/etc/apache2/sites-available \
-v /opt/openproject/apache2/ssl:/etc/apache2/ssl \
Example: (Don't forget to copy your certs to {certs,private})
cat << 'EOF' >/opt/openproject/apache2/sites-enabled/openproject.conf
<VirtualHost *:80>
  ServerName _default_

  RewriteEngine On
  RewriteRule ^/?(.*) https://%{SERVER_NAME}:443/$1 [R,L]
</VirtualHost>

<VirtualHost *:443>
  ServerName _default_
  DocumentRoot /app/public

  ProxyRequests off
  ProxyPreserveHost On

  SSLEngine on
  SSLCertificateFile /etc/apache2/ssl/certs/domain.crt
  SSLCertificateKeyFile /etc/apache2/ssl/private/domain.key
  SSLCertificateChainFile /etc/apache2/ssl/certs/domain_bundle.crt

  ProxyPass http://127.0.0.1:6000/ retry=0
  ProxyPassReverse http://127.0.0.1:6000/

</VirtualHost>
EOF

Database Setup: (Optional PostgreSQL in Docker & PGAdmin)

cat << 'EOF' >opdburl_get.sh
HOSTIP="$(ip -4 addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}')"
openproject config:get DATABASE_URL > /tmp/opdburl
sed -i -e "s/127.0.0.1/$HOSTIP/g" /tmp/opdburl
cat /tmp/opdburl
rm /tmp/opdburl
EOF
chmod +x opdburl_get.sh
./opdburl_get.sh
-e DATABASE_URL=postgres://openproject:openproject@192.168.1.1:5432/openproject \

E-Mail Setup:

cat << 'EOF' >/opt/openproject/.env
#ENV Variables
#https://docs.openproject.org/installation-and-operations/configuration/environment/
EMAIL_DELIVERY_METHOD=smtp
SMTP_ADDRESS=smtp.sendgrid.net
SMTP_PORT=587
SMTP_DOMAIN=your-domain-name-here.example.com
SMTP_AUTHENTICATION=login
SMTP_ENABLE_STARTTLS_AUTO=true
SMTP_USER_NAME="apikey"
SMTP_PASSWORD="SG.XXXXXXXXXXXXX-XXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
EOF
--env-file /opt/openproject/.env \

Setup CLI Alias:

echo "alias pgcli='docker exec -it postgresql /bin/bash'" >> ~/.bashrc
source ~/.bashrc

Setup OP DB:

pgcli
su - postgres
psql
DROP DATABASE openproject;
CREATE DATABASE openproject;
CREATE USER openproject WITH ENCRYPTED PASSWORD 'openproject';
GRANT ALL PRIVILEGES ON DATABASE openproject TO openproject;




  • No labels