Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable mail MTA/SMTP configuration using MicroProfile Config #9939

Merged
merged 81 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
d6c0600
feat(mail): add MTA settings for mail to JvmSettings #7424
poikilotherm Sep 19, 2023
de759c1
feat(mail): add minimal implementation of a mail session factory #7424
poikilotherm Sep 20, 2023
72cdde9
feat(mail): add sane defaults for mail jvm settings at app level #7424
poikilotherm Sep 20, 2023
02f1c3d
feat(mail): inject mail session via CDI from factory in MailServiceBe…
poikilotherm Sep 20, 2023
1f79f57
fix(mail): make error logs about missing mapping file go away #7424
poikilotherm Sep 20, 2023
03b11bf
feat(ct,mail): no longer configure mail in containers manually #7424
poikilotherm Sep 20, 2023
ee88cfd
doc(ct): remove mail env vars from app image docs #7424
poikilotherm Sep 20, 2023
600d209
build(test): enable using GenericContainer without JUnit4 around
poikilotherm Sep 20, 2023
6f6a9b7
fix(mail): correct typo in mail.smtp prefix string #7424
poikilotherm Sep 20, 2023
c23ccde
chore(build,test): upgrade to Testcontainers v1.19.0
poikilotherm Sep 20, 2023
eb1664f
feat(mail): add explicit injection constructor to MailServiceBean #7424
poikilotherm Sep 20, 2023
086f766
test(mail): add integration test for mail session configuration and u…
poikilotherm Sep 20, 2023
51af5e1
build(mail): exclude geronimo javamail spec from dependencies
poikilotherm Sep 20, 2023
36d78fd
feat(mail): enable backward compat for javamail resource from app ser…
poikilotherm Sep 24, 2023
b612e1a
doc(mail): add initial release note for deprecated mail config #7424
poikilotherm Sep 24, 2023
bc55587
Merge branch 'develop' into 7424-maildefinition-ng
poikilotherm Oct 5, 2023
c367e09
test(mail): refactor IT for mail sessions to use @JvmSettings
poikilotherm Oct 5, 2023
4c64051
test(mail): include in regular IT test suite
poikilotherm Oct 5, 2023
2178c83
test(mail): add test scenario including necessary SMTP authentication…
poikilotherm Oct 5, 2023
17aa5ad
feat(mail): make system email address configurable via MPCONFIG #7424
poikilotherm Oct 6, 2023
fd41607
refactor(mail): make MailServiceBean use new lookup API for system ad…
poikilotherm Oct 6, 2023
2bff977
feat(mail): provide lookup function for support mail address #7424
poikilotherm Oct 6, 2023
de2f423
refactor(mail): replace manual parsing with mail service lookups #7424
poikilotherm Oct 6, 2023
81da403
style(mail): deprecate db setting for system email #7424
poikilotherm Oct 6, 2023
59b09cb
test(mail): use InternetAddress parsing directly, no need for MailUtil
poikilotherm Oct 6, 2023
7fc613f
refactor(mail): remove unused MailUtil.parseSystemAddress #7424
poikilotherm Oct 6, 2023
5b418c0
test(mail): refactor IT with new system email JVM option #7424
poikilotherm Oct 6, 2023
2c3e054
test(mail): restructure and add test for mail address lookups working…
poikilotherm Oct 6, 2023
8fac0f6
test,fix(branding): make mock adding methods lenient to avoid unneces…
poikilotherm Oct 6, 2023
9c7d9b5
refactor(mail): simplify MailServiceBean.sendSystemEmail #7424
poikilotherm Oct 9, 2023
b970eb5
feat(mail): enable UTF-8 mail address following RFC 6530 #7424
poikilotherm Oct 10, 2023
05870d1
fix(mail): lookup UTF-8 support config in static method to pick up ch…
poikilotherm Oct 10, 2023
e9abfd2
fix(mail): add missing mock in MailServiceBeanTest
poikilotherm Oct 10, 2023
7d1ba87
fix(mail): make mail configuration entirely optional #7424
poikilotherm Oct 10, 2023
df53751
Merge branch 'develop' into 7424-maildefinition-ng
poikilotherm Oct 10, 2023
7a23d1a
chore(build): update to Testcontainers 1.19.1
poikilotherm Oct 11, 2023
4bfda6c
chore(build): update to SmallRye Config 3.4.1
poikilotherm Oct 11, 2023
b74d60f
chore(build): update Mockito to v5.6.0
poikilotherm Oct 11, 2023
078d6d7
Merge branch 'develop' into 7424-maildefinition-ng
poikilotherm Oct 15, 2023
b194263
Merge branch 'develop' into 7424-maildefinition-ng
poikilotherm Nov 8, 2023
9397cc3
fix(mail): lookup legacy mail session programmatically #7424
poikilotherm Nov 8, 2023
d650725
build(mail): add .map files to be included in resources #7424
poikilotherm Nov 8, 2023
11826d9
feat(mail): add startup checks for mail configuration #7424
poikilotherm Nov 8, 2023
4efef85
Merge branch 'develop' into 7424-maildefinition-ng
poikilotherm Jan 17, 2024
213b025
test(mail): add more tests for mail session producer with invalid config
poikilotherm Feb 16, 2024
7ff1e17
Merge branch 'develop' into 7424-maildefinition-ng
poikilotherm Feb 16, 2024
084fa32
chore(test): remove leftover JUnit 4 rules
poikilotherm Feb 20, 2024
4d3904f
test(mail): verify SMTP over SSL/TLS works
poikilotherm Feb 20, 2024
53e964a
style(mail): update deprecation tags for DV v6.2
poikilotherm Feb 20, 2024
abcb131
style(settings): ignore SonarCube rule S115 for DB settings
poikilotherm Feb 20, 2024
b0d268d
doc(settings): add section on secure password storage in security sec…
poikilotherm Feb 20, 2024
f690c47
feat(installer): make installer use new way to apply mail MTA config
poikilotherm Feb 20, 2024
9824425
doc(mail): add mail config paragraphs #7424
poikilotherm Feb 20, 2024
5dcaba9
doc(mail): rewrite install docs to match new way of mail config #7424
poikilotherm Feb 20, 2024
a48e860
fix(ct): migrate compose and configbaker to use new way of mail config
poikilotherm Feb 20, 2024
6f5cc9f
style(mail): update mail config release note
poikilotherm Feb 20, 2024
930fc1b
style(mail): update mail config release note about source of from add…
poikilotherm Feb 20, 2024
d82cff4
Merge branch 'develop' into 7424-maildefinition-ng
poikilotherm Feb 21, 2024
e11a623
Merge branch 'develop' into 7424-maildefinition-ng
poikilotherm Mar 12, 2024
af7171e
Merge branch 'develop' into 7424-maildefinition-ng
poikilotherm Mar 21, 2024
6b15b12
Merge branch 'develop' into 7424-maildefinition-ng
poikilotherm Mar 22, 2024
db9cd86
docs(mail): apply suggestions from code review
poikilotherm Mar 25, 2024
83d29b1
feat(ct): add MTA config to demo compose #7424
poikilotherm Mar 25, 2024
ff3b1a1
Merge remote-tracking branch 'origin/7424-maildefinition-ng' into 742…
poikilotherm Mar 25, 2024
ac74b23
removed outdated "problems sending email" section #9939
pdurbin Mar 25, 2024
f263a4e
update docs and release note #7424
pdurbin Mar 25, 2024
caf5682
link higher up in the guides #7424
pdurbin Mar 25, 2024
362b87e
fix(mail): remove duplicate JvmSettings.MAIL_MTA_HOST
poikilotherm Mar 26, 2024
b8ca4a7
fix(mail): do not add a default for SMPT host in ct profile
poikilotherm Mar 26, 2024
d8198b5
style(mail): enable more debug output from session producer
poikilotherm Mar 26, 2024
2a73426
fix(mail): do not fail to deploy when debugging is not configured
poikilotherm Mar 26, 2024
21aa73d
style(mail): applying better fix for default value of mail debugging
poikilotherm Mar 26, 2024
3619371
fix dot to dash
pdurbin Mar 26, 2024
c498ceb
doc(mail): add ssl.enable setting to shortlist
poikilotherm Mar 26, 2024
5d7a863
Merge remote-tracking branch 'origin/7424-maildefinition-ng' into 742…
poikilotherm Mar 26, 2024
3e9d992
doc(mail): add newly added settings to release note
poikilotherm Mar 26, 2024
785dfc5
chore(build): update Maven and test framework dependencies
poikilotherm Mar 26, 2024
6b8b907
chore(build): downgrade DMP to 0.43.4
poikilotherm Mar 26, 2024
df48382
simply smtp config docs #7424
pdurbin Mar 26, 2024
cb14423
doc(mail): fix some typos, add hint about support in new SMTP config …
poikilotherm Mar 26, 2024
e784eb3
point release note at new SMTP section #7424
pdurbin Mar 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions doc/release-notes/7424-mailsession.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## Simplified SMTP configuration

