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

Remove smtp packager addon, implement admin mail

Oliver Güntherd4759b0a031b
diff --git a/.pkgr.yml b/.pkgr.yml
index 9cfedf39555..00623a11e71 100644
--- a/.pkgr.yml
+++ b/.pkgr.yml
@@ -55,7 +55,6 @@ wizards:
- https://github.com/pkgr/addon-postgres
- https://github.com/pkgr/addon-apache2.git
- ./packaging/addons/repositories
- - https://github.com/pkgr/addon-smtp.git
- https://github.com/pkgr/addon-memcached.git
- ./packaging/addons/openproject
buildpack: https://github.com/opf/heroku-buildpack-multi.git#master
diff --git a/packaging/addons/openproject/bin/configure b/packaging/addons/openproject/bin/configure
index 61af847c304..e0f5324fe4d 100755
--- a/packaging/addons/openproject/bin/configure
+++ b/packaging/addons/openproject/bin/configure
@@ -9,7 +9,7 @@ input_start() {
if [ "$server_autoinstall" = "skip" ] ; then
STATE="input_hostname"
else
- STATE="done"
+ STATE="input_admin_mail"
fi
}
@@ -32,12 +32,26 @@ input_hostname_params() {
input_protocol_params() {
wiz_put "server/ssl"
if wiz_ask ; then
- STATE="done"
+ STATE="input_admin_mail"
else
STATE="input_hostname"
fi
}
+input_admin_mail() {
+ if wiz_get "smtp/admin_email" &>/dev/null ; then
+ STATE="done"
+ return
+ fi
+
+ wiz_put "openproject/admin_email"
+ if wiz_ask ; then
+ STATE="done"
+ else
+ STATE="start"
+ fi
+}
+
state_machine() {
case "$1" in
"start")
@@ -49,6 +63,9 @@ state_machine() {
"input_protocol")
input_protocol_params
;;
+ "input_admin_mail")
+ input_admin_mail
+ ;;
"done")
echo "DONE"
exit 0
diff --git a/packaging/addons/openproject/bin/postinstall b/packaging/addons/openproject/bin/postinstall
index 7c313495527..35505840ca7 100755
--- a/packaging/addons/openproject/bin/postinstall
+++ b/packaging/addons/openproject/bin/postinstall
@@ -6,6 +6,10 @@ set -e
CLI="${APP_NAME}"
+# Set the configured admin email
+ADMIN_EMAIL="$(wiz_get "openproject/admin_email" || wiz_get "smtp/admin_email")"
+${CLI} config:set RECOMPILE_RAILS_ASSETS="true"
+
# Check for custom gems
custom_gemfile=$(${CLI} config:get CUSTOM_PLUGIN_GEMFILE || echo "")
if [ -n "$custom_gemfile" ] && [ -f "$custom_gemfile" ]; then
diff --git a/packaging/addons/openproject/templates b/packaging/addons/openproject/templates
index 7b61f4a694b..1f7d546b3a5 100644
--- a/packaging/addons/openproject/templates
+++ b/packaging/addons/openproject/templates
@@ -12,4 +12,10 @@ Template: server/hostname
Type: string
Default: www.example.com
Description: Your fully qualified domain name:
- Enter the fully qualified domain name (FQDN), where this server can be reached.
\ No newline at end of file
+ Enter the fully qualified domain name (FQDN), where this server can be reached.
+
+Template: openproject/admin_email
+Type: string
+Description: Your email address for the admin account:
+ Enter the email address to be used for first admin account.