Skip to content

[#567] encrypt/compress/decrypt/decompress without config - #570

Merged
jesperpedersen merged 1 commit into
pgmoneta:mainfrom
dancingactor:main
Apr 3, 2025
Merged

jesperpedersen merged 1 commit into
pgmoneta:mainfrom
dancingactor:main

Conversation

@dancingactor

Copy link
Copy Markdown
Contributor

Implement #567

This PR enable CLI running encrypt/compress/decrypt/decompress commands without pgmoneta.conf or -c

Details

  1. Add is_local_command check to determine if the command should run locally
  2. Default to ZSTD when config is not provided for local compression

Comment thread src/cli.c Outdated
if (ret)
{
if (host == NULL || port == NULL)
int is_local_command = 0;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

bool can_be_local_command = false;

Comment thread src/cli.c Outdated
if (!strcmp(cmd, COMMAND_ENCRYPT) || !strcmp(cmd, COMMAND_DECRYPT) ||
!strcmp(cmd, COMMAND_COMPRESS) || !strcmp(cmd, COMMAND_DECOMPRESS))
{
is_local_command = 1;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can't we just use need_server_conn ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

But at that point, need_server_conn hasn't been defined and calculated yet

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can't you move that logic up; parsing, and setting the necessary variables ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's a good idea, let me try it

@jesperpedersen jesperpedersen added the bug Something isn't working label Apr 3, 2025
@jesperpedersen

Copy link
Copy Markdown
Member

Merged.

Thanks for your contribution !

@dancingactor

dancingactor commented Apr 3, 2025 •

Copy link
Copy Markdown
Contributor Author

@jesperpedersen Really appreciate your time and feedback! Are there any other issues to contribute?

@jesperpedersen

Copy link
Copy Markdown
Member

@dancingactor Can you take #523 ?

@dancingactor

dancingactor commented Apr 3, 2025 •

Copy link
Copy Markdown
Contributor Author

Sure, I would like to try it. Thanks you!

@jesperpedersen

Copy link
Copy Markdown
Member

@dancingactor You know how it works...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants