diff --git a/.env.example b/.env.example index fabecd2d2d9bab5d4b7c4e9e8f516c9fd023cd12..270ca14c48aa77ff8d845fe85018d2d4494f42d5 100644 --- a/.env.example +++ b/.env.example @@ -21,7 +21,6 @@ DISCORD_INVITE_URL=https://discord.gg/vrUYdxG4wZ #set-up for extra discord verification DISCORD_CLIENT_ID= DISCORD_CLIENT_SECRET= -DISCORD_REDIRECT_URI=http://YOUR_DOMAIN.COM/auth/callback #set-up will join users automaticly to your discord DISCORD_BOT_TOKEN=YOUR_DISCORD_BOT_TOKEN DISCORD_GUILD_ID=YOUR_DISCORD_SERVER_ID diff --git a/BUILDING.md b/BUILDING.md index f506c258a9d196e18595198a0831573680b9f467..1581bd17a799a4ecc90a8d4bd58f9615c46026dc 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -9,7 +9,7 @@ Type `docker exec -it controlpanel_php ash` to go into the container and run the ```shell composer install -cp .env.dev .env +cp .env.example .env php artisan key:generate --force php artisan storage:link php artisan migrate --seed --force @@ -17,15 +17,15 @@ php artisan migrate --seed --force ## Setting up testing environment -Change the .env.testing file to your needs. Then once done you need to go into your phpmyadmin to create a new database named __controlpanel_test__. +Create the .env.testing file to your needs. Then once done you need to go into your phpmyadmin to create a new database named __controlpanel_test__. Visit http://127.0.0.1:8080/ and create your database. Now you're ready to run the following commands which switches to the testing config, migrates the test database and seeds it. After that you can switch back to your dev environment again. Clear the config from cache so changes will be instantly available. ```shell +php artisan key:generate --force --env=testing php artisan migrate:fresh --seed --env=testing -php artisan config:clear ``` Now when running tests with PHPUnit it will use your testing database and not your local development one. diff --git a/config/services.php b/config/services.php index 5fc8f741d134621702aec5571f7c0f3b810e0f29..5cfe58405e90e3b5139f2a3b544d865b93b92fce 100644 --- a/config/services.php +++ b/config/services.php @@ -33,7 +33,7 @@ return [ 'discord' => [ 'client_id' => env('DISCORD_CLIENT_ID'), 'client_secret' => env('DISCORD_CLIENT_SECRET'), - 'redirect' => env('DISCORD_REDIRECT_URI'), + 'redirect' => env('APP_URL' , 'http://localhost') . "/auth/callback", // optional 'allow_gif_avatars' => (bool)env('DISCORD_AVATAR_GIF', true),