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

Support all labkey.xml/ROOT.xml settings via application.properties #680

Merged
merged 2 commits into from
Jan 19, 2024

Conversation

labkey-jeckels
Copy link
Contributor

Rationale

We're enabling full compatibility for configuration via embedded Tomcat.

Related Pull Requests

Changes

  • Propagate settings from application.properties
  • Update references to config files in comments

@@ -44,6 +48,26 @@ mail.smtpUser=@@smtpUser@@
# mail.smtpSocketFactoryClass=@@smtpSocketFactoryClass@@
# mail.smtpAuth=@@smtpAuth@@

# Optional - JMS configuration for remote ActiveMQ message management for distributed pipeline jobs
# https://www.labkey.org/Documentation/wiki-page.view?name=jmsQueue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have we captured in a TODO list somewhere that we'll need to update these docs for embedded?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, there's docs handoff task in the story on the board. I'll add pointers to these two pages as definitely needing attention in the spec.

@@ -262,10 +293,22 @@ private List<ContextResource> getDataSourceResources(ContextProperties props) th
dataSourceResource.setProperty("accessToUnderlyingConnectionAllowed", getPropValue(props.getAccessToUnderlyingConnectionAllowed(), i, ACCESS_TO_CONNECTION_ALLOWED_DEFAULT, "accessToUnderlyingConnectionAllowed"));
dataSourceResource.setProperty("validationQuery", getPropValue(props.getValidationQuery(), i, VALIDATION_QUERY_DEFAULT, "validationQuery"));

// These two properties are handled different, as separate parameters
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// These two properties are handled different, as separate parameters
// These two properties are handled differently, as separate parameters

{
ldapResource.setProperty("credentials", ldapProps.getCredentials());
}
if (ldapProps.isUseSsl())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this if is not needed since we can just as well set the property to false. (Same for isUseTls below.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. I was aiming for to create the resource most similarly to how it would have been configured in the XML world, but this simplification should be safe.

@labkey-jeckels labkey-jeckels merged commit fdec4ae into tomcat10 Jan 19, 2024
4 of 6 checks passed
@labkey-jeckels labkey-jeckels deleted the tc10_moreProperties branch January 19, 2024 23:12
ldapResource.setProperty("sslProtocol", ldapProps.getSslProtocol());
}
return ldapResource;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking care of this, @labkey-jeckels . I know I'm late to the party, but it seems unfortunate that LabKeyServer must know about every possible property used by every module. Shouldn't we introduce a registration mechanism for modules to handle the properties they care about? Similar to startup properties.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like needing centralized knowledge of these properties either, but this code has no idea about modules. And the module code doesn't know anything about application.properties or how to find it.

Some of these properties, such as disabling 2FA, could be handled via startup properties. That may be worth doing.

JMS and LDAP could probably be handled differently too but this was the approach I found that was as close to the old mechanism as possible, and easiest to manage while we're in transition between standalone and embedded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[LK CI] Ensure we handle all properties currently configurable through ROOT.xml/labkey.xml
3 participants