Hi
Thank you, that still didnt help. I still don't get CAS to behave like
other spring boot applications
When using -Dspring.profiles.active=dev it seems like it doesn't load the
same default config as it used to.
Here is my full yml file (I have tried it as cas.yml and application.yml -
not sure what filename to use).
This is the only file besides log4j in my /etc/cas/config. I've tried
setting all the default settings as well, but it doesn't take affect.
When use the file below, without using any profile, I expect only the first
part of the file to be loaded.
Instead the whole file is read including all profiles. I suspect maybe it
is because standalone is the default profile, which
causes CasCoreBootstrapStandaloneConfiguration to load the properties, and
it loads everything it finds without paying attention to profiles. If that
is how it is suppose to work and you are suppose to use a different profile
after tinkering with ldap, I can live with that...
When running with -Dspring.profiles.active=dev I expect the first section,
plus the section specifically for the dev profile to be loaded.
Instead - im not sure what is loaded, it fails before it gets to my profile
specific items when looking at the logs, but it looks like the top section
of the file isn't even read, because it doesn't look for services in
/etc/cas/services as mentioned in the config, instead it's looking at
/tmp/cas/services which I have no idea where it gets that config from. This
is what really confuses me. My config is similar to other spring boot
application we have...
Same with -Dspring.profiles.active=production...
What I'm aiming for is one config file that I can use for dev and prod,
which loads the appropriate profile for the different configs, and also
specifying the secret things using command line properties or environment
variables. But for now just getting profiles to work is my first step..
*I copied many of these properties from the application.properties file
from the base CAS source in an attempt to make sure all the defaults are
provided*
info:
description: CAS Configuration
cas:
serviceRegistry:
config:
location: file:/etc/cas/services
initFromJson: true
repeatInterval: 12
startDelay: 15000
watcherEnabled: true
authn:
ldap:
- allowMultipleDns: false
baseDn: ou=people,dc=opencollab,dc=co,dc=za
connectTimeout: 5000
dnFormat: uid=%s,ou=people,dc=opencollab,dc=co,dc=za
# Without a profile the application should fail, because this does
not exist
# Instead it uses production profile's config
ldapUrl: ldaps://ldap.myorg.co.za:636
name: My Ldap Instance
order: 0
principalAttributeId: uid
principalAttributeList: sn,cn:commonName,givenName
principalAttributePassword: userPassword
providerClass: org.ldaptive.provider.unboundid.UnboundIDProvider
subtreeSearch: true
type: DIRECT
useSsl: true
useStartTls: false
userFilter: uid={user}
# I could probably remove a lot of these I don't intend to use
pac4j:
bitbucket:
clientName: Bitbucket
dropbox:
clientName: Dropbox
facebook:
clientName: Facebook
foursquare:
clientName: Foursquare
github:
clientName: Github
google:
clientName: Google
linkedIn:
clientName: LinkedIn
paypal:
clientName: PayPal
twitter:
clientName: Twitter
windowsLive:
clientName: Windows Live
wordpress:
clientName: WordPress
yahoo:
clientName: Yahoo
endpoints:
enabled: false
restart:
enabled: false
sensitive: true
shutdown:
enabled: false
management:
add-application-context-header: false
context-path: /status
security:
enabled: true
roles: ACTUATOR,ADMIN
sessions: if_required
security:
basic:
authorize-mode: role
enabled: false
path: /cas/status/**
server:
connection-timeout: 2
context-parameters:
isLog4jAutoInitializationDisabled: true
context-path: /
error:
include-stacktrace: NEVER
max-http-header-size: 2097152
port: 8443
session:
cookie:
http-only: true
timeout: 300
tracking-modes: COOKIE
ssl:
# Apache will take care of SSL
enabled: false
ajp:
allowTrace: false
asyncTimeout: 5000
enableLookups: false
enabled: true
maxPostSize: 20971520
port: 8009
protocol: AJP/1.3
proxyPort: -1
redirectPort: -1
scheme: http
secure: true
tomcat:
accesslog:
enabled: true
pattern: '%t %a "%r" %s (%D ms)'
suffix: .log
basedir: build/tomcat
max-http-post-size: 2097152
max-threads: 10
port-header: X-Forwarded-Port
protocol-header: X-Forwarded-Proto
protocol-header-https-value: https
remote-ip-header: X-FORWARDED-FOR
uri-encoding: UTF-8
use-forward-headers: true
s