With this release, we deprecate the usage of `asadmin create-javamail-resource` to configure Dataverse to send mail using your SMTP server and provide a simplified, standard alternative using JVM options or MicroProfile Config.

At this point, no action is required if you want to keep your current configuration.
Warnings will show in your server logs to inform and remind you about the deprecation.
A future major release of Dataverse may remove this way of configuration.

Please do take the opportunity to update your SMTP configuration. Details can be found in section of the Installation Guide starting with the [SMTP/Email Configuration](https://guides.dataverse.org/en/6.2/installation/config.html#smtp-email-configuration) section of the Installation Guide.

Once reconfiguration is complete, you should remove legacy, unused config. First, run `asadmin delete-javamail-resource mail/notifyMailSession` as described in the [6.1 guides](https://guides.dataverse.org/en/6.1/installation/installation-main.html#mail-host-configuration-authentication). Then run `curl -X DELETE http://localhost:8080/api/admin/settings/:SystemEmail` as this database setting has been replace with `dataverse.mail.system-email` as described below.

Please note: as there have been problems with email delivered to SPAM folders when the "From" within mail envelope and the mail session configuration didn't match (#4210), as of this version the sole source for the "From" address is the setting `dataverse.mail.system-email` once you migrate to the new way of configuration.

List of options added:
- dataverse.mail.system-email
- dataverse.mail.mta.host
- dataverse.mail.mta.port
- dataverse.mail.mta.ssl.enable
- dataverse.mail.mta.auth
- dataverse.mail.mta.user
- dataverse.mail.mta.password
- dataverse.mail.mta.allow-utf8-addresses
- Plus many more for advanced usage and special provider requirements. See [configuration guide for a full list](https://guides.dataverse.org/en/6.2/installation/config.html#dataverse-mail-mta).
13 changes: 0 additions & 13 deletions doc/sphinx-guides/source/container/app-image.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,6 @@ In addition, the application image provides the following tunables:

1. Simply pick a JVM option from the list and replace any ``.`` with ``_``.
2. Replace any ``-`` in the option name with ``__``.
* - ``DATAVERSE_MAIL_HOST``
- ``smtp``
- String
- A hostname (w/o port!) where to reach a Mail MTA on port 25.
* - ``DATAVERSE_MAIL_USER``
- ``dataversenotify``
- String
- A username to use with the Mail MTA
* - ``DATAVERSE_MAIL_FROM``
- ``dataverse@localhost``
- Mail address
- The "From" field for all outbound mail. Make sure to set :ref:`systemEmail` to the same value or no mail will
be sent.


Note that the script ``init_2_configure.sh`` will apply a few very important defaults to enable quick usage
Expand Down
302 changes: 241 additions & 61 deletions doc/sphinx-guides/source/installation/config.rst

Large diffs are not rendered by default.

60 changes: 0 additions & 60 deletions doc/sphinx-guides/source/installation/installation-main.rst
Original file line number Diff line number Diff line change
Expand Up @@ -141,66 +141,6 @@ Got ERR_ADDRESS_UNREACHABLE While Navigating on Interface or API Calls

If you are receiving an ``ERR_ADDRESS_UNREACHABLE`` while navigating the GUI or making an API call, make sure the ``siteUrl`` JVM option is defined. For details on how to set ``siteUrl``, please refer to :ref:`dataverse.siteUrl` from the :doc:`config` section. For context on why setting this option is necessary, refer to :ref:`dataverse.fqdn` from the :doc:`config` section.

Problems Sending Email
^^^^^^^^^^^^^^^^^^^^^^

If your Dataverse installation is not sending system emails, you may need to provide authentication for your mail host. First, double check the SMTP server being used with this Payara asadmin command:

``./asadmin get server.resources.mail-resource.mail/notifyMailSession.host``

This should return the DNS of the mail host you configured during or after installation. mail/notifyMailSession is the JavaMail Session that's used to send emails to users.

If the command returns a host you don't want to use, you can modify your notifyMailSession with the Payara ``asadmin set`` command with necessary options (`click here for the manual page <https://docs.oracle.com/cd/E18930_01/html/821-2433/set-1.html>`_), or via the admin console at http://localhost:4848 with your domain running.

If your mail host requires a username/password for access, continue to the next section.

Mail Host Configuration & Authentication
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If you need to alter your mail host address, user, or provide a password to connect with, these settings are easily changed in the Payara admin console or via command line.

For the Payara console, load a browser with your domain online, navigate to http://localhost:4848 and on the side panel find JavaMail Sessions. By default, the Dataverse Software uses a session named mail/notifyMailSession for routing outgoing emails. Click this mail session in the window to modify it.

When fine tuning your JavaMail Session, there are a number of fields you can edit. The most important are:

+ **Mail Host:** Desired mail host’s DNS address (e.g. smtp.gmail.com)
+ **Default User:** Username mail host will recognize (e.g. user\@gmail.com)
+ **Default Sender Address:** Email address that your Dataverse installation will send mail from

Depending on the SMTP server you're using, you may need to add additional properties at the bottom of the page (below "Advanced").

From the "Add Properties" utility at the bottom, use the “Add Property” button for each entry you need, and include the name / corresponding value as needed. Descriptions are optional, but can be used for your own organizational needs.

**Note:** These properties are just an example. You may need different/more/fewer properties all depending on the SMTP server you’re using.

============================== ==============================
Name Value
============================== ==============================
mail.smtp.auth true
mail.smtp.password [Default User password*]
mail.smtp.port [Port number to route through]
============================== ==============================

**\*WARNING**: Entering a password here will *not* conceal it on-screen. It’s recommended to use an *app password* (for smtp.gmail.com users) or utilize a dedicated/non-personal user account with SMTP server auths so that you do not risk compromising your password.

If your installation’s mail host uses SSL (like smtp.gmail.com) you’ll need these name/value pair properties in place:

====================================== ==============================
Name Value
====================================== ==============================
mail.smtp.socketFactory.port 465
mail.smtp.port 465
mail.smtp.socketFactory.fallback false
mail.smtp.socketFactory.class javax.net.ssl.SSLSocketFactory
====================================== ==============================

The mail session can also be set from command line. To use this method, you will need to delete your notifyMailSession and create a new one. See the below example:

- Delete: ``./asadmin delete-javamail-resource mail/notifyMailSession``
- Create (remove brackets and replace the variables inside): ``./asadmin create-javamail-resource --mailhost [smtp.gmail.com] --mailuser [test\@test\.com] --fromaddress [test\@test\.com] --property mail.smtp.auth=[true]:mail.smtp.password=[password]:mail.smtp.port=[465]:mail.smtp.socketFactory.port=[465]:mail.smtp.socketFactory.fallback=[false]:mail.smtp.socketFactory.class=[javax.net.ssl.SSLSocketFactory] mail/notifyMailSession``

Be sure you save the changes made here and then restart your Payara server to test it out.

UnknownHostException While Deploying
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
2 changes: 2 additions & 0 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ services:
SKIP_DEPLOY: "${SKIP_DEPLOY}"
DATAVERSE_JSF_REFRESH_PERIOD: "1"
DATAVERSE_FEATURE_API_BEARER_AUTH: "1"
DATAVERSE_MAIL_SYSTEM_EMAIL: "dataverse@localhost"
DATAVERSE_MAIL_MTA_HOST: "smtp"
poikilotherm marked this conversation as resolved.
Show resolved Hide resolved
DATAVERSE_AUTH_OIDC_ENABLED: "1"
DATAVERSE_AUTH_OIDC_CLIENT_ID: test
DATAVERSE_AUTH_OIDC_CLIENT_SECRET: 94XHrfNRwXsjqTqApRrwWmhDLDHpIYV8
Expand Down
2 changes: 2 additions & 0 deletions docker/compose/demo/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ services:
DATAVERSE_DB_PASSWORD: secret
DATAVERSE_DB_USER: dataverse
DATAVERSE_FEATURE_API_BEARER_AUTH: "1"
DATAVERSE_MAIL_SYSTEM_EMAIL: "Demo Dataverse <dataverse@example.org>"
DATAVERSE_MAIL_MTA_HOST: "smtp"
JVM_ARGS: -Ddataverse.files.storage-driver-id=file1
-Ddataverse.files.file1.type=file
-Ddataverse.files.file1.label=Filesystem
Expand Down
3 changes: 0 additions & 3 deletions modules/container-configbaker/scripts/bootstrap/dev/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ export DATAVERSE_URL
echo "Running base setup-all.sh (INSECURE MODE)..."
"${BOOTSTRAP_DIR}"/base/setup-all.sh --insecure -p=admin1 | tee /tmp/setup-all.sh.out

echo "Setting system mail address..."
curl -X PUT -d "dataverse@localhost" "${DATAVERSE_URL}/api/admin/settings/:SystemEmail"

echo "Setting DOI provider to \"FAKE\"..."
curl "${DATAVERSE_URL}/api/admin/settings/:DoiProvider" -X PUT -d FAKE

Expand Down
14 changes: 7 additions & 7 deletions modules/dataverse-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@
<gdcc.xoai.version>5.2.0</gdcc.xoai.version>

<!-- Testing dependencies -->
<testcontainers.version>1.19.0</testcontainers.version>
<smallrye-mpconfig.version>2.10.1</smallrye-mpconfig.version>
<junit.jupiter.version>5.10.0</junit.jupiter.version>
<mockito.version>5.4.0</mockito.version>
<maven-jacoco-plugin.version>0.8.10</maven-jacoco-plugin.version>
<testcontainers.version>1.19.7</testcontainers.version>
<smallrye-mpconfig.version>3.7.1</smallrye-mpconfig.version>
<junit.jupiter.version>5.10.2</junit.jupiter.version>
<mockito.version>5.11.0</mockito.version>
<maven-jacoco-plugin.version>0.8.11</maven-jacoco-plugin.version>

<checkstyle.version>9.3</checkstyle.version>

Expand All @@ -182,8 +182,8 @@
<maven-war-plugin.version>3.3.2</maven-war-plugin.version>
<maven-dependency-plugin.version>3.5.0</maven-dependency-plugin.version>
<maven-install-plugin.version>3.1.1</maven-install-plugin.version>
<maven-surefire-plugin.version>3.1.0</maven-surefire-plugin.version>
<maven-failsafe-plugin.version>3.1.0</maven-failsafe-plugin.version>
<maven-surefire-plugin.version>3.2.5</maven-surefire-plugin.version>
<maven-failsafe-plugin.version>3.2.5</maven-failsafe-plugin.version>
<maven-assembly-plugin.version>3.6.0</maven-assembly-plugin.version>
<maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
<maven-release-plugin.version>3.0.0-M7</maven-release-plugin.version>
Expand Down
12 changes: 12 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@
<artifactId>abdera-i18n</artifactId>
<version>1.1.3</version>
</dependency>
<dependency>
<groupId>org.apache.abdera</groupId>
<artifactId>abdera-parser</artifactId>
<version>1.1.3</version>
<exclusions>
<exclusion>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-javamail_1.4_spec</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</dependencyManagement>
<!-- Declare any DIRECT dependencies here.
Expand Down Expand Up @@ -703,6 +714,7 @@
<include>**/firstNames/*.*</include>
<include>**/*.xsl</include>
<include>**/services/*</include>
<include>**/*.map</include>
</includes>
</resource>
<resource>
Expand Down
16 changes: 10 additions & 6 deletions scripts/installer/as-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
{
# undeploy the app, if running:

./asadmin $ASADMIN_OPTS undeploy dataverse

Check warning on line 55 in scripts/installer/as-setup.sh

View workflow job for this annotation

GitHub Actions / Shellcheck

[shellcheck] reported by reviewdog 🐶 Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086) Raw Output: ./scripts/installer/as-setup.sh:55:13:info:Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086)

# avoid OutOfMemoryError: PermGen per http://eugenedvorkin.com/java-lang-outofmemoryerror-permgen-space-error-during-deployment-to-glassfish/
#./asadmin $ASADMIN_OPTS list-jvm-options
Expand All @@ -65,19 +65,19 @@
#./asadmin $ASADMIN_OPTS delete-jvm-options -client

# new Payara options: (thanks to donsizemore@unc.edu)
./asadmin $ASADMIN_OPTS create-jvm-options "-XX\:MaxMetaspaceSize=512m"

Check warning on line 68 in scripts/installer/as-setup.sh

View workflow job for this annotation

GitHub Actions / Shellcheck

[shellcheck] reported by reviewdog 🐶 Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086) Raw Output: ./scripts/installer/as-setup.sh:68:13:info:Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086)
./asadmin $ASADMIN_OPTS create-jvm-options "-XX\:MetaspaceSize=256m"

