Needed to UAPI for work with NginX Manager

Operating System & Version
CLOUDLINUX 7.7
cPanel & WHM Version
96.0.15

NabiKAZ

Active Member
Jun 18, 2007
31
1
58
I use WHM v96.0.15 and new NginX manager option in WHM.

I tried this for clear cache of nginx, and used Token and no problem with this:

But now I need to clear cache in Cpanel for specific user, I working on a plugin for cpanel, but I need UAPI to do it.
But I can not find any UAPI for working with nginx manager and clear cache nginx.

Does there are any UAPI for this?, if not, Can we hope it will be released in future releases? Or does it contradict its structure and should not be waited for?
And finally what's your solution for this for now?
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
17,439
2,836
363
cPanel Access Level
Root Administrator
Hey there! There isn't an API for this just yet. In a version that will be released soon, we plan to have the option directly in the cPanel interface that will allow a user to clear their cache, and the team is also working on API tools that will be released in the future as well!
 
  • Like
Reactions: NabiKAZ

NabiKAZ

Active Member
Jun 18, 2007
31
1
58
I tried to use WHM API with Token.

Sample code:
Code:
<?php
:
$rootuser = "root";
$token = file_get_contents('./token_file');
$query = "https://127.0.0.1:2087/json-api/nginxmanager_clear_cache?api.version=1&user=" . $user;
$curl = curl_init();
$header[0] = "Authorization: whm $rootuser:$token";
:
I saved the Token file in plugin directory (/usr/local/cpanel/base/frontend/paper_lantern/plugin_dir/token_file). with owner: root, perm: 644
But I see all users access read to it!

I set 600 permission for this file, But get this error in plugin page:
"Access denied. Child failed to make LIVEAPI connection to cPanel."

I checked it in the plugin file:
<?php echo shell_exec('whoami');
I get: the username that logined to cpanel.

For now, How can set correct permission for plugin files, to well works plugin, but users can not access it?
 
Last edited:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
17,439
2,836
363
cPanel Access Level
Root Administrator
I heard back from our team and the best way to move forward at this time would be a privilege escalation as outlined here:

 

Tiago Dias

Registered
May 24, 2023
2
0
1
Lisboas
cPanel Access Level
Website Owner
Hello there, I'm trying to access the Site Builder on Cpanel to access site but this error keeps popping up : " Child failed to make LIVEAPI connection to cPanel."
I never installed any app or anything. I always did everything online, through the icon "site Builder" .



I understand almost nothing about this subject and I really need your help. Thank you

Tiago Dias
 

Attachments

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
17,439
2,836
363
cPanel Access Level
Root Administrator
That is a third-party application that your host installed on that particular server. Since it isn't related to the cPanel software, I don't have any ideas on why that wouldn't be working.

It would be best to speak with your hosting provider or datacenter and let them know about this problem.
 

Tiago Dias

Registered
May 24, 2023
2
0
1
Lisboas
cPanel Access Level
Website Owner
That is a third-party application that your host installed on that particular server. Since it isn't related to the cPanel software, I don't have any ideas on why that wouldn't be working.

It would be best to speak with your hosting provider or datacenter and let them know about this problem.
Thank you so much.