-
Notifications
You must be signed in to change notification settings - Fork 1
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
update entrypoint to find auth property configs #15
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Ford, it looks like you're filtering out a single file from the directory, and keeping everything else. Is there a good way to switch it around and positively select only the files you're interested in? That might be more robust if you need to add new files to the directory in future - otherwise you'll have to update this script again, and there's a chance that you'll forget and get weird errors which have nothing to do with the thing you're changing.
Is the list of files you want to include very long? It might be simplest just to list them explicitly if there are only a few.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate comment deleted
I chatted with @fordmcdonald and I'm not sure if we should rely only on file patterns for inclusion. And user could potentially put valid/invalid files with whatever name. So maybe, read all the files and quit/error if the parsing doesn't work? or have every valid file follow |
The original intent with the file inclusion stuff was to allow users to specify config files, with names that make sense to them, and have all those configs included in the main config. IIRC (which I probably don't) XNAT loads in all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it'll work right to me. Do you need spaces between the ( $(
?
I'm not approving because it seems like there's more to talk about
@hollandjg I agree with you. I think we should be selecting only configuration files with .properties. In our case, I believe the only config file we should be matching is "brownldap-provider.properties". Otherwise, XNAT will default to "localdb" as the provider. @mirestrepo Do you remember the reason why we're copying the example config into the auth directory in the first place? I feel like it's not serving a purpose, other than providing a template. But the template can still exist in the repository as reference. @broarr I don't believe I need spaces there. From my testing, it seemed to work without them. XNAT Auth Configuration Docs: https://wiki.xnat.org/documentation/configuring-authentication-providers |
That absolutely makes sense. Let's not copy the example file in the docker and only look for |
Ready for approval. |
Update Docker Entrypoint to Find Authentication Configs
In the entrypoint script, the following line
local auth_configs=(/data/xnat/home/config/auth/!(ldap-provider.properties.example))
was yielding an error when no authentication property files were provided.Rather than an empty list,
auth_configs
was assigned the literal pattern string/data/xnat/home/config/auth/!(ldap-provider.properties.example
. Instead, we can use the find command to detect auth provider property files:local auth_configs=($(find /data/xnat/home/config/auth/ -type f -not -name 'ldap-provider.properties.example'))
This results in the correct behavior if a valid config file is present or absent.