Skip to content

Commit 82448f2

Browse files
committed
Refactor configuration to environment keys
1 parent 8f118a0 commit 82448f2

File tree

34 files changed

+635
-601
lines changed

34 files changed

+635
-601
lines changed

README.md

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@
77

88
This is the Laravel.IO community portal site. The site is entirely open source and community involvement is not only encouraged, but required in order to ensure the future success of the project.
99

10-
1110
## Requirements
1211

1312
We use Laravel Homestead for local development. Please review [the Homestead documentation](http://laravel.com/docs/homestead) to install it.
1413

1514
In order to compile stylesheets you will also need Ruby, Sass, and Compass installed.
1615

17-
1816
## Local Installation
1917

2018
Here are the steps for installation on a local machine.
@@ -36,34 +34,30 @@ Here are the steps for installation on a local machine.
3634
3735
You can now visit the app in your browser by visiting [http://lio.loc/](http://lio.loc).
3836
37+
## Service Configuration
3938
40-
## Github OAuth Configuration
41-
42-
Now, we must install the oauth configuration.
43-
44-
1. [Create an application](https://github.com/settings/applications) in your github account called something like "Laravel IO Development" and add your GH application's client id and secret to this config file. Your GitHub Application should be set up as follows:
39+
Laravel.IO relies on some key services to function, namely Github OAuth authentication and the Google ReCaptcha service. Follow the steps below to fill in the credentials in a custom `.env.local.php` file.
4540
46-
a. Full URL: http://lio.loc
47-
b. Callback URL: http://lio.loc/login
41+
1. Create the configuration file below at the root of your application with the name ***.env.local.php***.
4842
49-
2. Create the configuration file below at ***app/config/packages/artdarek/oauth-4-laravel/config.php***
50-
51-
```PHP
43+
```php
5244
<?php
5345
5446
return [
55-
'storage' => 'Session',
56-
57-
'consumers' => [
58-
'GitHub' => [
59-
'client_id' => 'YOUR_NEW_CLIENT_ID_HERE',
60-
'client_secret' => 'YOUR_NEW_CLIENT_SECRET_HERE',
61-
'scope' => ['user'],
62-
],
63-
],
47+
'GITHUB_CLIENT_ID' => '',
48+
'GITHUB_CLIENT_SECRET' => '',
49+
'GOOGLE_RECAPTCHA_SITEKEY' => '',
50+
'GOOGLE_RECAPTCHA_SECRETKEY' => '',
6451
];
52+
6553
```
6654

55+
2. [Create an application](https://github.com/settings/applications) in your github account called something like "Laravel IO Development" and add your Github application's client id and secret to the `.env.local.php` file. Your GitHub application should be set up as follows.
56+
57+
a. Full URL: http://lio.loc
58+
b. Callback URL: http://lio.loc/login
59+
60+
3. [Register a new website](https://www.google.com/recaptcha/admin) for the Google ReCaptcha service and fill in the site key and secret key in the `.env.local.php` file.
6761

6862
## Frontend
6963

@@ -73,24 +67,20 @@ Because we keep the generated / minified css out of the repository, we must have
7367
- When running any compass command in the terminal, be sure to run it from your `/public` folder.
7468
- Compass is the tool used to compile Sass source files into CSS files; you can run `compass compile` to run it once, or `compass watch` to trigger a script that will watch your Sass files for changes and trigger a new compass compile on each change
7569

76-
7770
## Maintainer
7871

7972
The Laravel.IO project is currently maintained by [Dries Vints](https://github.com/driesvints). If you have any questions please don't hesitate to ask them in an issue or email me at [[email protected]](mailto:[email protected]).
8073

81-
8274
## Testing
8375

8476
All tests can be run with the following command. Make sure to run this inside the Homestead box.
8577

8678
$ vendor/bin/phpunit
8779

88-
8980
## Contributing
9081

9182
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
9283

93-
9484
## License
9585

9686
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

app/config/app.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
return array(
3+
return [
44

55
/*
66
|--------------------------------------------------------------------------
@@ -13,7 +13,7 @@
1313
|
1414
*/
1515

16-
'debug' => true,
16+
'debug' => false,
1717

1818
/*
1919
|--------------------------------------------------------------------------
@@ -65,7 +65,7 @@
6565
|
6666
*/
6767

68-
'key' => '',
68+
'key' => getenv('APP_KEY'),
6969

7070
'cipher' => MCRYPT_RIJNDAEL_128,
7171

@@ -80,7 +80,7 @@
8080
|
8181
*/
8282

83-
'providers' => array(
83+
'providers' => [
8484

8585
'Illuminate\Foundation\Providers\ArtisanServiceProvider',
8686
'Illuminate\Auth\AuthServiceProvider',
@@ -120,7 +120,7 @@
120120
'Lio\ServiceProviders\CommentServiceProvider',
121121
'Lio\ServiceProviders\MarkdownServiceProvider',
122122
'Lio\ServiceProviders\HashidsServiceProvider',
123-
),
123+
],
124124

125125
/*
126126
|--------------------------------------------------------------------------
@@ -146,7 +146,7 @@
146146
|
147147
*/
148148

149-
'aliases' => array(
149+
'aliases' => [
150150

151151
'App' => 'Illuminate\Support\Facades\App',
152152
'Artisan' => 'Illuminate\Support\Facades\Artisan',
@@ -192,6 +192,6 @@
192192
'Purifier' => 'Mews\Purifier\Facades\Purifier',
193193
'Bugsnag' => 'Bugsnag\BugsnagLaravel\BugsnagFacade',
194194
'ReCaptcha' => 'FruitcakeStudio\ReCaptcha\Support\Laravel\Facade',
195-
),
195+
],
196196

197-
);
197+
];

app/config/auth.php

Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,63 @@
11
<?php
22

3-
return array(
4-
5-
/*
6-
|--------------------------------------------------------------------------
7-
| Default Authentication Driver
8-
|--------------------------------------------------------------------------
9-
|
10-
| This option controls the authentication driver that will be utilized.
11-
| This drivers manages the retrieval and authentication of the users
12-
| attempting to get access to protected areas of your application.
13-
|
14-
| Supported: "database", "eloquent"
15-
|
16-
*/
17-
18-
'driver' => 'eloquent',
19-
20-
/*
21-
|--------------------------------------------------------------------------
22-
| Authentication Model
23-
|--------------------------------------------------------------------------
24-
|
25-
| When using the "Eloquent" authentication driver, we need to know which
26-
| Eloquent model should be used to retrieve your users. Of course, it
27-
| is often just the "User" model but you may use whatever you like.
28-
|
29-
*/
30-
31-
'model' => 'Lio\Accounts\User',
32-
33-
/*
34-
|--------------------------------------------------------------------------
35-
| Authentication Table
36-
|--------------------------------------------------------------------------
37-
|
38-
| When using the "Database" authentication driver, we need to know which
39-
| table should be used to retrieve your users. We have chosen a basic
40-
| default value but you may easily change it to any table you like.
41-
|
42-
*/
43-
44-
'table' => 'users',
45-
46-
/*
47-
|--------------------------------------------------------------------------
48-
| Password Reminder Settings
49-
|--------------------------------------------------------------------------
50-
|
51-
| Here you may set the settings for password reminders, including a view
52-
| that should be used as your password reminder e-mail. You will also
53-
| be able to set the name of the table that holds the reset tokens.
54-
|
55-
*/
56-
57-
'reminder' => array(
58-
59-
'email' => 'emails.auth.reminder', 'table' => 'password_reminders',
60-
61-
),
62-
63-
);
3+
return [
4+
5+
/*
6+
|--------------------------------------------------------------------------
7+
| Default Authentication Driver
8+
|--------------------------------------------------------------------------
9+
|
10+
| This option controls the authentication driver that will be utilized.
11+
| This drivers manages the retrieval and authentication of the users
12+
| attempting to get access to protected areas of your application.
13+
|
14+
| Supported: "database", "eloquent"
15+
|
16+
*/
17+
18+
'driver' => 'eloquent',
19+
20+
/*
21+
|--------------------------------------------------------------------------
22+
| Authentication Model
23+
|--------------------------------------------------------------------------
24+
|
25+
| When using the "Eloquent" authentication driver, we need to know which
26+
| Eloquent model should be used to retrieve your users. Of course, it
27+
| is often just the "User" model but you may use whatever you like.
28+
|
29+
*/
30+
31+
'model' => 'Lio\Accounts\User',
32+
33+
/*
34+
|--------------------------------------------------------------------------
35+
| Authentication Table
36+
|--------------------------------------------------------------------------
37+
|
38+
| When using the "Database" authentication driver, we need to know which
39+
| table should be used to retrieve your users. We have chosen a basic
40+
| default value but you may easily change it to any table you like.
41+
|
42+
*/
43+
44+
'table' => 'users',
45+
46+
/*
47+
|--------------------------------------------------------------------------
48+
| Password Reminder Settings
49+
|--------------------------------------------------------------------------
50+
|
51+
| Here you may set the settings for password reminders, including a view
52+
| that should be used as your password reminder e-mail. You will also
53+
| be able to set the name of the table that holds the reset tokens.
54+
|
55+
*/
56+
57+
'reminder' => [
58+
59+
'email' => 'emails.auth.reminder', 'table' => 'password_reminders',
60+
61+
],
62+
63+
];

0 commit comments

Comments
 (0)