From 19998e8d998310521f845d9a01f68b36d221dd52 Mon Sep 17 00:00:00 2001 From: Phil-Reck Date: Fri, 9 Apr 2021 15:26:00 +0300 Subject: [PATCH 1/8] updated composer.lock --- composer.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/composer.lock b/composer.lock index 4f8c4345..386a0773 100644 --- a/composer.lock +++ b/composer.lock @@ -8,16 +8,16 @@ "packages": [ { "name": "aws/aws-sdk-php", - "version": "3.176.9", + "version": "3.178.0", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "17dc67514b148979994758fbfb54088a8a3393bf" + "reference": "214e3d98c54277cd8965f1cf307dce39631407bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/17dc67514b148979994758fbfb54088a8a3393bf", - "reference": "17dc67514b148979994758fbfb54088a8a3393bf", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/214e3d98c54277cd8965f1cf307dce39631407bf", + "reference": "214e3d98c54277cd8965f1cf307dce39631407bf", "shasum": "" }, "require": { @@ -92,9 +92,9 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.176.9" + "source": "https://github.com/aws/aws-sdk-php/tree/3.178.0" }, - "time": "2021-04-06T18:13:47+00:00" + "time": "2021-04-08T18:13:16+00:00" }, { "name": "clue/stream-filter", @@ -8194,16 +8194,16 @@ }, { "name": "facade/flare-client-php", - "version": "1.5.0", + "version": "1.6.1", "source": { "type": "git", "url": "https://github.com/facade/flare-client-php.git", - "reference": "9dd6f2b56486d939c4467b3f35475d44af57cf17" + "reference": "f2b0969f2d9594704be74dbeb25b201570a98098" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/facade/flare-client-php/zipball/9dd6f2b56486d939c4467b3f35475d44af57cf17", - "reference": "9dd6f2b56486d939c4467b3f35475d44af57cf17", + "url": "https://api.github.com/repos/facade/flare-client-php/zipball/f2b0969f2d9594704be74dbeb25b201570a98098", + "reference": "f2b0969f2d9594704be74dbeb25b201570a98098", "shasum": "" }, "require": { @@ -8247,7 +8247,7 @@ ], "support": { "issues": "https://github.com/facade/flare-client-php/issues", - "source": "https://github.com/facade/flare-client-php/tree/1.5.0" + "source": "https://github.com/facade/flare-client-php/tree/1.6.1" }, "funding": [ { @@ -8255,7 +8255,7 @@ "type": "github" } ], - "time": "2021-03-31T07:32:54+00:00" + "time": "2021-04-08T08:50:01+00:00" }, { "name": "facade/ignition", From 131ec373cac5e8bdb6e5def901163c8db6cfd63a Mon Sep 17 00:00:00 2001 From: Phil-Reck Date: Sun, 11 Apr 2021 00:53:05 +0300 Subject: [PATCH 2/8] Procfile for Heroku --- Procfile | 1 + composer.lock | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 12 deletions(-) create mode 100644 Procfile diff --git a/Procfile b/Procfile new file mode 100644 index 00000000..48aab522 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: vendor/bin/heroku-php-apache2 public/ diff --git a/composer.lock b/composer.lock index 386a0773..48730cec 100644 --- a/composer.lock +++ b/composer.lock @@ -8,16 +8,16 @@ "packages": [ { "name": "aws/aws-sdk-php", - "version": "3.178.0", + "version": "3.178.1", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "214e3d98c54277cd8965f1cf307dce39631407bf" + "reference": "45692b97e12a2eed540c0afd106f143aad15e622" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/214e3d98c54277cd8965f1cf307dce39631407bf", - "reference": "214e3d98c54277cd8965f1cf307dce39631407bf", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/45692b97e12a2eed540c0afd106f143aad15e622", + "reference": "45692b97e12a2eed540c0afd106f143aad15e622", "shasum": "" }, "require": { @@ -92,9 +92,9 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.178.0" + "source": "https://github.com/aws/aws-sdk-php/tree/3.178.1" }, - "time": "2021-04-08T18:13:16+00:00" + "time": "2021-04-09T18:13:02+00:00" }, { "name": "clue/stream-filter", @@ -3571,16 +3571,16 @@ }, { "name": "opis/closure", - "version": "3.6.1", + "version": "3.6.2", "source": { "type": "git", "url": "https://github.com/opis/closure.git", - "reference": "943b5d70cc5ae7483f6aff6ff43d7e34592ca0f5" + "reference": "06e2ebd25f2869e54a306dda991f7db58066f7f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opis/closure/zipball/943b5d70cc5ae7483f6aff6ff43d7e34592ca0f5", - "reference": "943b5d70cc5ae7483f6aff6ff43d7e34592ca0f5", + "url": "https://api.github.com/repos/opis/closure/zipball/06e2ebd25f2869e54a306dda991f7db58066f7f6", + "reference": "06e2ebd25f2869e54a306dda991f7db58066f7f6", "shasum": "" }, "require": { @@ -3630,9 +3630,9 @@ ], "support": { "issues": "https://github.com/opis/closure/issues", - "source": "https://github.com/opis/closure/tree/3.6.1" + "source": "https://github.com/opis/closure/tree/3.6.2" }, - "time": "2020-11-07T02:01:34+00:00" + "time": "2021-04-09T13:42:10+00:00" }, { "name": "paragonie/random_compat", From 134c6588191aed0c2baf01dd27c7998ea4f369c3 Mon Sep 17 00:00:00 2001 From: Phil-Reck Date: Sun, 11 Apr 2021 11:26:16 +0300 Subject: [PATCH 3/8] use aws/aws-sdk-php --- .gitignore | 1 + composer.json | 1 + composer.lock | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 22831b60..86ef684f 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,4 @@ yarn-error.log # Do not include backup lang files resources/lang/*/[a-zA-Z]*20[0-9][0-9][0-1][0-9][0-3][0-9]_[0-2][0-9][0-5][0-9][0-5][0-9].php +vendor diff --git a/composer.json b/composer.json index 35f060a4..d10c1b0d 100644 --- a/composer.json +++ b/composer.json @@ -14,6 +14,7 @@ "require": { "php": "^7.3", "ext-json": "*", + "aws/aws-sdk-php": "~3.0", "doctrine/dbal": "^2.9", "dompdf/dompdf": "^0.8", "fideloper/proxy": "^4.2", diff --git a/composer.lock b/composer.lock index 48730cec..32dcdd5f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "4d5f79842d547268744f0bc27525720a", + "content-hash": "7864970bb0529e266868731f58bf1b7a", "packages": [ { "name": "aws/aws-sdk-php", From 783c81414f65a5bb5abe98f84371669b0a5a4d0e Mon Sep 17 00:00:00 2001 From: Phil-Reck Date: Sun, 11 Apr 2021 12:09:27 +0300 Subject: [PATCH 4/8] use aws/aws-sdk-php --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 86ef684f..5d5f67ac 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ yarn-error.log # Do not include backup lang files resources/lang/*/[a-zA-Z]*20[0-9][0-9][0-1][0-9][0-3][0-9]_[0-2][0-9][0-5][0-9][0-5][0-9].php vendor +vendor From 9fd33c0de1a87e1bb7f567bd49911005b0be3691 Mon Sep 17 00:00:00 2001 From: Phil-Reck Date: Sun, 11 Apr 2021 12:14:37 +0300 Subject: [PATCH 5/8] modified index.php configurations for aws --- public/index.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/public/index.php b/public/index.php index 4584cbcd..23c466a4 100644 --- a/public/index.php +++ b/public/index.php @@ -58,3 +58,33 @@ $response->send(); $kernel->terminate($request, $response); + + +// this will simply read AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY from env vars +$s3 = new Aws\S3\S3Client([ + 'version' => '2006-03-01', + 'region' => 'us-east-1', +]); +$bucket = getenv('S3_BUCKET')?: die('No "S3_BUCKET" config var in found in env!'); +?> + + + +

S3 upload example

+upload($bucket, $_FILES['userfile']['name'], fopen($_FILES['userfile']['tmp_name'], 'rb'), 'public-read'); +?> +

Upload successful :)

+ +

Upload error :(

+ +

Upload a file

+
+ +
+ + From 18e3766c0992935464f9a6a006846c448ae60d44 Mon Sep 17 00:00:00 2001 From: Phil-Reck Date: Sun, 11 Apr 2021 14:49:52 +0300 Subject: [PATCH 6/8] csrf tokens --- app/Http/Middleware/VerifyCsrfToken.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Middleware/VerifyCsrfToken.php b/app/Http/Middleware/VerifyCsrfToken.php index 25bafabc..5f820f95 100644 --- a/app/Http/Middleware/VerifyCsrfToken.php +++ b/app/Http/Middleware/VerifyCsrfToken.php @@ -11,7 +11,7 @@ class VerifyCsrfToken extends Middleware * * @var bool */ - protected $addHttpCookie = true; + protected $addHttpCookie = false; /** * The URIs that should be excluded from CSRF verification. From 96d8ccfb48f424f35d9d9ac06ce8e90a33b603e8 Mon Sep 17 00:00:00 2001 From: Phildev <33871682+ReckerPhildev@users.noreply.github.com> Date: Mon, 12 Apr 2021 21:13:20 +0300 Subject: [PATCH 7/8] Create .env Commited .env file --- .env | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .env diff --git a/.env b/.env new file mode 100644 index 00000000..3bab1255 --- /dev/null +++ b/.env @@ -0,0 +1,55 @@ +ATTENDIZE_DEV=true +ATTENDIZE_CLOUD=false + +APP_NAME=Attendize +APP_ENV=production +APP_KEY=base64:Ht809P3Qfjwg0HB5MpXUC9jg9Q2toldFzyNkYH4mZ2s= +APP_DEBUG=false +APP_URL=https://localhost + +LOG_CHANNEL=stack + +DB_CONNECTION=pgsql +DB_HOST=127.0.0.1 +DB_PORT=5432 +DB_DATABASE=attendize +DB_USERNAME=attendizeuser +DB_PASSWORD=go@attendize@@007. + +BROADCAST_DRIVER=log +CACHE_DRIVER=file +QUEUE_CONNECTION=sync +SESSION_DRIVER=file +SESSION_LIFETIME=120 + +REDIS_HOST=127.0.0.1 +REDIS_PASSWORD=null +REDIS_PORT=6379 + +MAIL_DRIVER=smtp +MAIL_HOST=maildev +MAIL_PORT=25 +MAIL_USERNAME= +MAIL_PASSWORD= +MAIL_ENCRYPTION= + +AWS_ACCESS_KEY_ID= +AWS_SECRET_ACCESS_KEY= +AWS_DEFAULT_REGION=us-east-1 +AWS_BUCKET= + +PUSHER_APP_ID= +PUSHER_APP_KEY= +PUSHER_APP_SECRET= +PUSHER_APP_CLUSTER=mt1 + +MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" +MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" + +# Attendize Variables +DEFAULT_DATEPICKER_SEPERATOR="-" +DEFAULT_DATEPICKER_FORMAT="yyyy-MM-dd HH:mm" +DEFAULT_DATETIME_FORMAT="Y-m-d H:i" +APP_TIMEZONE= + +MAIL_FROM_ADDRESS=testing@attendize.co From 29d77af666277833e16b0c10364a65f7a3902920 Mon Sep 17 00:00:00 2001 From: Phildev <33871682+ReckerPhildev@users.noreply.github.com> Date: Mon, 12 Apr 2021 21:44:16 +0300 Subject: [PATCH 8/8] Delete .env --- .env | 55 ------------------------------------------------------- 1 file changed, 55 deletions(-) delete mode 100644 .env diff --git a/.env b/.env deleted file mode 100644 index 3bab1255..00000000 --- a/.env +++ /dev/null @@ -1,55 +0,0 @@ -ATTENDIZE_DEV=true -ATTENDIZE_CLOUD=false - -APP_NAME=Attendize -APP_ENV=production -APP_KEY=base64:Ht809P3Qfjwg0HB5MpXUC9jg9Q2toldFzyNkYH4mZ2s= -APP_DEBUG=false -APP_URL=https://localhost - -LOG_CHANNEL=stack - -DB_CONNECTION=pgsql -DB_HOST=127.0.0.1 -DB_PORT=5432 -DB_DATABASE=attendize -DB_USERNAME=attendizeuser -DB_PASSWORD=go@attendize@@007. - -BROADCAST_DRIVER=log -CACHE_DRIVER=file -QUEUE_CONNECTION=sync -SESSION_DRIVER=file -SESSION_LIFETIME=120 - -REDIS_HOST=127.0.0.1 -REDIS_PASSWORD=null -REDIS_PORT=6379 - -MAIL_DRIVER=smtp -MAIL_HOST=maildev -MAIL_PORT=25 -MAIL_USERNAME= -MAIL_PASSWORD= -MAIL_ENCRYPTION= - -AWS_ACCESS_KEY_ID= -AWS_SECRET_ACCESS_KEY= -AWS_DEFAULT_REGION=us-east-1 -AWS_BUCKET= - -PUSHER_APP_ID= -PUSHER_APP_KEY= -PUSHER_APP_SECRET= -PUSHER_APP_CLUSTER=mt1 - -MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" -MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" - -# Attendize Variables -DEFAULT_DATEPICKER_SEPERATOR="-" -DEFAULT_DATEPICKER_FORMAT="yyyy-MM-dd HH:mm" -DEFAULT_DATETIME_FORMAT="Y-m-d H:i" -APP_TIMEZONE= - -MAIL_FROM_ADDRESS=testing@attendize.co