Check warning on line 69 in scripts/installer/as-setup.sh

View workflow job for this annotation

GitHub Actions / Shellcheck

[shellcheck] reported by reviewdog 🐶 Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086) Raw Output: ./scripts/installer/as-setup.sh:69:13:info:Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086)
./asadmin $ASADMIN_OPTS create-jvm-options "-Dfish.payara.classloading.delegate=false"

Check warning on line 70 in scripts/installer/as-setup.sh

View workflow job for this annotation

GitHub Actions / Shellcheck

[shellcheck] reported by reviewdog 🐶 Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086) Raw Output: ./scripts/installer/as-setup.sh:70:13:info:Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086)
./asadmin $ASADMIN_OPTS create-jvm-options "-XX\:+UseG1GC"

Check warning on line 71 in scripts/installer/as-setup.sh

View workflow job for this annotation

GitHub Actions / Shellcheck

[shellcheck] reported by reviewdog 🐶 Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086) Raw Output: ./scripts/installer/as-setup.sh:71:13:info:Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086)
./asadmin $ASADMIN_OPTS create-jvm-options "-XX\:+UseStringDeduplication"

Check warning on line 72 in scripts/installer/as-setup.sh

View workflow job for this annotation

GitHub Actions / Shellcheck

[shellcheck] reported by reviewdog 🐶 Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086) Raw Output: ./scripts/installer/as-setup.sh:72:13:info:Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086)
./asadmin $ASADMIN_OPTS create-jvm-options "-XX\:+DisableExplicitGC"

