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 a command to pgagroal-cli get configuration file locations #388

Closed
fluca1978 opened this issue Nov 2, 2023 · 1 comment · Fixed by #389
Closed

Add a command to pgagroal-cli get configuration file locations #388

fluca1978 opened this issue Nov 2, 2023 · 1 comment · Fixed by #389
Labels
feature New feature

Comments

@fluca1978
Copy link
Collaborator

I propose to add a command to pgagroal-cli to get information about the configuration files used by the deamon.
My proposal is to add conf ls (or conf files), so that for instance:

$ pgagroal-cli conf ls
Configuration file:        /etc/pgagroal/pgagroal.conf
HBA file:                  /etc/pgagroal/pgagroal_hba.conf
Limit file:                /etc/pgagroal/pgagroal_databases.conf
Frontend users file:       /etc/pgagroal/pgagroal_users.conf
Admins file:               /etc/pgagroal/pgagroal_frontend_users.conf
Superuser file:            /etc/pgagroal/pgagroal_admins.conf

In this way, even remotely, it is possible to know where the configuration files are located on the system running pgagroal.

@fluca1978 fluca1978 added the feature New feature label Nov 2, 2023
@jesperpedersen
Copy link
Collaborator

I'm ok with this - so 👍

fluca1978 added a commit to fluca1978/pgagroal that referenced this issue Nov 7, 2023
Introducing the command `conf ls` to `pgagroal-cli` that prints out
where the configuration files are located.
A new management key, action and three new management methods have
been added to implement the logic.
The idea is that, once the action is required, the management prints
on the socket every single `struct configuration*` path variables, and
then the management read method reads back in the same order to the
same list of values to be printed on the output screen.

In order to achieve this, two new static functions have been added to
the managemenet in order to write and read from the socket a single
path. A path is written with a size and the following path, assuming
it will never be larger than MAX_PATH or an error will be thrown.

Documentation updated.

Shell completions updated.

Close agroal#388
fluca1978 added a commit to fluca1978/pgagroal that referenced this issue Nov 7, 2023
Introducing the command `conf ls` to `pgagroal-cli` that prints out
where the configuration files are located.
A new management key, action and three new management methods have
been added to implement the logic.
The idea is that, once the action is required, the management prints
on the socket every single `struct configuration*` path variables, and
then the management read method reads back in the same order to the
same list of values to be printed on the output screen.

In order to achieve this, two new static functions have been added to
the managemenet in order to write and read from the socket a single
path. A path is written with a size and the following path, assuming
it will never be larger than MAX_PATH or an error will be thrown.
In the case a path is NULL or empty, an empty string will be written
on the socket and so the final result is that the entry will be
printed as empty in the command output.

Documentation updated.

Shell completions updated.

Close agroal#388
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants