Welcome to the PufferPanel community forums! If you need help please register an account and post in the Support category.

Preview files



  • Hi guys,
    I want to use preview files function on my another web server for build back-end page. I use curl function for get .json file, but it's don't work (permissions). Anyone have idea for it?

    It's my code:

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_URL, 'http://my-domain.com/daemon/server/server-uuid/file/plugins/ServerListPlus/PlayerCache.json');
    $result = curl_exec($ch);
    curl_close($ch);
    


  • We use OAuth2 for permissions, so you need to get an access token to make requests.

    In the panel, you can create the client_id and it will give you the client_secret, both of which you need to keep.

    You need to follow the OAuth2 process to get an access token. A basic example that we have is in https://speca.io/PufferPanel/pufferd

    Alternatively, I wrote some old PHP code that was designed to show the concept: https://gist.github.com/LordRalex/2e90fc4d8f7544de4d42f9fc63ef8003



  • @LordRalex
    It works! Thank you :)


 

3
Online

851
Users

860
Topics

3.6k
Posts