Check warning on line 73 in scripts/installer/as-setup.sh

View workflow job for this annotation

GitHub Actions / Shellcheck

[shellcheck] reported by reviewdog 🐶 Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086) Raw Output: ./scripts/installer/as-setup.sh:73:13:info:Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086)

# alias passwords
for alias in "rserve_password_alias ${RSERVE_PASS}" "doi_password_alias ${DOI_PASSWORD}" "dataverse.db.password ${DB_PASS}"
do
set -- $alias

Check warning on line 78 in scripts/installer/as-setup.sh

View workflow job for this annotation

GitHub Actions / Shellcheck

[shellcheck] reported by reviewdog 🐶 Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086) Raw Output: ./scripts/installer/as-setup.sh:78:14:info:Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086)
echo "AS_ADMIN_ALIASPASSWORD=$2" > /tmp/$1.txt

Check warning on line 79 in scripts/installer/as-setup.sh

View workflow job for this annotation

GitHub Actions / Shellcheck

[shellcheck] reported by reviewdog 🐶 Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086) Raw Output: ./scripts/installer/as-setup.sh:79:47:info:Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086)
./asadmin $ASADMIN_OPTS create-password-alias --passwordfile /tmp/$1.txt $1

Check warning on line 80 in scripts/installer/as-setup.sh

View workflow job for this annotation

