pgagroal icon indicating copy to clipboard operation
pgagroal copied to clipboard

Allow `pgagroal-admin` to specify where to store the master key password file

Open fluca1978 opened this issue 11 months ago • 8 comments

When pgagroal-admin is invoked to generate a master key, i.e., with the master-key command, it generates the file into $HOME/.pgagroal/master,key, and such location is not configurable. Users could require to store the private pgagroal stuff into another location, for example `~/.config~.

There is therefore the need for pgagroal-admin to have a command line option for the master-key command to specifiy where to put (and hence, read from) the master key file.

fluca1978 avatar Mar 23 '24 10:03 fluca1978

The management TLS files are also loaded from there...

jesperpedersen avatar Mar 23 '24 12:03 jesperpedersen

@palak-chaturvedi is working on this

fluca1978 avatar Mar 25 '24 08:03 fluca1978

v001-Adding_File_Name.patch I worked on this and made the changes. I just wanted to know if there is a specific code formatter that I have to run?

palak-chaturvedi avatar Mar 26 '24 13:03 palak-chaturvedi

@fluca1978 @jesperpedersen https://github.com/palak-chaturvedi/pgagroal/tree/addingFileName

This a branch in my github.

palak-chaturvedi avatar Mar 26 '24 13:03 palak-chaturvedi

@palak-chaturvedi you should create a pull request for this, please. In the meantime, I took a look at the patch, and while the work is nice, this cannot be imported. The "master.key" file name is used in different places around the code, for example in security.c. Therefore, I would rather not change the filename as you did, but change the directory where to store the file named 'master.key'. At glance, the way to go could be to modify pgagroal_get_home to be able to detect if a different location rather than ~/.pgagroal has to be used.

fluca1978 avatar Mar 26 '24 16:03 fluca1978

Ok I will Can I store the required location in a variable or we need an argument for it? @fluca1978

palak-chaturvedi avatar Mar 27 '24 13:03 palak-chaturvedi

Ok I will Can I store the required location in a variable or we need an argument for it? @fluca1978

You are free to propose the solution you think is the best, and can also improve it later after a review. One optimal approach, but longer, could be to introduce a configuration tunable for the location to where store the files.

But let's go with calm and see your idea first.

fluca1978 avatar Mar 27 '24 14:03 fluca1978

created a pull request. @fluca1978 https://github.com/agroal/pgagroal/pull/430

palak-chaturvedi avatar Mar 27 '24 19:03 palak-chaturvedi