-
Notifications
You must be signed in to change notification settings - Fork 265
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 the CLI param "-dbURI" #4385
Conversation
I have fixed errors for E2E tests. |
const char* pwd = strstr(dbURI, "${PWD}"); | ||
if (pwd != NULL) | ||
{ | ||
if (strlen(passwd) == 0) | ||
{ | ||
LM_X(1, ("Invalid Command Line Options: -dbURI is used with a password substitution, but no password (-dbpwd) is supplied")); | ||
} | ||
|
||
uri = std::string(dbURI, pwd - dbURI) + passwd + (pwd + 6); | ||
} |
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.
Why implementing this password substitution mechanism? Why don't just use the password in the -dbUri
parameter? Could you elaborate on this?
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 is because Orion-LD implements that functionality.
See also following comment:
#3794 (comment)
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.
After reading the documetnation added to cli.md, now it's clear to me how it works :)
It can be an interesting feature. Let's keep it.
NTC
@@ -148,6 +148,7 @@ char authMech[64]; | |||
char authDb[64]; |
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.
CHANGES_NEXT_RELEASE should include the changes in this PR. Maybe something like this:
- Add: CLI parameter -dbUri / env var ORION_MONGO_URI (#3794)
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.
In addition, documetnation in cli.md should be modified to describe the new CLI and env var
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.
|
||
// Add auth parameter if included | ||
if (strlen(username) != 0 && strlen(passwd) != 0) | ||
if (strlen(dbURI) != 0) |
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.
If -dbUri
is used at the same time some of the old parameters (-dbhost
, etc.) I understand that -dbUri
will take preference.
That's fine, but such case of combining old and new CLI would be probably a misconfiguration that should be at least warned to the user (or maybe even better, raise a LM_X so the user have the chance to fix the configuration).
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.
Fixed in 477566c
Co-authored-by: Fermín Galán Márquez <[email protected]>
Co-authored-by: Fermín Galán Márquez <[email protected]>
PR looks nice! :) However, there is a small conflict in CHANGES_NEXT_RELEASE that need to be solved before merging. Could you do it, please? In addition, I'm afraid I don't understand Japanese, so I cannot evaluate that parts in the PR. Maybe @fisuda you could help having a look and providing feeback/LGTM, please? Thanks! |
I have fixed the conflict in CHANGES_NEXT_RELEASE. |
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.
LGTM. Thanks!
If at the end @fisuda provide some feedback, it could be taken into account in a separate PR, of course.
PR #3794