GitHub Actions / Shellcheck

[shellcheck] reported by reviewdog 🐶 Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086) Raw Output: ./scripts/installer/as-setup.sh:80:17:info:Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086)
rm /tmp/$1.txt
done

Expand Down Expand Up @@ -105,7 +105,7 @@
# Fake DOI Settings
# (we can no longer offer EZID with their shared test account)
# jvm-options use colons as separators, escape as literal
DOI_BASEURL_ESC=`echo $DOI_BASEURL | sed -e 's/:/\\\:/'`

Check failure on line 108 in scripts/installer/as-setup.sh

View workflow job for this annotation

GitHub Actions / Shellcheck

[shellcheck] reported by reviewdog 🐶 Use $(...) notation instead of legacy backticks `...`. [SC2006](https://github.com/koalaman/shellcheck/wiki/SC2006) Raw Output: ./scripts/installer/as-setup.sh:108:19:style:Use $(...) notation instead of legacy backticks `...`. [SC2006](https://github.com/koalaman/shellcheck/wiki/SC2006)

Check failure on line 108 in scripts/installer/as-setup.sh

View workflow job for this annotation

GitHub Actions / Shellcheck

[shellcheck] reported by reviewdog 🐶 See if you can use ${variable//search/replace} instead. [SC2001](https://github.com/koalaman/shellcheck/wiki/SC2001) Raw Output: ./scripts/installer/as-setup.sh:108:20:style:See if you can use ${variable//search/replace} instead. [SC2001](https://github.com/koalaman/shellcheck/wiki/SC2001)
./asadmin $ASADMIN_OPTS create-jvm-options "\-Ddataverse.pid.providers=fake"
./asadmin $ASADMIN_OPTS create-jvm-options "\-Ddataverse.pid.fake.type=FAKE"
./asadmin $ASADMIN_OPTS create-jvm-options "\-Ddataverse.pid.fake.label=Fake DOI Provider"
Expand Down Expand Up @@ -147,12 +147,10 @@
# delete any existing mail/notifyMailSession; configure port, if provided:

./asadmin delete-javamail-resource mail/notifyMailSession

if [ $SMTP_SERVER_PORT"x" != "x" ]
then
./asadmin $ASADMIN_OPTS create-javamail-resource --mailhost "$SMTP_SERVER" --mailuser "dataversenotify" --fromaddress "do-not-reply@${HOST_ADDRESS}" --property mail.smtp.port="${SMTP_SERVER_PORT}" mail/notifyMailSession
else
./asadmin $ASADMIN_OPTS create-javamail-resource --mailhost "$SMTP_SERVER" --mailuser "dataversenotify" --fromaddress "do-not-reply@${HOST_ADDRESS}" mail/notifyMailSession
./asadmin $ASADMIN_OPTS create-system-properties "dataverse.mail.system-email='${ADMIN_EMAIL}'"
./asadmin $ASADMIN_OPTS create-system-properties "dataverse.mail.mta.host='${SMTP_SERVER}'"
if [ "x${SMTP_SERVER_PORT}" != "x" ]; then
./asadmin $ASADMIN_OPTS create-system-properties "dataverse.mail.mta.port='${SMTP_SERVER_PORT}'"
fi

}
Expand Down Expand Up @@ -280,6 +278,12 @@
exit 2
fi

if [ -z "$ADMIN_EMAIL" ]
then
echo "You must specify the system admin email address (ADMIN_EMAIL)."
exit 1
fi

echo "Setting up your app. server (Payara) to support Dataverse"
echo "Payara directory: "$GLASSFISH_ROOT
echo "Domain directory: "$DOMAIN_DIR
Expand All @@ -290,7 +294,7 @@
###
# take the domain up, if needed.
DOMAIN_DOWN=$(./asadmin list-domains | grep "$DOMAIN " | grep "not running")
if [ $(echo $DOMAIN_DOWN|wc -c) -ne 1 ];

Check failure on line 297 in scripts/installer/as-setup.sh

View workflow job for this annotation

GitHub Actions / Shellcheck

[shellcheck] reported by reviewdog 🐶 See if you can use ${#variable} instead. [SC2000](https://github.com/koalaman/shellcheck/wiki/SC2000) Raw Output: ./scripts/installer/as-setup.sh:297:9:style:See if you can use ${#variable} instead. [SC2000](https://github.com/koalaman/shellcheck/wiki/SC2000)
then
echo Trying to start domain $GLASSFISH_DOMAIN up...
./asadmin $ASADMIN_OPTS start-domain $GLASSFISH_DOMAIN
Expand Down
8 changes: 0 additions & 8 deletions scripts/installer/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,14 +568,6 @@
except:
sys.exit("Failure to execute setup-all.sh! aborting.")

# 7b. configure admin email in the application settings
print("configuring system email address...")
returnCode = subprocess.call(["curl", "-X", "PUT", "-d", adminEmail, apiUrl+"/admin/settings/:SystemEmail"])
if returnCode != 0:
print("\nWARNING: failed to configure the admin email in the Dataverse settings!")
else:
print("\ndone.")

# 8c. configure remote Solr location, if specified
if solrLocation != "LOCAL":
print("configuring remote Solr location... ("+solrLocation+")")
Expand Down
5 changes: 3 additions & 2 deletions scripts/installer/installAppServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ def runAsadminScript(config):
# commands to set up all the app. server (payara6) components for the application.
# All the parameters must be passed to that script as environmental
# variables:
os.environ['GLASSFISH_DOMAIN'] = "domain1";
os.environ['ASADMIN_OPTS'] = "";
os.environ['GLASSFISH_DOMAIN'] = "domain1"
os.environ['ASADMIN_OPTS'] = ""
os.environ['ADMIN_EMAIL'] = config.get('system','ADMIN_EMAIL')

os.environ['HOST_ADDRESS'] = config.get('glassfish','HOST_DNS_ADDRESS')
os.environ['GLASSFISH_ROOT'] = config.get('glassfish','GLASSFISH_DIRECTORY')
Expand Down
4 changes: 0 additions & 4 deletions src/main/docker/scripts/init_2_configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ echo "# Dataverse postboot configuration for Payara" > "${DV_POSTBOOT}"
# EE 8 code annotations or at least glassfish-resources.xml
# NOTE: postboot commands is not multi-line capable, thus spaghetti needed.

# JavaMail
echo "INFO: Defining JavaMail."
echo "create-javamail-resource --mailhost=${DATAVERSE_MAIL_HOST:-smtp} --mailuser=${DATAVERSE_MAIL_USER:-dataversenotify} --fromaddress=${DATAVERSE_MAIL_FROM:-dataverse@localhost} mail/notifyMailSession" >> "${DV_POSTBOOT}"

# 3. Domain based configuration options
# Set Dataverse environment variables
echo "INFO: Defining system properties for Dataverse configuration options."
Expand Down
Loading
Loading