Jump to content

murilo

Members
  • Posts

    28
  • Joined

  • Last visited

Posts posted by murilo

  1. On 8/21/2022 at 12:48 AM, Krydos said:

    You just have to reissue it and check the right boxes:

    image.png.2bb0e6ef37970b866902b7cb88673f39.png

    Wildcard certificates aren't currently supported. I went ahead and reissued the certificate for you to see if there were any errors maybe, but it worked just fine on the first try.

    Oh, I didn't see I could reissue certificates by myself. Thanks, Krydos. Anyways, why it doesn't renew the certificates having these options enabled by default? 

  2. Hey,

    When I had my main domain switched to murilo.eu.org, Plesk generated a certificate for murilo.eu.org, which had www.murilo.eu.org and webmail.murilo.eu.org in scope, and other certificates for each subdomain I have.

    Recently, my certificates were renewed and that one no longer has webmail.murilo.eu.org in scope, and no different certificate was issued for it.

    Although the control panel has a message saying "Webmail not secured", I'm not seeing any options to generate a certificate like how the old one was, a wildcard certificate for my domain or a certificate only for webmail.

    Please help!

  3. 9 minutes ago, Krydos said:

    First of all the working link has "nnidlt" and the invalid link has "niidlt" so that's why it's giving a 404 error.

     

    Oh, sorry, my bad. I typed the link manually.

    9 minutes ago, Krydos said:

    I commented that out and now it gives the expected JSON response. https://murilo.heliohost.us/nnidlt/api.php?env=production&user_id= It seems like Plesk is trying to give some custom error page for 400 errors for some reason. Not sure why. Does that script need to return a 400 error or is 200 response with the correct json error enough?

    Hmm... weird. Yes, it's meant to give 400 since the JavaScript that pulls from that API looks for a response code different from 200 to display the error mesage. I can try using another response code I guess.

  4. My PHP script is programmed to return a json-ecoded error when certain $_GET parameters are empty, but instead it is returning Apache's default 403 Forbidden screen + Plesk's 500 Internal Server Error screen

    Right after, the following stuff appear in the server logs:

    ModSecurity: Access denied with code 403 (phase 3). Match of "validateByteRange 0-31" against "ARGS:env" required. [file "/etc/httpd/conf/modsecurity.d/rules/comodo_free/30_Apps_OtherApps.conf"] [line "6649"] [id "243420"] [rev "4"] [msg "COMODO WAF: Information disclosure vulnerability in Eclipse Jetty before 9.2.9.v20150224 (CVE-2015-2080)||murilo.heliohost.us|F|2"] [severity "CRITICAL"] [tag "CWAF"] [tag "OtherApps"] [hostname "murilo.heliohost.us"] [uri "/nnidlt/api.php"] [unique_id "YqzLmsxfvqHEorQQS6SJXgAAARI"]

    (20014)Internal error: mod_fcgid: ap_pass_brigade failed in handle_request_ipc function

    Please help!

  5. Oh, I figured out why the donation is linked to that account. A friend of mine made the donation using their PayPal account in my behalf. They ended up creating an HelioHost account for them with the same email address from the PayPal account, and ended up having the donation linked to it, but it is meant to be linked to me.

  6. My software is a social network. That code uploads an user image to Cloudinary for being attached to their post. I tried running the script without the unlink line and it didn't create any files in my /tmp folder. Something is wrong. The code doesn't make any references to any other places that it could save temporary files. I'm confused now.

  7. I implemented that line in my script and apparently it worked. It looks like this now:

    function uploadImage($file, $width = null, $height = null) {
        if($width !== null && $height !== null && extension_loaded('imagick')) {
            $imagick = new Imagick();
            $imagick->setRegistry('temporary-path', '/home/murilo/tmp');
            $imagick->readImageBlob($file);
            if($imagick->getImageFormat() === 'GIF') {
                $imagick = $imagick->coalesceImages();
                $imagick->cropThumbnailImage($width, $height);
                while($imagick->nextImage()) {
                    $imagick->cropThumbnailImage($width, $height);
                }
                $imagick = $imagick->deconstructImages();
            } else {
                $imagick->cropThumbnailImage($width, $height);
            }
            $file = $imagick->getImagesBlob();
        }
        if(empty(CLOUDINARY_CLOUDNAME) || empty(CLOUDINARY_UPLOADPRESET)) {
            return null;
        }
        $mime = finfo_buffer(finfo_open(), $file, FILEINFO_MIME_TYPE);
        $ch = curl_init('https://api.cloudinary.com/v1_1/' . urlencode(CLOUDINARY_CLOUDNAME) . '/image/upload');
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(['upload_preset' => CLOUDINARY_UPLOADPRESET, 'file' => 'data:' . $mime . ';base64,' . base64_encode($file)]));
        $response = curl_exec($ch);
        $responseJSON = json_decode($response);
        $responseCode = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
        if($responseCode > 299 || $responseCode < 200) {
            return null;
        }
        curl_close($ch);
        return $responseJSON->secure_url;
        unlink ($file, file, $imagick, 'temporary-path');
    }
  8. function uploadImage($file, $width = null, $height = null) {
        if($width !== null && $height !== null && extension_loaded('imagick')) {
            $imagick = new Imagick();
            $imagick->readImageBlob($file);
            if($imagick->getImageFormat() === 'GIF') {
                $imagick = $imagick->coalesceImages();
                $imagick->cropThumbnailImage($width, $height);
                while($imagick->nextImage()) {
                    $imagick->cropThumbnailImage($width, $height);
                }
                $imagick = $imagick->deconstructImages();
            } else {
                $imagick->cropThumbnailImage($width, $height);
            }
            $file = $imagick->getImagesBlob();
        }
        if(empty(CLOUDINARY_CLOUDNAME) || empty(CLOUDINARY_UPLOADPRESET)) {
            return null;
        }
        $mime = finfo_buffer(finfo_open(), $file, FILEINFO_MIME_TYPE);
        $ch = curl_init('https://api.cloudinary.com/v1_1/' . urlencode(CLOUDINARY_CLOUDNAME) . '/image/upload');
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(['upload_preset' => CLOUDINARY_UPLOADPRESET, 'file' => 'data:' . $mime . ';base64,' . base64_encode($file)]));
        $response = curl_exec($ch);
        $responseJSON = json_decode($response);
        $responseCode = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
        if($responseCode > 299 || $responseCode < 200) {
            return null;
        }
        curl_close($ch);
        return $responseJSON->secure_url;
        unlink ($file);
    

    This is the code. I just added "unlink ($file);" in the end of it. Didn't give me an Internal Server Error, so I guess it's working.

×
×
  • Create New...