diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php
index 856248bd..db6de2df 100644
--- a/app/Http/Controllers/Controller.php
+++ b/app/Http/Controllers/Controller.php
@@ -16049,26 +16049,30 @@ protected function send_fax($job_id, $faxnumber, $faxrecipient)
protected function send_mail($template, $data_message, $subject, $to, $practice_id)
{
$practice = DB::table('practiceinfo')->where('practice_id', '=', $practice_id)->first();
- $file = File::get(base_path() . "/.google");
- if ($file !== '') {
- $file_arr = json_decode($file, true);
+ if (env('MAIL_HOST') == 'smtp.gmail.com') {
+ // $file = File::get(base_path() . "/.google");
+ // if ($file !== '') {
+ // $file_arr = json_decode($file, true);
$google = new Google_Client();
- $google->setClientID($file_arr['web']['client_id']);
- $google->setClientSecret($file_arr['web']['client_secret']);
+ $google->setClientID(env('GOOGLE_KEY'));
+ $google->setClientSecret(env('GOOGLE_SECRET'));
+ // $google->setClientID($file_arr['web']['client_id']);
+ // $google->setClientSecret($file_arr['web']['client_secret']);
$google->refreshToken($practice->google_refresh_token);
$credentials = $google->getAccessToken();
$data1['smtp_pass'] = $credentials['access_token'];
DB::table('practiceinfo')->where('practice_id', '=', $practice_id)->update($data1);
- $config = [
- 'mail.driver' => 'smtp',
- 'mail.host' => 'smtp.gmail.com',
- 'mail.port' => 465,
- 'mail.from' => ['address' => null, 'name' => null],
- 'mail.encryption' => 'ssl',
- 'mail.username' => $practice->smtp_user,
- 'mail.password' => $credentials['access_token'],
- 'mail.sendmail' => '/usr/sbin/sendmail -bs'
- ];
+ $config['mail.password'] = $credentials['access_token'];
+ // $config = [
+ // 'mail.driver' => 'smtp',
+ // 'mail.host' => 'smtp.gmail.com',
+ // 'mail.port' => 465,
+ // 'mail.from' => ['address' => null, 'name' => null],
+ // 'mail.encryption' => 'ssl',
+ // 'mail.username' => $practice->smtp_user,
+ // 'mail.password' => $credentials['access_token'],
+ // 'mail.sendmail' => '/usr/sbin/sendmail -bs'
+ // ];
config($config);
extract(Config::get('mail'));
$transport = Swift_SmtpTransport::newInstance($host, $port, 'ssl');
@@ -16081,12 +16085,19 @@ protected function send_mail($template, $data_message, $subject, $to, $practice_
$transport->setPassword($password);
}
Mail::setSwiftMailer(new Swift_Mailer($transport));
- Mail::send($template, $data_message, function ($message) use ($to, $subject, $practice) {
- $message->to($to)
- ->from($practice->email, $practice->practice_name)
- ->subject($subject);
- });
+ // Mail::send($template, $data_message, function ($message) use ($to, $subject, $practice) {
+ // $message->to($to)
+ // ->from($practice->email, $practice->practice_name)
+ // ->subject($subject);
+ // });
+ // }
}
+ Mail::send($template, $data_message, function ($message) use ($to, $subject, $practice) {
+ $message->to($to)
+ ->from($practice->email, $practice->practice_name)
+ ->subject($subject);
+ });
+ return "E-mail sent.";
return true;
}
diff --git a/app/Http/Controllers/CoreController.php b/app/Http/Controllers/CoreController.php
index 2367fcc1..b3fed5ce 100644
--- a/app/Http/Controllers/CoreController.php
+++ b/app/Http/Controllers/CoreController.php
@@ -5994,6 +5994,134 @@ public function setup(Request $request)
return view('core', $data);
}
+ public function setup_mail(Request $request)
+ {
+ if (Session::get('group_id') == '1') {
+ if ($request->isMethod('post')) {
+ $this->validate($request, [
+ 'mail_type' => 'required'
+ ]);
+ $mail_arr = [
+ 'gmail' => [
+ 'MAIL_DRIVER' => 'smtp',
+ 'MAIL_HOST' => 'smtp.gmail.com',
+ 'MAIL_PORT' => 465,
+ 'MAIL_ENCRYPTION' => 'ssl',
+ 'MAIL_USERNAME' => $request->input('mail_username'),
+ 'MAIL_PASSWORD' => '',
+ 'GOOGLE_KEY' => $request->input('google_client_id'),
+ 'GOOGLE_SECRET' => $request->input('google_client_secret'),
+ 'GOOGLE_REDIRECT_URI' => route('googleoauth')
+ ],
+ 'mailgun' => [
+ 'MAIL_DRIVER' => 'mailgun',
+ 'MAILGUN_DOMAIN' => $request->input('mailgun_domain'),
+ 'MAILGUN_SECRET' => $request->input('mailgun_secret'),
+ 'MAIL_HOST' => '',
+ 'MAIL_PORT' => '',
+ 'MAIL_ENCRYPTION' => '',
+ 'MAIL_USERNAME' => '',
+ 'MAIL_PASSWORD' => '',
+ 'GOOGLE_KEY' => '',
+ 'GOOGLE_SECRET' => '',
+ 'GOOGLE_REDIRECT_URI' => ''
+ ],
+ 'sparkpost' => [
+ 'MAIL_DRIVER' => 'sparkpost',
+ 'SPARKPOST_SECRET' => $request->input('sparkpost_secret'),
+ 'MAIL_HOST' => '',
+ 'MAIL_PORT' => '',
+ 'MAIL_ENCRYPTION' => '',
+ 'MAIL_USERNAME' => '',
+ 'MAIL_PASSWORD' => '',
+ 'GOOGLE_KEY' => '',
+ 'GOOGLE_SECRET' => '',
+ 'GOOGLE_REDIRECT_URI' => ''
+ ],
+ 'ses' => [
+ 'MAIL_DRIVER' => 'ses',
+ 'SES_KEY' => $request->input('ses_key'),
+ 'SES_SECRET' => $request->input('ses_secret'),
+ 'MAIL_HOST' => '',
+ 'MAIL_PORT' => '',
+ 'MAIL_ENCRYPTION' => '',
+ 'MAIL_USERNAME' => '',
+ 'MAIL_PASSWORD' => '',
+ 'GOOGLE_KEY' => '',
+ 'GOOGLE_SECRET' => '',
+ 'GOOGLE_REDIRECT_URI' => ''
+ ],
+ 'unique' => [
+ 'MAIL_DRIVER' => 'smtp',
+ 'MAIL_HOST' => $request->input('mail_host'),
+ 'MAIL_PORT' => $request->input('mail_port'),
+ 'MAIL_ENCRYPTION' => $request->input('mail_encryption'),
+ 'MAIL_USERNAME' => $request->input('mail_username'),
+ 'MAIL_PASSWORD' => $request->input('mail_password'),
+ 'GOOGLE_KEY' => '',
+ 'GOOGLE_SECRET' => '',
+ 'GOOGLE_REDIRECT_URI' => ''
+ ]
+ ];
+ $this->changeEnv($mail_arr[$request->input('mail_type')]);
+ if ($request->input('mail_type') == 'gmail') {
+ return redirect()->route('googleoauth');
+ } else {
+ return redirect()->route('setup_mail_test');
+ }
+ } else {
+ $data2['noheader'] = true;
+ $data2['assets_js'] = $this->assets_js();
+ $data2['assets_css'] = $this->assets_css();
+ $data2['mail_type'] = '';
+ $data2['mail_host'] = env('MAIL_HOST');
+ $data2['mail_port'] = env('MAIL_PORT');
+ $data2['mail_encryption'] = env('MAIL_ENCRYPTION');
+ $data2['mail_username'] = env('MAIL_USERNAME');
+ $data2['mail_password'] = env('MAIL_PASSWORD');
+ $data2['google_client_id'] = env('GOOGLE_KEY');
+ $data2['google_client_secret'] = env('GOOGLE_SECRET');
+ $data2['mail_username'] = env('MAIL_USERNAME');
+ $data2['mailgun_domain'] = env('MAILGUN_DOMAIN');
+ $data2['mailgun_secret'] = env('MAILGUN_SECRET');
+ $data2['mail_type'] == 'sparkpost';
+ $data2['sparkpost_secret'] = env('SPARKPOST_SECRET');
+ $data2['ses_key'] = env('SES_KEY');
+ $data2['ses_secret'] = env('SES_SECRET');
+ if (env('MAIL_DRIVER') == 'smtp') {
+ if (env('MAIL_HOST') == 'smtp.gmail.com') {
+ $data2['mail_type'] = 'gmail';
+ } else {
+ $data2['mail_type'] = 'unique';
+ }
+ } else {
+ $data2['mail_type'] = env('MAIL_DRIVER');
+ }
+ $data2['message_action'] = Session::get('message_action');
+ Session::forget('message_action');
+ return view('setup_mail', $data2);
+ }
+ } else {
+ return redirect()->route('dashboard');
+ }
+ }
+
+ public function setup_mail_test(Request $request)
+ {
+ $data_message['item'] = 'This is a test';
+ $practice = DB::table('practiceinfo')->where('practice_id', '=', Session::get('practice_id'))->first();
+ $message_action = 'Check to see in your registered e-mail account if you have recieved it. If not, please come back to the E-mail Service page and try again.';
+ try {
+ $this->send_mail('emails.blank', $data_message, 'Test E-mail', $practice->email, Session::get('practice_id'));
+ } catch(\Exception $e){
+ $message_action = 'Error - There is an error in your configuration. Please try again.';
+ Session::put('message_action', $message_action);
+ return redirect()->route('setup_mail');
+ }
+ Session::put('message_action', $message_action);
+ return redirect()->route('dashboard');
+ }
+
public function superquery(Request $request, $type)
{
$user = DB::table('users')->where('id', '=', Session::get('user_id'))->first();
diff --git a/app/Http/Controllers/InstallController.php b/app/Http/Controllers/InstallController.php
index eeb7e7b6..bf453bf9 100644
--- a/app/Http/Controllers/InstallController.php
+++ b/app/Http/Controllers/InstallController.php
@@ -58,48 +58,70 @@ public function backup()
public function google_start(Request $request)
{
- $query = DB::table('practiceinfo')->first();
- if ($request->isMethod('post')) {
- $file = $request->file('file_input');
- $json = file_get_contents($file->getRealPath());
- if (json_decode($json) == NULL) {
- Session::put('message_action', 'Error - This is not a json file. Try again');
- return redirect()->route('google_start');
- }
- $config_file = base_path() . '/.google';
- if (file_exists($config_file)) {
- unlink($config_file);
- }
- $directory = base_path();
- $new_name = ".google";
- $file->move($directory, $new_name);
- Session::put('message_action', 'Google JSON file uploaded successfully');
- if (! $query) {
- if (file_exists(base_path() . '/.patientcentric')) {
- return redirect()->route('install', ['patient']);
- } else {
- return redirect()->route('install', ['practice']);
- }
- } else {
- return redirect()->route('dashboard');
- }
- } else {
- $data['panel_header'] = 'Upload Google JSON File for GMail Integration';
- $data['document_upload'] = route('google_start');
- $type_arr = ['json'];
- $data['document_type'] = json_encode($type_arr);
- $text = "
You're' here because you have not installed a Google OAuth2 Client ID file. You'll need to set this up first before configuring NOSH Charting System.'
";
- if ($query) {
- $dropdown_array['default_button_text'] = 'Back';
- $dropdown_array['default_button_text_url'] = route('dashboard');
- $data['panel_dropdown'] = $this->dropdown_build($dropdown_array);
- $text = "A Google OAuth2 Client ID file is already installed. Uploading a new file will overwrite the existing file!
";
- }
- $data['content'] = '' . $text . '
- Instructions are on ' . HTML::link('https://github.com/shihjay2/nosh-in-a-box/wiki/How-to-get-Gmail-to-work-with-NOSH', 'this Wiki page.', ['target'=>'_blank']) . ' Please refer to it carefully.
- Once you have you JSON file, upload it here.
';
- $data['assets_js'] = $this->assets_js('document_upload');
- $data['assets_css'] = $this->assets_css('document_upload');
- return view('document_upload', $data);
+ $google_file = base_path() . '/.google';
+ $file = File::get($google_file);
+ if ($file !== '') {
+ $file_arr = json_decode($file, true);
+ $practice = DB::table('practiceinfo')->first();
+ $mail_arr = [
+ 'MAIL_DRIVER' => 'smtp',
+ 'MAIL_HOST' => 'smtp.gmail.com',
+ 'MAIL_PORT' => 465,
+ 'MAIL_ENCRYPTION' => 'ssl',
+ 'MAIL_USERNAME' => $practice->smtp_user,
+ 'MAIL_PASSWORD' => '',
+ 'GOOGLE_KEY' => $file_arr['web']['client_id'],
+ 'GOOGLE_SECRET' => $file_arr['web']['client_secret'],
+ 'GOOGLE_REDIRECT_URI' => route('googleoauth'),
+ 'MAILGUN_DOMAIN' => '',
+ 'MAILGUN_SECRET' => ''
+ ];
+ $this->changeEnv($mail_arr);
}
+ unlink($google_file);
+ return redirect()->route('dashboard');
+ // $query = DB::table('practiceinfo')->first();
+ // if ($request->isMethod('post')) {
+ // $file = $request->file('file_input');
+ // $json = file_get_contents($file->getRealPath());
+ // if (json_decode($json) == NULL) {
+ // Session::put('message_action', 'Error - This is not a json file. Try again');
+ // return redirect()->route('google_start');
+ // }
+ // $config_file = base_path() . '/.google';
+ // if (file_exists($config_file)) {
+ // unlink($config_file);
+ // }
+ // $directory = base_path();
+ // $new_name = ".google";
+ // $file->move($directory, $new_name);
+ // Session::put('message_action', 'Google JSON file uploaded successfully');
+ // if (! $query) {
+ // if (file_exists(base_path() . '/.patientcentric')) {
+ // return redirect()->route('install', ['patient']);
+ // } else {
+ // return redirect()->route('install', ['practice']);
+ // }
+ // } else {
+ // return redirect()->route('dashboard');
+ // }
+ // } else {
+ // $data['panel_header'] = 'Upload Google JSON File for GMail Integration';
+ // $data['document_upload'] = route('google_start');
+ // $type_arr = ['json'];
+ // $data['document_type'] = json_encode($type_arr);
+ // $text = "You're' here because you have not installed a Google OAuth2 Client ID file. You'll need to set this up first before configuring NOSH Charting System.'
";
+ // if ($query) {
+ // $dropdown_array['default_button_text'] = 'Back';
+ // $dropdown_array['default_button_text_url'] = route('dashboard');
+ // $data['panel_dropdown'] = $this->dropdown_build($dropdown_array);
+ // $text = "A Google OAuth2 Client ID file is already installed. Uploading a new file will overwrite the existing file!
";
+ // }
+ // $data['content'] = '' . $text . '
- Instructions are on ' . HTML::link('https://github.com/shihjay2/nosh-in-a-box/wiki/How-to-get-Gmail-to-work-with-NOSH', 'this Wiki page.', ['target'=>'_blank']) . ' Please refer to it carefully.
- Once you have you JSON file, upload it here.
';
+ // $data['assets_js'] = $this->assets_js('document_upload');
+ // $data['assets_css'] = $this->assets_css('document_upload');
+ // return view('document_upload', $data);
+ // }
}
public function install(Request $request, $type)
@@ -232,6 +254,55 @@ public function install(Request $request, $type)
$this->audit('Add');
$directory = $documents_dir . $pid;
mkdir($directory, 0775);
+ $pnosh_url = $request->root();
+ $pnosh_url = str_replace(array('http://','https://'), '', $pnosh_url);
+ $root_url = explode('/', $pnosh_url);
+ $root_url1 = explode('.', $root_url[2]);
+ $final_root_url = $root_url1[1] . '.' . $root_url1[2];
+ if ($final_root_url == 'hieofone.org') {
+ $mailgun_url = 'https://dir.' . $final_root_url . '/mailgun';
+ $params = ['uri' => $pnosh_url];
+ $post_body = json_encode($params);
+ $content_type = 'application/json';
+ $ch = curl_init();
+ curl_setopt($ch,CURLOPT_URL, $mailgun_url);
+ curl_setopt($ch, CURLOPT_POST, 1);
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $post_body);
+ curl_setopt($ch, CURLOPT_HTTPHEADER, [
+ "Content-Type: {$content_type}",
+ 'Content-Length: ' . strlen($post_body)
+ ]);
+ curl_setopt($ch, CURLOPT_HEADER, 0);
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
+ curl_setopt($ch,CURLOPT_FAILONERROR,1);
+ curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1);
+ curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
+ curl_setopt($ch,CURLOPT_TIMEOUT, 60);
+ curl_setopt($ch,CURLOPT_CONNECTTIMEOUT ,0);
+ $mailgun_secret = curl_exec($ch);
+ $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
+ curl_close ($ch);
+ if ($httpCode !== 404 && $httpCode !== 0) {
+ if ($mailgun_secret !== 'Not authorized.' && $mailgun_secret !== 'Try again.') {
+ $mail_arr = [
+ 'MAIL_DRIVER' => 'mailgun',
+ 'MAILGUN_DOMAIN' => 'mg.hieofone.org',
+ 'MAILGUN_SECRET' => $mailgun_secret,
+ 'MAIL_HOST' => '',
+ 'MAIL_PORT' => '',
+ 'MAIL_ENCRYPTION' => '',
+ 'MAIL_USERNAME' => '',
+ 'MAIL_PASSWORD' => '',
+ 'GOOGLE_KEY' => '',
+ 'GOOGLE_SECRET' => '',
+ 'GOOGLE_REDIRECT_URI' => ''
+ ];
+ $this->changeEnv($mail_arr);
+ } else {
+
+ }
+ }
+ }
} else {
$displayname = 'Administrator';
}
diff --git a/app/Http/Controllers/LoginController.php b/app/Http/Controllers/LoginController.php
index 5ca40c6b..e17df279 100644
--- a/app/Http/Controllers/LoginController.php
+++ b/app/Http/Controllers/LoginController.php
@@ -298,13 +298,11 @@ public function google_auth(Request $request)
public function googleoauth(Request $request)
{
$url = route('googleoauth');
- $file = File::get(base_path() . "/.google");
- $file_arr = json_decode($file, true);
$google = new Google_Client();
$google->setRedirectUri($url);
$google->setApplicationName('NOSH ChartingSystem');
- $google->setClientID($file_arr['web']['client_id']);
- $google->setClientSecret($file_arr['web']['client_secret']);
+ $google->setClientID(env('GOOGLE_KEY'));
+ $google->setClientSecret('GOOGLE_SECRET');
$google->setAccessType('offline');
$google->setApprovalPrompt('force');
$google->setScopes(array('https://mail.google.com/'));
@@ -312,7 +310,7 @@ public function googleoauth(Request $request)
$credentials = $google->authenticate($_GET['code']);
$data['google_refresh_token'] = $credentials['refresh_token'];
DB::table('practiceinfo')->where('practice_id', '=', Session::get('practice_id'))->update($data);
- return redirect()->route('dashboard');
+ return redirect()->route('setup_mail_test');
} else {
$authUrl = $google->createAuthUrl();
header('Location: ' . filter_var($authUrl, FILTER_SANITIZE_URL));
diff --git a/app/Http/Middleware/CheckInstall.php b/app/Http/Middleware/CheckInstall.php
index 68f85a59..57bcb3d9 100644
--- a/app/Http/Middleware/CheckInstall.php
+++ b/app/Http/Middleware/CheckInstall.php
@@ -5,6 +5,7 @@
use Artisan;
use Closure;
use DB;
+use Symfony\Component\Process\Process;
use Response;
use Schema;
use URL;
@@ -41,12 +42,6 @@ public function handle($request, Closure $next)
return redirect()->route('set_version');
}
- // Check if Google file for sending email via Gmail exists
- $google_file = base_path() . '/.google';
- if (!file_exists($google_file)) {
- return redirect()->route('google_start');
- }
-
// Chcek if needing installation
$install = DB::table('practiceinfo')->first();
if (!$install) {
@@ -60,12 +55,20 @@ public function handle($request, Closure $next)
// Check for updates
define('STDIN',fopen("php://stdin","r"));
if (!Schema::hasTable('migrations')) {
- Artisan::call('migrate:install', ['--force' => true]);
+ $migrate = new Process("php artisan migrate:install --force");
+ $migrate->setWorkingDirectory(base_path());
+ $migrate->setTimeout(null);
+ $migrate->run();
+ // Artisan::call('migrate:install', ['--force' => true]);
}
- Artisan::call('migrate', ['--force' => true]);
- $current_version = "1.8.4";
+ $migrate1 = new Process("php artisan migrate --force");
+ $migrate1->setWorkingDirectory(base_path());
+ $migrate1->setTimeout(null);
+ $migrate1->run();
+ // Artisan::call('migrate', ['--force' => true]);
+ $current_version = "2.0.0";
if ($install->version < $current_version) {
- return redirect()->route('update');
+ return redirect()->route('update_install');
}
// Check if OpenID Connect beta testing and register if not yet
@@ -75,6 +78,12 @@ public function handle($request, Closure $next)
// }
// }
+ // Check if Google file for sending email via Gmail exists and transion to new e-mail
+ $google_file = base_path() . '/.google';
+ if (file_exists($google_file)) {
+ return redirect()->route('google_start');
+ }
+
// Check if pNOSH instance
if ($install->patient_centric == 'y') {
if ($install->uma_refresh_token == '') {
diff --git a/app/Http/Middleware/PostAuth.php b/app/Http/Middleware/PostAuth.php
index 0e6a9a56..899c3e3e 100644
--- a/app/Http/Middleware/PostAuth.php
+++ b/app/Http/Middleware/PostAuth.php
@@ -21,11 +21,14 @@ class PostAuth
public function handle($request, Closure $next)
{
$install = DB::table('practiceinfo')->first();
- // Check if Google refresh token registered
- if ($install->google_refresh_token == '') {
- if (route('dashboard') != 'http://localhost/nosh') {
- $google = File::get(base_path() . "/.google");
- if ($google !== '') {
+ // Check if e-mail service is setup
+ if (env('MAIL_HOST') == 'mailtrap.io') {
+ return redirect()->route('setup_mail');
+ }
+ // Check if Google refresh token registered if Google is used as e-mail service
+ if (env('MAIL_HOST') == 'smtp.gmail.com') {
+ if ($install->google_refresh_token == '') {
+ if (route('dashboard') != 'http://localhost/nosh') {
return redirect()->route('googleoauth');
}
}
diff --git a/app/Http/Middleware/TrustProxies.php b/app/Http/Middleware/TrustProxies.php
index b08e9619..84e0ee28 100644
--- a/app/Http/Middleware/TrustProxies.php
+++ b/app/Http/Middleware/TrustProxies.php
@@ -12,7 +12,7 @@ class TrustProxies extends Middleware
*
* @var array
*/
- protected $proxies = '**';
+ protected $proxies;
/**
* The headers that should be used to detect proxies.
@@ -20,4 +20,15 @@ class TrustProxies extends Middleware
* @var int
*/
protected $headers = Request::HEADER_X_FORWARDED_ALL;
+
+ public function __construct()
+ {
+ if (env('TRUSTED_PROXIES') !== null) {
+ if (env('TRUSTED_PROXIES') == '*') {
+ $this->proxies = '*';
+ } else {
+ $this->proxies = explode(',', env('TRUSTED_PROXIES'));
+ }
+ }
+ }
}
diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php
index c33942e1..db4d6c4a 100644
--- a/app/Providers/AppServiceProvider.php
+++ b/app/Providers/AppServiceProvider.php
@@ -14,9 +14,7 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot()
{
- if (env('REDIRECT_HTTPS')) {
- URL::forceScheme('https');
- }
+ //
}
/**
diff --git a/config/app.php b/config/app.php
index 2a1bc58f..68c54c9a 100644
--- a/config/app.php
+++ b/config/app.php
@@ -165,8 +165,7 @@
Yangqi\Htmldom\HtmldomServiceProvider::class,
Devfactory\Minify\MinifyServiceProvider::class,
Maatwebsite\Excel\ExcelServiceProvider::class,
- Elibyy\TCPDF\ServiceProvider::class,
- Fideloper\Proxy\TrustedProxyServiceProvider::class,
+ Elibyy\TCPDF\ServiceProvider::class
],
/*
diff --git a/config/services.php b/config/services.php
index a20ee894..de99f2d9 100644
--- a/config/services.php
+++ b/config/services.php
@@ -36,9 +36,9 @@
],
'google' => [
- 'client_id' => '',
- 'client_secret' => '',
- 'redirect' => '',
+ 'client_id' => env('GOOGLE_KEY'),
+ 'client_secret' => env('GOOGLE_SECRET'),
+ 'redirect' => env('GOOGLE_REDIRECT_URI'),
],
'twitter' => [
diff --git a/droplet-nosh-install.sh b/droplet-nosh-install.sh
index c3cb672e..8a29d798 100644
--- a/droplet-nosh-install.sh
+++ b/droplet-nosh-install.sh
@@ -141,6 +141,17 @@ cd $NEWNOSH
sed -i '/^DB_DATABASE=/s/=.*/='"$MYSQL_DATABASE"'/' $ENV
sed -i '/^DB_USERNAME=/s/=.*/='"$MYSQL_USERNAME"'/' $ENV
sed -i '/^DB_PASSWORD=/s/=.*/='"$MYSQL_PASSWORD"'/' $ENV
+echo "TRUSTED_PROXIES=
+URI=localhost
+
+TWITTER_KEY=yourkeyfortheservice
+TWITTER_SECRET=yoursecretfortheservice
+TWITTER_REDIRECT_URI=https://example.com/login
+
+GOOGLE_KEY=yourkeyfortheservice
+GOOGLE_SECRET=yoursecretfortheservice
+GOOGLE_REDIRECT_URI=https://example.com/login
+" >> $ENV
chown -R $WEB_GROUP.$WEB_USER $NEWNOSH
chmod -R 755 $NEWNOSH
diff --git a/droplet-pnosh-install.sh b/droplet-pnosh-install.sh
index 3a04a66f..708a99d7 100644
--- a/droplet-pnosh-install.sh
+++ b/droplet-pnosh-install.sh
@@ -145,6 +145,17 @@ cd $NEWNOSH
sed -i '/^DB_DATABASE=/s/=.*/='"$MYSQL_DATABASE"'/' $ENV
sed -i '/^DB_USERNAME=/s/=.*/='"$MYSQL_USERNAME"'/' $ENV
sed -i '/^DB_PASSWORD=/s/=.*/='"$MYSQL_PASSWORD"'/' $ENV
+echo "TRUSTED_PROXIES=
+URI=localhost
+
+TWITTER_KEY=yourkeyfortheservice
+TWITTER_SECRET=yoursecretfortheservice
+TWITTER_REDIRECT_URI=https://example.com/login
+
+GOOGLE_KEY=yourkeyfortheservice
+GOOGLE_SECRET=yoursecretfortheservice
+GOOGLE_REDIRECT_URI=https://example.com/login
+" >> $ENV
chown -R $WEB_GROUP.$WEB_USER $NEWNOSH
chmod -R 755 $NEWNOSH
diff --git a/resources/lang/en/nosh.php b/resources/lang/en/nosh.php
index d955be63..187b19cc 100644
--- a/resources/lang/en/nosh.php
+++ b/resources/lang/en/nosh.php
@@ -61,6 +61,7 @@
// Menu
"tasks" => "Tasks",
"setup" => "Setup",
+ "setup_mail" => "E-mail Service",
"users" => "Users",
"schedule" => "Schedule",
"schedule_setup" => "Schedule Setup",
diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php
index a3c21487..d6d3d8a1 100644
--- a/resources/views/layouts/app.blade.php
+++ b/resources/views/layouts/app.blade.php
@@ -48,6 +48,7 @@
{{ trans('nosh.tasks') }}
@if (Session::get('group_id') == '1')
{{ trans('nosh.setup') }}
+ {{ trans('nosh.setup_mail') }}
{{ trans('nosh.users') }}
{{ trans('nosh.schedule') }}