Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

[#43094] Add scripts to public docs repository

adam-op883ef58abc64
diff --git a/docs/enterprise-guide/enterprise-cloud-guide/backups/README.md b/docs/enterprise-guide/enterprise-cloud-guide/backups/README.md
index ac4bf7d2925..63c28db4ff3 100644
--- a/docs/enterprise-guide/enterprise-cloud-guide/backups/README.md
+++ b/docs/enterprise-guide/enterprise-cloud-guide/backups/README.md
@@ -31,3 +31,14 @@ After having **requested the backup**, you will receive an email notification wi
In case you have trouble creating your backup, please [get in touch](mailto:[email protected]) with us. We can then provide a current or past backup (database + attachments) to you.
This way you can also get your data if you decide to stop using the Enterprise cloud edition.
+
+## Pull a backup via APIv3
+
+It is sometimes good to have backups on other locations (e.g. local vs cloud). You are able to pull a backup via the APIv3 in OpenProject.
+
+*Preconditions:*
+
+1. The Token must be already generated and stored in a secure keystore
+2. The API Key must be known and stored in a secure keystore
+
+You could use our [example bash script](/script/backup-via-apiv3.sh) and integrate it in your crond for running it hourly.
diff --git a/docs/enterprise-guide/enterprise-cloud-guide/backups/script/backup-via-apiv3.sh b/docs/enterprise-guide/enterprise-cloud-guide/backups/script/backup-via-apiv3.sh
new file mode 100644
index 00000000000..fa6b1c8bf98
--- /dev/null
+++ b/docs/enterprise-guide/enterprise-cloud-guide/backups/script/backup-via-apiv3.sh
@@ -0,0 +1,46 @@
+```bash
+#!/bin/bash
+
+#Scope is to pull a backup from an OpenProject Enterprise on-premises or cloud installation and download it to a local path
+#This is done by using the APIv3, so variable api_key is mandatory to be changed.
+#The backup logic needs you to create a token and after you created the token you have change the backup_token variable, too.
+
+#VERBOSE LOGGING
+#set -x
+
+domain=foo.openproject.com
+api_key=bar
+backup_token=baz
+
+set -e
+
+curl \
+ -X POST \
+ -u apikey:$api_key \
+ https://$domain/api/v3/backups \
+ -H 'content-type: application/json' \
+ --data-raw "{\"backupToken\":\"$backup_token\",\"attachments\":false}" \
+ > response.json
+
+status_path="`cat response.json | jq -r ._links.job_status.href`"
+status_url="https://$domain$status_path"
+
+while true; do
+ curl -s -u apikey:$api_key $status_url > response.json
+
+ if [[ "`cat response.json | jq .status`" != '"success"' ]]; then
+ echo 'waiting for download'
+ sleep 5
+ else
+ echo 'download ready'
+ break
+ fi
+done
+
+download_path=`cat response.json | jq -r .payload.download`
+download_url="https://$domain$download_path"
+
+curl -u apikey:$api_key -L $download_url > "openproject-`date | tr ' ' '-' | tr ':' '-'`.zip"
+
+echo "download complete"
+```
\ No newline at end of file
diff --git a/docs/enterprise-guide/enterprise-on-premises-guide/support/installation-support/README.md b/docs/enterprise-guide/enterprise-on-premises-guide/support/installation-support/README.md
index 6c5c0864f95..633a752f26b 100644
--- a/docs/enterprise-guide/enterprise-on-premises-guide/support/installation-support/README.md
+++ b/docs/enterprise-guide/enterprise-on-premises-guide/support/installation-support/README.md
@@ -16,6 +16,18 @@ The cost for the installation support of a Community version is 150 € (excludi
-## Installation checklist
+## Support Data Collector
+
+Please run [our script](/script/op-support-data.sh) and send us the complete terminal output prior to the on-premise installation.
+
+The script should run once on the OpenProject on-premises host with or without OpenProject installed
+ It will ask you some questions that are needed to be answered interactively.
+ Please copy the script to the host (either copy/paste to a new file in your host systems editor or by copying the script e.g. via scp).
+ Do not forget to make it executable and then you could run the data collector.
+ Also please do not forget to log your complete terminal output.
+ Please attach the log file of the terminal output to an email reply in your ticket at [[email protected]](mailto:[email protected])
+
+`sudo chmod +x op-support-data.sh`
+
+` sudo ./op-support-data.sh`
-Please have a look at our [installation checklist](https://www.openproject.org/assets/pdf/OpenProject_Installation_Checklist_v1.8.pdf) and send us the completed document prior to the on-premise installation.
diff --git a/docs/enterprise-guide/enterprise-on-premises-guide/support/installation-support/script/op-support-data.sh b/docs/enterprise-guide/enterprise-on-premises-guide/support/installation-support/script/op-support-data.sh
new file mode 100644
index 00000000000..04de1e53a0d
--- /dev/null
+++ b/docs/enterprise-guide/enterprise-on-premises-guide/support/installation-support/script/op-support-data.sh
@@ -0,0 +1,185 @@
+```bash
+#!/bin/bash
+
+#Scope is to discover the user's environment for a future or existing OpenProject Enterprise on-premises packaged installation running on Linux
+
+#VERBOSE LOGGING
+#set -x
+
+#PSQL
+read -p "Please specify the IP/FQDN of the PSQL server, if the internal PSQL server of OpenProject is used press ENTER [127.0.0.1]: " psqlserver
+psqlserver=${psqlserver:-127.0.0.1}
+read -p "Please specify the PORT of the PSQL server, if the internal PSQL server of OpenProject is used press ENTER [45432]: " psqlserverport
+psqlserverport=${psqlserverport:-45432}
+
+#OWN WEB SERVER
+echo
+read -p "Please specify if your own web server is used for terminating SSL, if the internal webserver of OpenProject is used press ENTER [N,y]: " ownwebserver
+ownwebserver=${ownwebserver:-N}
+
+if [ "$ownwebserver" != "${ownwebserver#[Nn]}" ]; then
+echo
+echo As OpenProject will configure the webserver, SSL certificate and key need to be provided:
+# LETSENCRYPT!
+read -p "Enter SSL Certificate (incl. full path) [/etc/ssl/certs/ssl-cert-snakeoil.pem]: " ssl_certificate
+ssl_certificate=${ssl_certificate:-/etc/ssl/certs/ssl-cert-snakeoil.pem}
+read -p "Enter SSL Key (incl. full path) [/etc/ssl/private/ssl-cert-snakeoil.key]: " ssl_key
+ssl_key=${ssl_key:-/etc/ssl/private/ssl-cert-snakeoil.key}
+fi
+
+#SSO SOLUTION
+echo
+read -p "Please specify if there is an SSO solution like SAML/LDAP/OpenID for authenticating in OpenProject [N,y]: " ssosolution
+ssosolution=${ssosolution:-N}
+if [ "$ssosolution" != "${ssosolution#[Yy]}" ]; then
+echo
+echo As OpenProject will connect to the SSO host we need some details to be provided:
+read -p "Enter SSO host IP/FQDN: " ssoserver
+read -p "Enter SSO host Port: " ssoport
+fi
+
+#OUTGOING MAILS
+echo
+read -p "Please specify if outgoing e-mails are used (SMTP) [Y,n]: " outgoingmail
+outgoingmail=${outgoingmail:-Y}
+if [ "$outgoingmail" != "${outgoingmail#[Yy]}" ]; then
+echo
+echo As OpenProject will send e-mails we need some details to be provided:
+read -p "Enter SMTP host IP/FQDN: " outgoingmailip
+read -p "Enter SMTP host Port: " outgoingmailport
+fi
+
+#INCOMING MAILS
+echo
+read -p "Please specify if incoming e-mails are used (IMAP/POP3) [Y,n]: " incomingmail
+incomingmail=${incomingmail:-Y}
+if [ "$incomingmail" != "${incomingmail#[Yy]}" ]; then
+echo
+echo As OpenProject shall receive e-mails we need some details to be provided:
+read -p "Enter IMAP/POP3 host IP/FQDN: " incomingmailip
+read -p "Enter IMAP/POP3 host Port: " incomingmailport
+fi
+
+#S3 CLOUD STORAGE
+echo
+read -p "Please specify if S3 cloud storage is used [N,y]: " s3cloudstorage
+s3cloudstorage=${s3cloudstorage:-N}
+
+#DOMAIN NAME
+echo
+echo 'Please specify the fully qualified domain (FQDN) name for your OpenProject installation.'
+read -p "Answer (e.g. openproject.company.com): " fqdn
+
+echo "---"
+echo User Input:
+echo PSQL: $psqlserver":"$psqlserverport
+echo SSL: $ssl_certificate", "$ssl_key
+echo Own Web Server: $ownwebserver
+echo SSO Server: $ssoserver":"$ssoport
+echo SMTP Server: $outgoingmailip":"$outgoingmailport
+echo IMAP/POP3 Server: $incomingmailip":"$incomingmailport
+echo S3 Cloud Storage: $s3cloudstorage
+echo FQDN: $fqdn
+echo "---"
+
+#CHECK LINUX INFORMATION ON LOCALHOST
+echo Linux Information on localhost
+ls -la /etc/*-release
+ls -la /etc/issue*
+echo "---"
+cat /etc/*-release
+echo "---"
+cat /etc/issue*
+echo "---"
+cat /proc/version
+echo "---"
+uname -a
+echo "---"
+cat /etc/[A-Za-z]*[_-][rv]e[lr]*
+echo "---"
+
+#CHECK FILESYSTEMS ON LOCALHOST
+echo Filesystems on locahost
+cat /etc/fstab | grep -vE "^#"
+echo "---"
+df -h
+echo "---"
+
+#CHECK LOCALHOST IPS
+echo Network on localhost
+ip a
+echo "---"
+
+
+#CHECK WEBSERVER ON LOCALHOST PORTS 80 AND 443
+echo 'Checking Port 80,443 on IP 127.0.0.1 reachable? (succeeded = reachable)'
+netcat -z -v 127.0.0.1 80 443 2>&1
+echo "---"
+
+#CHECK WEBSERVER ON OTHER IPS
+for ip in `ip a | grep "inet " | grep " e" | awk -F" " '{print $2}' | cut -d'/' -f1`; do
+echo 'Checking Port 80,443 on IP '$ip' reachable? (succeeded = reachable)'
+netcat -z -v $ip 80 443 2>&1
+done
+echo "---"
+
+#CHECK packager.io ACCESS FROM LOCALHOST FOR UPGRADES
+echo packager.io web server is reachable on ports 80,443
+netcat -z -v packager.io 80 443 2>&1
+echo "---"
+
+#CHECK PSQL REACHABILITY
+echo 'PSQL server on IP/FQDN '$psqlserver' port '$psqlserverport' reachable (0=YES / 1=NO)'
+echo 'SELECT version();QUIT' | netcat $psqlserver $psqlserverport; echo $?
+echo "---"
+
+#CHECK SSO REACHABILITY
+echo 'SSO server on IP/FQDN '$ssoserver' port '$ssoport' reachable? (succeeded = reachable)'
+netcat -z -v $ssoserver $ssoport 2>&1
+echo "---"
+
+#CHECK SMTP REACHABILITY
+echo 'SMTP server on IP/FQDN '$outgoingmailip' port '$outgoingmailport' reachable? (succeeded = reachable)'
+netcat -z -v $outgoingmailip $outgoingmailport 2>&1
+echo "---"
+
+#CHECK POP3/IMAP REACHABILITY
+echo 'POP3/IMAP server on IP/FQDN '$incomingmailip' port '$incomingmailport' reachable? (succeeded = reachable)'
+netcat -z -v $incomingmailip $incomingmailport 2>&1
+echo "---"
+
+#SSL/TLS CERTS AVAILABLE
+if [ "$ownwebserver" != "${ownwebserver#[Nn]}" ]; then
+echo Search for SSL certificate $ssl_certificate
+find $ssl_certificate
+echo Search for SSL key $ssl_key
+find $ssl_key
+openssl x509 -in $ssl_certificate -noout -text
+openssl rsa -in $ssl_key -noout -text
+openssl x509 -noout -modulus -in $ssl_certificate | openssl md5
+openssl rsa -noout -modulus -in $ssl_key | openssl md5
+fi
+
+#CHECK LOCAL MEMCACHED CONFIG
+echo Search for /etc/memcached.conf
+find /etc/memcached.conf
+echo "---"
+
+#CHECK FOR INSTALLED OPENPROJECT
+
+echo "Checking for Open Project installed packages and version..."
+
+yum_fp=`which yum`
+if [ -z $yum_fp ]; then yum_fp="dummynonexists"; fi
+if [ -f $yum_fp ]; then $yum_fp list --installed | grep openproject; fi
+apt_fp=`which apt`
+if [ -z $apt_fp ]; then apt_fp="dummynonexists"; fi
+if [ -f $apt_fp ]; then $apt_fp list --installed | grep openproject; fi
+openproject_fp=`which openproject`
+if [ -z $openproject_fp ]; then openproject_fp="dummynonexists"; fi
+if [ -f $openproject_fp ];
+ then echo OpenProject is installed in Version...; $openproject_fp run bundle exec rake version
+else
+ echo "Open Project seems not to be installed."
+fi
+```
\ No newline at end of file