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

DB connection: defaults and more options #7980

Closed
4 tasks done
poikilotherm opened this issue Jun 29, 2021 · 3 comments · Fixed by #8915
Closed
4 tasks done

DB connection: defaults and more options #7980

poikilotherm opened this issue Jun 29, 2021 · 3 comments · Fixed by #8915
Milestone

Comments

@poikilotherm
Copy link
Contributor

poikilotherm commented Jun 29, 2021

Now that #7701 is merged and we are on 5.2021.4, we can enable real defaults for the database connection.

Context

I learned that any variable expansion supporting annotations or files, that will have Payara create resources, containers or sth else from, will not retrieve default values from the microprofile-config.properties file bundled in the WAR.

Instead, we need to provide defaults with the new ${MPCONFIG=name:default} syntax.

Todo

  • Add defaults to the connection URL. Using "localhost", "5432" and "dataverse" will allow most installation and devs to go without config.
  • Use the newly introduced caps to configure more Payara specific properties regarding connection monitoring etc.
  • Edit release notes of 5.3 to be more precise about database configuration not having defaults...
  • Maybe others
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Jun 30, 2021
…IG. IQSS#7980

Previously, with Dataverse software 5.3, the option to configure
the database connection has been moved into the codebase. Admins
can set details via MicroProfile Config.

With updating to Payara 5.2021.4, we can provide default values
for the connection details. Before, this had been tried with adding
them to META-INF/microprofile-config.properties. However, this is
not possible due to the timing of resource creation in the application
server vs. reading the properties file.

IQSS#7980
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Jun 30, 2021
As requested by @pdurbin, the long list was quite overwhelming.
It's now damped down to 12 options in 3 subsubsections of the docs.
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Jun 30, 2021
As requested by @pdurbin, the long list was quite overwhelming.
It's now damped down to 12 options in 3 subsubsections of the docs.
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Jun 30, 2021
@poikilotherm
Copy link
Contributor Author

poikilotherm commented Aug 11, 2022

FWIW: this can now be addressed given the fact that Payara 5.2022.2 included a fix for this.

poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Aug 11, 2022
…IG. IQSS#7980

Previously, with Dataverse software 5.3, the option to configure
the database connection has been moved into the codebase. Admins
can set details via MicroProfile Config.

With updating to Payara 5.2021.4, we can provide default values
for the connection details. Before, this had been tried with adding
them to META-INF/microprofile-config.properties. However, this is
not possible due to the timing of resource creation in the application
server vs. reading the properties file.

IQSS#7980
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Aug 11, 2022
As requested by @pdurbin, the long list was quite overwhelming.
It's now damped down to 12 options in 3 subsubsections of the docs.
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Aug 11, 2022
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Aug 11, 2022
The avoid hacky parameter additions via the database name,
this commit adds support for adding parameters to the
JDBC URL. It defaults to empty (no parameters).
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Aug 11, 2022
With the addition of the advanced (but proprietary, Payara-only) settings
for database connection monitoring, the non-present default for connection
validation triggered unnecessary log clutter. Adding an empty default
makes these go away and is inline with the default of Payara.
@landreev
Copy link
Contributor

Here's a real life example of a problem this will solve:
We had a support request (RT 321319) where a remote admin was asking about hardening their installation, specifically about enforcing SSL on the connection between the application and the database.
When the jdbc library opens the connection to PostgresQL, it defaults to sslmode=prefer (meaning, it will use SSL if the remote server supports it; but would also be happy to use an unencrypted connection if not; it does not verify the SSL certificates in this mode either). If a user wants to ensure that their Dataverse installation will never talk to the database w/out SSL, they need to use sslmode=require. Or sslmode=verify-ca, to verify the certs.
As of now, the only way to pass this parameter is to attach it to the database name, like this:
<system-property name="dataverse.db.name" value="dvndb?sslmode=require"/>
so that it ends up in the combined connection string; but it's a bit hacky. #8915 will provide a clean way to supply this extra parameter (via dataverse.db.parameters).

@donsizemore
Copy link
Contributor

I am pleased to report that, so far, Leonid's ?sslmode=require suggestion above appears to work with a test RDS instance.

pdurbin added a commit to poikilotherm/dataverse that referenced this issue Jan 12, 2023
pdurbin added a commit to poikilotherm/dataverse that referenced this issue Jan 17, 2023
pdurbin added a commit to poikilotherm/dataverse that referenced this issue Jan 17, 2023
pdurbin added a commit to poikilotherm/dataverse that referenced this issue Jan 23, 2023
@pdurbin pdurbin added this to the 5.13 milestone Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants