Bug Report Template
Description
When running “upcp -sb” it keeps placing the following in the config.ini, it keeps leaving out the quotes “” for provider_key= and keeps apnscp from starting.
Steps to Reproduce
Please provide detailed steps to reproduce the bug. Include any necessary code snippets, commands, or configuration files.
Run “upcp -sb”
Expected Behavior
Place quotes around the key to keep it from breaking config.ini syntax.
Actual Behavior
It updates provider_key=key instead of quotes “key”
Environment
ApisCP version: cpcmd misc:cp-version
revision: fac0a5688de1b6172daf33039de78abd003a892a
timestamp: 1712962130
ver_maj: 3
ver_min: 2
ver_patch: 41
ver_pre: 24-gfac0a5688
dirty: false
debug: false
Operating System: uname -r
4.18.0-513.24.1.el8_9.x86_64
Additional relevant information (e.g., PHP version, database, etc.):
Using builtin dns (had previously set to CloudFare and decided to change back to builtin)
During bootstrap it shows
TASK [apnscp/bootstrap : Setting dns => provider_key = keyring:xxx] **********************************************************************************************************************
changed: [localhost]
I believe this may be a bug as it isn’t putting the quotes around it.
Additional Information
Provide any additional information about the bug, such as error messages, logs, screenshots, or any other relevant details.
upcp
, should be good to go now. You’ll likely need to remove the offending value from /usr/local/apnscp/config/custom/config.ini, [dns]
=> provider_key
before running upcp
.
Appreciate the fast response!
I tried it again and it still didn’t put the quotes. I did see it picked up the new code though when I ran it.
Fast-forward
lib/Opcenter/Admin/Settings/Cp/Config.php | 4 +±-
lib/modules/keyring.php | 11 +++++++++++
2 files changed, 13 insertions(+), 2 deletions(-)
TASK [apnscp/bootstrap : Setting dns => provider_key = keyring:key
changed: [localhost]
[/usr/local/apnscp/lib/config.php:216]
0B. Error_Reporter::handle_error(2, "syntax error, unexpected '=' in /usr/local/apnscp/config/custom/config.ini on line 34", "/usr/local/apnscp/lib/config.php", 216)
[n/a]
1B. parse_ini_file("/usr/local/apnscp/config/custom/config.ini", true, 2)
[/usr/local/apnscp/lib/config.php:216]
Adding the quotes fixes it and allows apscpn to start but it still seems to break again when upcp is ran. I double checked this three times and it broke each time.
And give it a go once more…
Same thing unfortunately
Also didn’t see where upcp pulled any new code changes.
It’s done overnight when cp.nightly-updates
is enabled, default: true. Commit with the fix is 1fba8f5
, which quotes the value in config/custom/config.ini. After restarting the panel, which is registered as handler here, the configuration would be rebuilt into storage/constants.php thereby resolving the issue.
In its entirety everything should be fine so long as the handler (“Restart apnscp”) ran as part of role execution in apnscp/bootstrap.
I will take a look when I get back and try again!
I can confirm this is fixed now
Appreciate the prompt response and resolution!