diff --git a/.gitignore b/.gitignore index e19effa7694175b6d34c9bb29e201533fd94426e..3dae370c8639d702779ef4df556a4a0cc5503ec5 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,8 @@ public/js/ .sass-cache/ #node cache -node_modules/ \ No newline at end of file +node_modules/ + +#composer +public/API/vendor +public/API/composer.lock \ No newline at end of file diff --git a/public/API/composer.json b/public/API/composer.json new file mode 100644 index 0000000000000000000000000000000000000000..77abbce4edac16b908bf7147da901dd36b34abaf --- /dev/null +++ b/public/API/composer.json @@ -0,0 +1,6 @@ +{ + "require": { + "aws/aws-sdk-php": "^3.181", + "symforge/chilkat-php": "9.5.0.66" + } +} diff --git a/public/API/getFile.php b/public/API/getFile.php new file mode 100644 index 0000000000000000000000000000000000000000..f928d07fd61b461f47a06628e2ab4f6121d02d7e --- /dev/null +++ b/public/API/getFile.php @@ -0,0 +1,26 @@ +<?php +include("./lib/config.php"); +require 'vendor/autoload.php'; + +$s3Client = new Aws\S3\S3Client([ + 'version' => 'latest', + 'region' => 'us-east-1', + 'endpoint' => $S3Server, + 'use_path_style_endpoint' => true, + 'credentials' => [ + 'key' => $S3AccessKey, + 'secret' => $S3SecretKey, + ], +]); + +// Get a command object from the client +$command = $s3Client->getCommand('GetObject', [ + 'Bucket' => $S3BucketName, + 'Key' => $_GET["filename"] +]); + +// Create a pre-signed URL for a request with duration of 10 miniutes +$presignedRequest = $s3Client->createPresignedRequest($command, '1000 minutes'); + +// Get the actual presigned-url +echo (string) $presignedRequest->getUri(); \ No newline at end of file diff --git a/public/API/lib/config.example.php b/public/API/lib/config.example.php index 122ba44bf0f86c332990f774b7e04b4bd51c47ae..c9ff18703beb6322b357acb6dc1f8bfcb9036bbb 100644 --- a/public/API/lib/config.example.php +++ b/public/API/lib/config.example.php @@ -14,3 +14,8 @@ $footerMaxPost = 5; $homeMaxPost = 3; $trackURL = ""; + +$S3Server = ""; +$S3AccessKey = ""; +$S3SecretKey = ""; +$S3BucketName = ""; \ No newline at end of file diff --git a/public/files/Insecam_v2.zip b/public/files/Insecam_v2.zip deleted file mode 100644 index 3f8fea79f35a9ae6c25b8a9592b27a9aeb6aec9a..0000000000000000000000000000000000000000 Binary files a/public/files/Insecam_v2.zip and /dev/null differ diff --git a/public/files/MQTT_Message.zip b/public/files/MQTT_Message.zip deleted file mode 100644 index 1c578c33651211fd87e8040b00b0f1cc2fc8115c..0000000000000000000000000000000000000000 Binary files a/public/files/MQTT_Message.zip and /dev/null differ diff --git a/public/files/SmartMirror.zip b/public/files/SmartMirror.zip deleted file mode 100644 index a5e9d4842c4ccdcc540ee0925eea2580ac5fb187..0000000000000000000000000000000000000000 Binary files a/public/files/SmartMirror.zip and /dev/null differ diff --git a/public/files/blitzortung.zip b/public/files/blitzortung.zip deleted file mode 100644 index c3909c9c339c7887319e1683b5743c0122097714..0000000000000000000000000000000000000000 Binary files a/public/files/blitzortung.zip and /dev/null differ diff --git a/public/files/blitzortung_v2.zip b/public/files/blitzortung_v2.zip deleted file mode 100644 index 77ce54067daf3d089ae58cb539af179ee68230e8..0000000000000000000000000000000000000000 Binary files a/public/files/blitzortung_v2.zip and /dev/null differ diff --git a/public/files/insecam.zip b/public/files/insecam.zip deleted file mode 100644 index 6057e566d2f7312eee46ab738348275830b6f9de..0000000000000000000000000000000000000000 Binary files a/public/files/insecam.zip and /dev/null differ diff --git a/public/files/shorter.zip b/public/files/shorter.zip deleted file mode 100644 index 0d267a080ef7992faf8ce779c7a1a566a118e278..0000000000000000000000000000000000000000 Binary files a/public/files/shorter.zip and /dev/null differ