Closed T1t4m1un closed 3 months ago
@T1t4m1un the is_same_tls
function has the right name, what Jeper was suggesting is to make the code more robust by reversing the condition checks: test explicitly if the tls settings are the same, then return true, otherwise return false.
Your implementation at the moment does the opposite: checks if the tls are not the same, otherwise returns (by default) true.
With regard to strcmp
, I know we are using strcmp
in many places, but we should start using strncmp
for safety reasons.
@T1t4m1un the
is_same_tls
function has the right name, what Jeper was suggesting is to make the code more robust by reversing the condition checks: test explicitly if the tls settings are the same, then return true, otherwise return false. Your implementation at the moment does the opposite: checks if the tls are not the same, otherwise returns (by default) true.With regard to
strcmp
, I know we are usingstrcmp
in many places, but we should start usingstrncmp
for safety reasons.
Thank you very much for your patient reply! Please take a look my latest commit🥺
Please reverse the true
and false
value checks as Jesper asked, then add the note about the need for restart into the documentation and your name to the authors file.
Please reverse the
true
andfalse
value checks as Jesper asked, then add the note about the need for restart into the documentation and your name to the authors file.
Thank you for your recognition of me!
I'm editing the documentation but have some specific features want to confirm with you.
In our current implementation, we only check the config in server section. We won't check whether the host name or TLS config is same as former one in the [pgagroal] section
. Is this the feature we expected?
# provided config same as `getting started`
pgagroal-cli conf set tls on # success, we won't check the config not in server section
pgagroal-cli conf set server.primary.tls on # failed, we do check the config in server `primary` section
Thank you for your answer!
The TLS in the [pgagroal]
is to secure pgagroal itself, so "server side".
The TLS in the server sections are to support connecting to secure PostgreSQL instances.
The TLS in the
[pgagroal]
is to secure pgagroal itself, so "server side".The TLS in the server sections are to support connecting to secure PostgreSQL instances.
Thank you for your answer! I emphasized it in my documentation. Looking forward to your review~
Sorry for such careless mistake. I've fixed it and add some short comments.
I haven't change the return type of restart_bool
, I'm looking forward for your opinion on it:
Because all the exsisting restart_XXX functions return int. It's for code style consistency.
Sorry for such careless mistake. I've fixed it and add some short comments.
No problem, but better test your code before pushing for review.
I haven't change the return type of
restart_bool
, I'm looking forward for your opinion on it:
The idea should be this: the is_same_xxx
functions return a bool
, the restart_xxx
functions return and int.
Please, meld all the commits into a single one and force push (or push to another branch) so that we can get the last look at it.
@jesperpedersen PTAL seems fine to me
Rebased, and merged.
Thanks for your contribution !
Functionality:
Implement
restart_server
function for daemon with conditional restarts and warnings for configuration changes, including TLS updates.Document:
Test Case Verification: