Dan Brown

Updated readme with social & update instructions

...@@ -7,7 +7,7 @@ APP_KEY=SomeRandomString ...@@ -7,7 +7,7 @@ APP_KEY=SomeRandomString
7 DB_HOST=localhost 7 DB_HOST=localhost
8 DB_DATABASE=database_database 8 DB_DATABASE=database_database
9 DB_USERNAME=database_username 9 DB_USERNAME=database_username
10 -DB_PASSWORD=database__user_password 10 +DB_PASSWORD=database_user_password
11 11
12 # Cache and session 12 # Cache and session
13 CACHE_DRIVER=file 13 CACHE_DRIVER=file
...@@ -33,8 +33,8 @@ GOOGLE_APP_SECRET=false ...@@ -33,8 +33,8 @@ GOOGLE_APP_SECRET=false
33 # URL used for social login redirects, NO TRAILING SLASH 33 # URL used for social login redirects, NO TRAILING SLASH
34 APP_URL=http://bookstack.dev 34 APP_URL=http://bookstack.dev
35 35
36 -# External services 36 +# External services such as Gravatar
37 -USE_GRAVATAR=true 37 +DISABLE_EXTERNAL_SERVICES=false
38 38
39 # Mail settings 39 # Mail settings
40 MAIL_DRIVER=smtp 40 MAIL_DRIVER=smtp
...@@ -42,4 +42,4 @@ MAIL_HOST=localhost ...@@ -42,4 +42,4 @@ MAIL_HOST=localhost
42 MAIL_PORT=1025 42 MAIL_PORT=1025
43 MAIL_USERNAME=null 43 MAIL_USERNAME=null
44 MAIL_PASSWORD=null 44 MAIL_PASSWORD=null
45 -MAIL_ENCRYPTION=null
...\ No newline at end of file ...\ No newline at end of file
45 +MAIL_ENCRYPTION=null
......
...@@ -129,7 +129,7 @@ class SocialAuthService ...@@ -129,7 +129,7 @@ class SocialAuthService
129 // When a user is logged in, A social account exists but the users do not match. 129 // When a user is logged in, A social account exists but the users do not match.
130 // Change the user that the social account is assigned to. 130 // Change the user that the social account is assigned to.
131 if ($isLoggedIn && $socialAccount !== null && $socialAccount->user->id != $currentUser->id) { 131 if ($isLoggedIn && $socialAccount !== null && $socialAccount->user->id != $currentUser->id) {
132 - \Session::flash('success', 'This ' . title_case($socialDriver) . ' account is already used buy another user.'); 132 + \Session::flash('success', 'This ' . title_case($socialDriver) . ' account is already used by another user.');
133 return redirect($currentUser->getEditUrl()); 133 return redirect($currentUser->getEditUrl());
134 } 134 }
135 135
......
...@@ -61,6 +61,41 @@ location / { ...@@ -61,6 +61,41 @@ location / {
61 try_files $uri $uri/ /index.php?$query_string; 61 try_files $uri $uri/ /index.php?$query_string;
62 } 62 }
63 ``` 63 ```
64 +## Updating BookStack
65 +
66 +To update BookStack you can run the following command in the root directory of the application:
67 +```
68 +git pull origin release && composer install && php artisan migrate
69 +```
70 +This command will update the repository that was created in the installation, install the PHP dependencies using `composer` then run the database migrations.
71 +
72 +## Social Authentication
73 +
74 +BookStack currently supports login via both Google and Github. Once enabled options for these services will show up in the login, registration and user profile pages. By default these services are disabled. To enable them you will have to create an application on the external services to obtain the require application id's and secrets. Here are instructions to do this for the current supported services:
75 +
76 +### Google
77 +
78 +1. Open the [Google Developers Console](https://console.developers.google.com/).
79 +2. Create a new project (May have to wait a short while for it to be created).
80 +3. Select 'Enable and manage APIs'.
81 +4. Enable the 'Google+ API'.
82 +5. In 'Credentials' choose the 'OAuth consent screen' tab and enter a product name ('BookStack' or your custom set name).
83 +6. Back in the 'Credentials' tab click 'New credentials' > 'OAuth client ID'.
84 +7. Choose an application type of 'Web application' and enter the following urls under 'Authorized redirect URIs', changing `https://example.com` to your own domain where BookStack is hosted:
85 + - `https://example.com/login/service/google/callback`
86 + - `https://example.com/register/service/google/callback`
87 +8. Click 'Create' and your app_id and secret will be displayed. Replace the false value on both the `GOOGLE_APP_ID` & `GOOGLE_APP_SECRET` variables in the '.env' file in the BookStack root directory with your own app_id and secret.
88 +9. Set the 'APP_URL' environment variable to be the same domain as you entered in step 7. So, in this example, it will be `https://example.com`.
89 +10. All done! Users should now be able to link to their social accounts in their account profile pages and also register/login using their Google accounts.
90 +
91 +### Github
92 +
93 +1. While logged in, open up your [GitHub developer applications](https://github.com/settings/developers).
94 +2. Click 'Register new application'.
95 +3. Enter an application name ('BookStack' or your custom set name), A link to your app instance under 'Homepage URL' and an 'Authorization callback URL' of the url that your BookStack instance is hosted on then click 'Register application'.
96 +4. A 'Client ID' and a 'Client Secret' value will be shown. Add these two values to the to the `GITHUB_APP_ID` and `GITHUB_APP_SECRET` variables, replacing the default false value, in the '.env' file found in the BookStack root folder.
97 +5. Set the 'APP_URL' environment variable to be the same domain as you entered in step 3.
98 +6. All done! Users should now be able to link to their social accounts in their account profile pages and also register/login using their Github account.
64 99
65 ## Testing 100 ## Testing
66 101
...@@ -73,7 +108,7 @@ php artisan migrate --database=mysql_testing ...@@ -73,7 +108,7 @@ php artisan migrate --database=mysql_testing
73 php artisan db:seed --class=DummyContentSeeder --database=mysql_testing 108 php artisan db:seed --class=DummyContentSeeder --database=mysql_testing
74 ``` 109 ```
75 110
76 -Once done you can run `phpunit` in the application root directory to run all tests. 111 +Once done you can run `phpunit` (or `./vendor/bin/phpunit` if `phpunit` is not found) in the application root directory to run all tests.
77 112
78 ## License 113 ## License
79 114
......