diff --git a/.env.dev b/.env.dev index 3362e1fd6ed..d6e65c42fd2 100644 --- a/.env.dev +++ b/.env.dev @@ -55,7 +55,7 @@ REQUIRES_SUBSCRIPTION=false CACHE_DRIVER=file SESSION_DRIVER=file SESSION_LIFETIME=120 -QUEUE_DRIVER=sync +QUEUE_CONNECTION=sync BROADCAST_DRIVER=log # Default filesystem to store uploaded files. diff --git a/.env.example b/.env.example index a837556c9db..6d1e0124851 100644 --- a/.env.example +++ b/.env.example @@ -94,7 +94,7 @@ CHECK_VERSION=true CACHE_DRIVER=database SESSION_DRIVER=file SESSION_LIFETIME=120 -QUEUE_DRIVER=sync +QUEUE_CONNECTION=sync # Maximum allowed size for uploaded files, in kilobytes. # Make sure this is an integer, without commas or spaces. diff --git a/config/app.php b/config/app.php index 24c44e7bf65..deec766de3b 100644 --- a/config/app.php +++ b/config/app.php @@ -65,6 +65,8 @@ 'url' => env('APP_URL', 'http://localhost'), + 'asset_url' => env('ASSET_URL', null), + /* |-------------------------------------------------------------------------- | TIMEZONE diff --git a/config/cache.php b/config/cache.php index e5712ae1668..67f98f9fd46 100644 --- a/config/cache.php +++ b/config/cache.php @@ -13,7 +13,8 @@ | using this caching library. This connection is used when another is | not explicitly specified when executing a given caching function. | - | Supported: "apc", "array", "database", "file", "memcached", "redis" + | Supported: "apc", "array", "database", "file", + | "memcached", "redis", "dynamodb" | */ @@ -72,7 +73,16 @@ 'redis' => [ 'driver' => 'redis', - 'connection' => 'default', + 'connection' => 'cache', + ], + + 'dynamodb' => [ + 'driver' => 'dynamodb', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), + 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), + 'endpoint' => env('DYNAMODB_ENDPOINT'), ], ], diff --git a/config/hashing.php b/config/hashing.php index f3332edea3f..d3c8e2fb22a 100644 --- a/config/hashing.php +++ b/config/hashing.php @@ -29,7 +29,7 @@ */ 'bcrypt' => [ - 'rounds' => 10, + 'rounds' => env('BCRYPT_ROUNDS', 10), ], /* diff --git a/config/laravel-owm.php b/config/laravel-owm.php deleted file mode 100644 index b4f0c252da9..00000000000 --- a/config/laravel-owm.php +++ /dev/null @@ -1,6 +0,0 @@ - 'f98884d6b422d3ac568dd6703ec9f469', - 'routes_enabled' => false, // If the routes have to be enabled. - ]; diff --git a/config/queue.php b/config/queue.php index 2513c5aa256..22315869336 100644 --- a/config/queue.php +++ b/config/queue.php @@ -4,18 +4,16 @@ /* |-------------------------------------------------------------------------- - | Default Queue Driver + | Default Queue Connection Name |-------------------------------------------------------------------------- | - | The Laravel queue API supports a variety of back-ends via an unified + | Laravel's queue API supports an assortment of back-ends via a single | API, giving you convenient access to each back-end using the same - | syntax for each one. Here you may set the default queue driver. - | - | Supported: "null", "sync", "database", "beanstalkd", "sqs", "redis" + | syntax for every one. Here you may define a default connection. | */ - 'default' => env('QUEUE_DRIVER', 'sync'), + 'default' => env('QUEUE_CONNECTION', env('QUEUE_DRIVER', 'sync')), /* |-------------------------------------------------------------------------- @@ -26,6 +24,8 @@ | is used by your application. A default configuration has been added | for each back-end shipped with Laravel. You are free to add more. | + | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" + | */ 'connections' => [ @@ -38,30 +38,32 @@ 'driver' => 'database', 'table' => 'jobs', 'queue' => 'default', - 'retry_after' => 60, + 'retry_after' => 90, ], 'beanstalkd' => [ 'driver' => 'beanstalkd', 'host' => 'localhost', 'queue' => 'default', - 'ttr' => 60, + 'retry_after' => 90, + 'block_for' => 0, ], 'sqs' => [ 'driver' => 'sqs', - 'key' => 'your-public-key', - 'secret' => 'your-secret-key', - 'prefix' => 'https://sqs.us-east-1.amazonaws.com/your-account-id', - 'queue' => 'your-queue-name', - 'region' => 'us-east-1', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), + 'queue' => env('SQS_QUEUE', 'your-queue-name'), + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), ], 'redis' => [ 'driver' => 'redis', 'connection' => 'default', - 'queue' => 'default', - 'retry_after' => 60, + 'queue' => env('REDIS_QUEUE', 'default'), + 'retry_after' => 90, + 'block_for' => null, ], ], diff --git a/config/services.php b/config/services.php index e10be744261..589e6cc74dd 100644 --- a/config/services.php +++ b/config/services.php @@ -20,10 +20,14 @@ 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), ], + 'postmark' => [ + 'token' => env('POSTMARK_TOKEN'), + ], + 'ses' => [ - 'key' => env('SES_KEY'), - 'secret' => env('SES_SECRET'), - 'region' => 'us-east-1', + 'key' => env('AWS_ACCESS_KEY_ID', env('SES_KEY')), + 'secret' => env('AWS_SECRET_ACCESS_KEY', env('SES_SECRET')), + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), ], 'stripe' => [ diff --git a/config/session.php b/config/session.php index 0a2577af5b2..f1e5f278e1e 100644 --- a/config/session.php +++ b/config/session.php @@ -122,7 +122,7 @@ | */ - 'cookie' => 'laravel_session', + 'cookie' => env('SESSION_COOKIE', 'laravel_session'), /* |-------------------------------------------------------------------------- @@ -148,7 +148,7 @@ | */ - 'domain' => null, + 'domain' => env('SESSION_DOMAIN', null), /* |-------------------------------------------------------------------------- @@ -161,7 +161,7 @@ | */ - 'secure' => false, + 'secure' => env('SESSION_SECURE_COOKIE', false), /* |-------------------------------------------------------------------------- @@ -176,4 +176,19 @@ 'http_only' => true, + /* + |-------------------------------------------------------------------------- + | Same-Site Cookies + |-------------------------------------------------------------------------- + | + | This option determines how your cookies behave when cross-site requests + | take place, and can be used to mitigate CSRF attacks. By default, we + | do not enable this as other CSRF protection services are in place. + | + | Supported: "lax", "strict" + | + */ + + 'same_site' => null, + ]; diff --git a/config/view.php b/config/view.php index e193ab61d91..22b8a18d325 100644 --- a/config/view.php +++ b/config/view.php @@ -14,7 +14,7 @@ */ 'paths' => [ - realpath(base_path('resources/views')), + resource_path('views'), ], /* @@ -28,6 +28,9 @@ | */ - 'compiled' => realpath(storage_path('framework/views')), + 'compiled' => env( + 'VIEW_COMPILED_PATH', + realpath(storage_path('framework/views')) + ), ]; diff --git a/docs/installation/generic.md b/docs/installation/generic.md index b5491ce09d4..c994b2a0a6e 100644 --- a/docs/installation/generic.md +++ b/docs/installation/generic.md @@ -174,7 +174,7 @@ Monica can work with a queue mechanism to handle different events, so we don't b We recommend that you do not use a queue mechanism as it complexifies the overall system and can make debugging harder when things go wrong. -This is why we suggest to use `QUEUE_DRIVER=sync` in your .env file. This will bypass the queues entirely and will process requests as they come. In practice, unless you have thousands of users, you don't need to use an asynchronous queue. +This is why we suggest to use `QUEUE_CONNECTION=sync` in your .env file. This will bypass the queues entirely and will process requests as they come. In practice, unless you have thousands of users, you don't need to use an asynchronous queue. That being said, if you still want to make your life more complicated, here is what you can do. @@ -184,7 +184,7 @@ There are several choices for the queue mechanism: * Beanstalk * Amazon SQS -The simplest queue is the database driver. To set it up, simply change in your `.env` file the following `QUEUE_DRIVER=sync` by `QUEUE_DRIVER=database`. +The simplest queue is the database driver. To set it up, simply change in your `.env` file the following `QUEUE_CONNECTION=sync` by `QUEUE_CONNECTION=database`. To configure the other queues, refer to the [official Laravel documentation](https://laravel.com/docs/master/queues#driver-prerequisites) on the topic. diff --git a/docs/installation/heroku.md b/docs/installation/heroku.md index 2ee338e9821..211296700cb 100644 --- a/docs/installation/heroku.md +++ b/docs/installation/heroku.md @@ -27,7 +27,7 @@ After deployment, the configuration of your app should look like this: ![Picture Of Configuration](https://user-images.githubusercontent.com/25419741/45253146-9f904800-b362-11e8-916b-8980fc2a83d8.png) -Note that when you deploy with the "Deploy to Heroku" purple button, only 1 dyno ("web") is activated while the "queue" one is not. That is OK - the "queue" dyno is only helpful if you set `QUEUE_DRIVER=database` (default is 'sync'). +Note that when you deploy with the "Deploy to Heroku" purple button, only 1 dyno ("web") is activated while the "queue" one is not. That is OK - the "queue" dyno is only helpful if you set `QUEUE_CONNECTION=database` (default is 'sync'). ### Optional: Setup the access tokens to use the API diff --git a/phpunit.xml b/phpunit.xml index 60ff07144ed..0dcef3b224d 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -50,7 +50,7 @@ - + diff --git a/phpunitpostgres.xml b/phpunitpostgres.xml index 34c8471aa42..524a18f9925 100644 --- a/phpunitpostgres.xml +++ b/phpunitpostgres.xml @@ -45,7 +45,7 @@ - + diff --git a/scripts/ci/.env.jenkins.mysql b/scripts/ci/.env.jenkins.mysql index b5c679c6dfc..e76ac9525e5 100644 --- a/scripts/ci/.env.jenkins.mysql +++ b/scripts/ci/.env.jenkins.mysql @@ -10,6 +10,6 @@ DB_TEST_PASSWORD= CACHE_DRIVER=array SESSION_DRIVER=file -QUEUE_DRIVER=sync +QUEUE_CONNECTION=sync MFA_ENABLED=true diff --git a/scripts/ci/.env.mysql b/scripts/ci/.env.mysql index 7bae0f903d3..d5cb4ea7fc8 100644 --- a/scripts/ci/.env.mysql +++ b/scripts/ci/.env.mysql @@ -10,7 +10,7 @@ DB_TEST_PASSWORD= CACHE_DRIVER=array SESSION_DRIVER=file -QUEUE_DRIVER=sync +QUEUE_CONNECTION=sync LOG_CHANNEL=testing BROADCAST_DRIVER=log diff --git a/scripts/ci/.env.postgres b/scripts/ci/.env.postgres index b27c93e31bc..83b0e112fb0 100644 --- a/scripts/ci/.env.postgres +++ b/scripts/ci/.env.postgres @@ -10,7 +10,7 @@ DB_TEST_PASSWORD= CACHE_DRIVER=array SESSION_DRIVER=file -QUEUE_DRIVER=sync +QUEUE_CONNECTION=sync LOG_CHANNEL=testing MFA_ENABLED=true diff --git a/scripts/docker/.examples/nginx-proxy/docker-compose.yml b/scripts/docker/.examples/nginx-proxy/docker-compose.yml index e9b35528509..46c3a0b6b8c 100644 --- a/scripts/docker/.examples/nginx-proxy/docker-compose.yml +++ b/scripts/docker/.examples/nginx-proxy/docker-compose.yml @@ -14,7 +14,7 @@ # To use redis: #- REDIS_HOST=redis #- CACHE_DRIVER=redis -#- QUEUE_DRIVER=redis +#- QUEUE_CONNECTION=redis # version: "3.4" diff --git a/scripts/docker/.examples/readme.md b/scripts/docker/.examples/readme.md index 9eea7536a4a..17d2734cc14 100644 --- a/scripts/docker/.examples/readme.md +++ b/scripts/docker/.examples/readme.md @@ -35,7 +35,7 @@ The [`supervisor`](supervisor) examples shows you how to run monica with - a db container (mysql:5.7) - an app container, which run `supervisord` to handle a web server/fpm, a cron, and a queue. -This let you use `QUEUE_DRIVER=database` in your `.env` file. +This let you use `QUEUE_CONNECTION=database` in your `.env` file. ### With nginx proxy and a self-signed certificate @@ -62,4 +62,4 @@ You may want to set `APP_ENV=production` to force the use of `https` mode. This example add a `redis` container, that can be used too, adding these variables to your `.env` file: - `REDIS_HOST=redis`: mandatory - `CACHE_DRIVER=redis`: to use redis as a cache table -- `QUEUE_DRIVER=redis`: to use redis as a queue table +- `QUEUE_CONNECTION=redis`: to use redis as a queue table