diff --git a/.gitignore b/.gitignore index f3d7e52..304d2a8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,73 +1,75 @@ #ignore pling-music and pling-books */pling-books-html5/* */pling-music-html5/* #ignore store specific images */images_sys/store_*/ #ignore eclipse files .buildpath .project .settings/* #ignore PHPStorm Files .idea/* #ignore local Vagrant dir .vagrant/* #ignore local tmp dir */.tmb/* #ignore local dir local/* phing/* +public/config.php + *.local* --.htaccess* .htaccess* .htpasswd* *.orig *.tsm *.ova */.well-known loadstorm-41440.html mu-2cc5c638-f7c471ad-be42f5c0-99b8cf30.txt mu-9ff52416-7b5ae544-c8bac39d-dc810a54 #ignore thumbnails created by windows Thumbs.db #Ignore files build by Visual Studio *.obj *.exe *.pdb *.user *.aps *.pch *.vspscc *_i.c *_p.c *.ncb *.suo *.tlb *.tlh *.bak *.cache *.ilk *.log [Bb]in [Dd]ebug*/ *.lib *.sbr obj/ [Rr]elease*/ _ReSharper*/ [Tt]est[Rr]esult* httpdocs/src/status.jsx .idea/ /nbproject/private/ \ No newline at end of file diff --git a/public/delete.php b/public/delete.php index e62092f..a67623f 100644 --- a/public/delete.php +++ b/public/delete.php @@ -1,95 +1,84 @@ . **/ //Constants //$CN_APTH = "/mnt/volume-fra1-11/var/www/cdn/pling-cdn"; $CN_APTH = "."; $imgurl = urldecode($_GET['path']); -echo "

Deleting file: ".$imgurl.'

\n'; +echo "

Deleting file: ".$imgurl.'

' . PHP_EOL; $delete_post_name = $_GET['post']; $imagename = basename($imgurl); if (!$imgurl || !$imagename) { - echo "Error, param: path missing\n"; + header("HTTP/1.0 500 Server Error"); + echo "Error, param: path missing" . PHP_EOL; return; } if (!$delete_post_name) { - echo "Error, param: post missing\n"; + header("HTTP/1.0 500 Server Error"); + echo "Error, param: post missing" . PHP_EOL; return; } $fileExists = file_exists($CN_APTH.'/img/' . $imgurl); if($fileExists) { - echo("

File exists".'\n'); - echo ''; + echo("

File exists" . PHP_EOL); + echo '' . PHP_EOL; } else { - echo("

File did not exists".'\n'); + echo("

File did not exists" . PHP_EOL); } -echo("

Rename file...".'\n'); -echo('

Command: cp '.$CN_APTH.'/img/' . $imgurl . ' ' . $CN_APTH.'/img/' . $imgurl . $delete_post_name.'\n'); +echo("

Rename file..." . PHP_EOL); +echo('

Command: cp '.$CN_APTH.'/img/' . $imgurl . ' ' . $CN_APTH.'/img/' . $imgurl . $delete_post_name . PHP_EOL); //TODO //$last_line = system('mv '.$imgurl . ' ' . $imgurl . $delete_post_name, $retval); $last_line = system('cp '.$CN_APTH.'/img/' . $imgurl . ' ' . $CN_APTH.'/img/' . $imgurl . $delete_post_name.' 2>&1'); -echo $last_line.'\n'; +echo $last_line . PHP_EOL; $fileExists = file_exists($CN_APTH.'/img/' . $imgurl . $delete_post_name); if($fileExists) { - echo("

File exists".'\n'); - echo ''; + echo("

File exists" . PHP_EOL); + echo '' . PHP_EOL; } else { - echo("

File did not exists".'\n'); + echo("

File did not exists" . PHP_EOL); } //TODO -echo("

Search for cached files: \n"); -echo('

Command: locate -i "' . $imgurl.'"\n'); +echo("

Search for cached files:" . PHP_EOL); +echo('

Command: locate -i "' . $imgurl.'"' . PHP_EOL); $last_line = exec('locate -i "' . $imgurl.'" 2>&1', $resultArray, $result); //var_dump($resultArray); foreach ($resultArray as $value) { if(strpos($value, '/cache/') !== false) { - echo "

Command: rm $value\n"; + echo "

Command: rm $value" . PHP_EOL; } -} - - -/* -$image = getimg($imgurl); -file_put_contents('img/' . $imagename, $image); - -if (file_exists('./img/' . $imagename)) { - print ""; -} else { - print "Error"; -} - -*/ \ No newline at end of file +} \ No newline at end of file diff --git a/public/setup.php b/public/setup.php new file mode 100644 index 0000000..29d6149 --- /dev/null +++ b/public/setup.php @@ -0,0 +1,52 @@ + + +OSC CDN Setup + + + + +

Private Key

+ + config.php does not exist, or does not define a private key
+ + Copy and paste the below text into a config.php file. Once you have created + the config file, you will also need to copy and paste the private key into + your OSC Webserver configuration file.

+ + + +


+ OCS Webserver application.ini config value +
+ images.media.privateKey = "" + + +

Information

+ + Everything is up and running! For the private key please refer to the config.php file. + + +