Cas configuration properties source locator

132 views
Skip to first unread message

Mohamed Amdouni

unread,
Mar 5, 2024, 6:58:39 AM3/5/24
to CAS Community
Hello,

I’m using cas management 6.6.4 and cas 6.6.15

I have an instance of cas management that uses standalone mode. I use the cas.standalone.configuration-directory property to set the configuration folder where I have my management.properties application.properties and bootstrap.properties.

All files are loaded successfully in the log files but the class path files are loaded in the end which will override my values. 

In the documentation it’s specified that the class path files application management properties are overrided by external files. 

Do I missed some options to override class path files ? 

Thanks.





Ray Bon

unread,
Mar 5, 2024, 9:46:04 PM3/5/24
to cas-...@apereo.org
Mohamed,

I was having similar problems with v6.5.
Maybe try version 7.0

Ray

On Tue, 2024-03-05 at 10:53 +0100, Mohamed Amdouni wrote:
Notice: This message was sent from outside the University of Victoria email system. Please be cautious with links and sensitive information.

Mohamed Amdouni

unread,
Mar 6, 2024, 5:32:34 AM3/6/24
to cas-...@apereo.org
Ray, Thanks for your answer.

I think that the problem is also on 6.6.0+ versions. 


The embedded properties are loaded after external files.

In the previous versions, only yaml files were considered and since they are empty by default, there is no impact on the defined properties in the external files.
Now since this fix (https://github.com/apereo/cas/commit/1c48048242bae9fdee668a6b9e156e715f8b3617) take in account all types of configuration files (yaml, yml and properties), and since there are default properties files in the classpath, they will be always loaded at the end and override external ones.

Is there a way to override the DefaultCasConfigurationPropertiesSourceLocator, so I will change the order of loading properties?

Now the only workaround that I found is to define system properties on the cas startup script : -Dcas.server.name and jpa service registry properties, otherwise it will load an empty memory database for cas management...

Best Regards.

--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/1dcab3b1061875b24a93f0c8a59186f119807fcb.camel%40uvic.ca.

Ray Bon

unread,
Mar 6, 2024, 12:06:06 PM3/6/24
to cas-...@apereo.org
Mohamed,

I know cas will load config so that external files have priority over embedded files. There must be some other factor in cas-management that is not in cas to upset this behaviour.
Tomcat will log properties passed in on command line, so this logging needs to be turned off so secrets do not end up in the log files.

Ray
Reply all
Reply to author
Forward
0 new messages