-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add custom prefix to all HTTP server URLs #1338
Conversation
…level string processing with regexes. Revise normalization logic. Add the prefix to the api address reported to the frontend.
@appolloford and @Micket, does this solution still work for you with the prefix set using a configuration option rather than an environment variable? This option can be passed on the commandline ( |
Having a configuration option in commandline should work well, but I am wondering whether the priority is higher than users' config file. We need the node name and port number information in the URL prefix so that we can have OnDemand find the computing node. There may be some trouble if users overwrite it with some arbitrary value. |
@appolloford yes, the commandline parameters have the highest priority, and override the user config file, which overrides the global config file. You can also use commandline parameters to disable the user and/or global config file entirely. |
@confluence do we consider the following use cases?
If I do so, I see errors as
The core question is how do we support the scripting interface when the |
@kswang1029 that's a wrapper issue which should be discussed here. I thought that the wrapper didn't require changes, but I hadn't fully tested it yet. |
@kswang1029 actually, this is an issue with |
|
@kswang1029 I have pushed a change which I think fixes this issue. With this fix, I believe that your use case should work with the current development wrapper. Additionally, wrapper PR #154 fixes a parsing issue which breaks starting a backend from the wrapper with a prefix and auth. |
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 works fine as far as I can tell. No other regression from e2e tests.
I would prefer to have other reviewers to have another look and tests just in case I missed something.
just wondering, what happens if some weird string (ie containing special char etc) is set as the custom prefix? Would that cause problems or security issues? Maybe the backend needs to validate the prefix first before applying it and throw errors to stop the backend process. |
The prefix is limited to a subset of characters, otherwise it is ignored (I kept the selection of characters from the original PR). |
So testing this in a local k8s environment set to run CARTA at a subpath, I'm able to replicate the error reported here. When testing the code in the branch here where I have the
rather than the expected CARTA session. |
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.
So I managed to figure out what was causing the problem I reported earlier in conversation with @confluence. I was having the ingress rewriting requests such that an inbound request to /carta-a/
would be send to the container with backend as a request for /
. After removing the prefix-stripping code from the ingress configuration it seems that the app is now functioning as expected with the custom prefix.
Description
This is a re-creation of #1307 with a copy of the branch in our main repo, and implements #1309.
To be done before this can move out of draft:
Checklist
protobuf updated to the latest dev commit/ no protobuf update neededprotobuf version bumped/ protobuf version not bumped