-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Allow adding config.toml
to Selenium-Hub
#1757
Conversation
Hi @xcalizorz thanks for working on this. The screenshots demonstrate that it seems to be working. I have observed that all of the user-editable files (sample docker-compose.yml and other sample files), are generally kept in the root. I think one advantage is that images won't get accidentally built with the modified example file. Because it's in the Hub folder, I believe the example-config.toml would still get copied into the image even if one weren't explicitly using the custom config. What do you think about creating a generate_config file to generate the config.toml, similar to what we have in the Standalone folder? Before I saw your pull request, I was playing around with something like this as a derivative image: append-basic-auth:
Dockerfile:
Then inside of start-selenium-grid-hub.sh I added:
and I then added the --config flag to the java command so the Hub would read it. The only thing I didn't figure out was how to make the auth variables optional yet, since I was making a derivative image. Will any of this help? What do you think? |
@jamesmortensen sounds interesting, I'll give it a try when I have time later this week. If we want to ignore files in from the build, I could just add a simple What do you think about solving this via |
Hey @xcalizorz and @jamesmortensen , I have been following this conversation. I was wondering if the changes you are about to make will also support adding config other than basic auth, like relaying to an appium server (https://www.selenium.dev/documentation/grid/configuration/toml_options/#relaying-commands-to-a-service-endpoint-that-supports-webdriver), which would be the use case I happen to be interested in? |
@robinmatz you can add any config you want. My example config is using basic auth, but as long as you are able to add it into the Before this PR the Selenium hub would practically ignore the |
Hey @xcalizorz ,
which made me unsure if allowing basic auth was the only objective of this PR. |
Hi @xcalizorz based on @robinmatz feedback and me doing a little more digging on my part, I can see that example-config.toml is not passed to the image during build time as I had mistakenly thought. (I was confusing docker context with the actual image being built). I also validated that the grid works both with the config mapped via the volume property, with the username and password, and that it works without the config.toml and with no authentication and is backwards compatible. I also confirmed that when the config.toml is included, the username and password is required in order to access the Grid. Thus, I'll go ahead and merge these changes so that they'll be available in the next release. |
Fantastic timing; I was investigating this issue :D |
@jamesmortensen Looking forward for the release :) |
cc @diemol |
FYI: 4.8.0 was just released yesterday. So the ability to add the config.toml to the Hub should be available now. @omdhimar28 @ErcinDedeoglu :) https://github.com/SeleniumHQ/docker-selenium/releases/tag/4.8.0-20230123 |
Thanks for the update @jamesmortensen :) |
* Use config.toml in hub as well Fixes SeleniumHQ#1754 * Add docker-compose demonstrating usage of config.toml Co-authored-by: Xcalizorz <[email protected]>
Thanks for contributing to the Docker-Selenium project!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines, applied for this repository.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Description
We now read the config file as well. The base Dockerfile creates the
config.toml
every time & leaves it empty. Hence, there will be no issues, if a user decides to not use theconfig.toml
.Motivation and Context
It is not possible to load a personalized
config.toml
for the Selenium-Hub, hence adding things like basic auth is not easily possible from the outside (as asked for in #1754 ).Screenshots
This PR enables users to insert their own
config.toml
as they wish.Types of changes
Checklist