Skip to content

Commit

Permalink
Merge pull request #5 from cloudogu/feature/3_wrong_mail_link_urls
Browse files Browse the repository at this point in the history
#3: fix update of hostname setting as well
  • Loading branch information
omilke authored Nov 30, 2017
2 parents 61b7c67 + ddda105 commit d0e77a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dogu.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Name": "official/redmine",
"Version": "3.4.2-3",
"Version": "3.4.2-4",
"DisplayName": "Redmine",
"Description": "Redmine is a flexible project management web application",
"Category": "Development Apps",
Expand Down
6 changes: 4 additions & 2 deletions resources/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ REDMINE_LANG=en
PLUGIN_STORE="/var/tmp/redmine/plugins"
PLUGIN_DIRECTORY="${WORKDIR}/plugins"

HOSTNAME_SETTING="${FQDN}"

function sql(){
PGPASSWORD="${DATABASE_USER_PASSWORD}" psql --host "${DATABASE_IP}" --username "${DATABASE_USER}" --dbname "${DATABASE_DB}" -1 -c "${1}"
}
Expand Down Expand Up @@ -104,7 +106,7 @@ if 2>/dev/null 1>&2 sql "select count(*) from settings;"; then
echo "Redmine (database) has been installed already."
# update FQDN in settings
# we need to update the fqdn on every start, bacause of possible changes
sql "UPDATE settings SET value='${FQDN}/redmine' WHERE name='host_name';"
sql "UPDATE settings SET value='${HOSTNAME_SETTING}' WHERE name='host_name';"
sql "UPDATE settings SET value=E'--- !ruby/hash:ActionController::Parameters \nenabled: 1 \ncas_url: https://${FQDN}/cas \nattributes_mapping: firstname=givenName&lastname=surname&mail=mail \nautocreate_users: 1' WHERE name='plugin_redmine_cas';" > /dev/null 2>&1
else

Expand All @@ -127,7 +129,7 @@ else
sql "INSERT INTO auth_sources VALUES (DEFAULT, 'AuthSourceCas', 'Cas', 'cas.example.com', 1234, 'myDbUser', 'myDbPass', 'dbAdapter:dbName', 'name', 'firstName', 'lastName', 'email', true, false, null, null);"

# write url settings to database
sql "INSERT INTO settings (name, value, updated_on) VALUES ('host_name','${FQDN}', now());"
sql "INSERT INTO settings (name, value, updated_on) VALUES ('host_name','${HOSTNAME_SETTING}', now());"
sql "INSERT INTO settings (name, value, updated_on) VALUES ('protocol','https', now());"
sql "INSERT INTO settings (name, value, updated_on) VALUES ('emails_footer', E'You have received this notification because you have either subscribed to it, or are involved in it.\r\nTo change your notification preferences, please click here: https://${FQDN}/redmine/my/account', now());"

Expand Down

0 comments on commit d0e77a6

Please sign in to comment.