Skip to content
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

Merged
merged 9 commits into from
Aug 24, 2023
Merged

Conversation

ctc-nakatsuka
Copy link
Contributor

PR #3794

@ctc-nakatsuka
Copy link
Contributor Author

I have fixed errors for E2E tests.

Comment on lines 337 to 346
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);
}
Copy link
Member

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?

Copy link
Contributor Author

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)

Copy link
Member

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];
Copy link
Member

@fgalan fgalan Aug 9, 2023

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)

Copy link
Member

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

Copy link
Member

@fgalan fgalan Aug 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in d9fd270 and b7cdb85


// Add auth parameter if included
if (strlen(username) != 0 && strlen(passwd) != 0)
if (strlen(dbURI) != 0)
Copy link
Member

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).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 477566c

doc/manuals/admin/cli.md Outdated Show resolved Hide resolved
@fgalan
Copy link
Member

fgalan commented Aug 23, 2023

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!

@ctc-nakatsuka
Copy link
Contributor Author

I have fixed the conflict in CHANGES_NEXT_RELEASE.

Copy link
Member

@fgalan fgalan left a 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.

@fgalan fgalan merged commit 19d0f95 into telefonicaid:master Aug 24, 2023
@fgalan fgalan mentioned this pull request Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants