-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge conflict resolution. Added a use at the same line as remote. Fixed
- Loading branch information
Showing
56 changed files
with
729 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
.git | ||
Dockerfile | ||
.dockerignore | ||
app/storage/logs/* | ||
app/storage/views/* | ||
vendor/* | ||
vendor/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,19 @@ | ||
FROM ubuntu | ||
MAINTAINER Brady Wetherington <[email protected]> | ||
|
||
# Merging all apt-stuff together | ||
####RUN apt-get install -y apache2-bin libapache2-mod-php5 php5-mysql | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
apache2-bin \ | ||
libapache2-mod-php5 \ | ||
php5-mysql \ | ||
php5-mcrypt \ | ||
php5-gd \ | ||
patch \ | ||
curl \ | ||
git \ | ||
php5-mcrypt | ||
|
||
#expect | ||
|
||
# stopped using expect (!) | ||
vim \ | ||
git | ||
|
||
RUN php5enmod mcrypt | ||
|
||
#RUN echo "include_path=/var/www/html/include" >> /etc/php5/apache2/php.ini | ||
RUN php5enmod gd | ||
|
||
RUN sed -i 's/variables_order = .*/variables_order = "EGPCS"/' /etc/php5/apache2/php.ini | ||
RUN sed -i 's/variables_order = .*/variables_order = "EGPCS"/' /etc/php5/cli/php.ini | ||
|
@@ -29,18 +23,12 @@ RUN useradd --uid 1000 --gid 50 docker | |
RUN echo export APACHE_RUN_USER=docker >> /etc/apache2/envvars | ||
RUN echo export APACHE_RUN_GROUP=staff >> /etc/apache2/envvars | ||
|
||
#COPY httpd.conf /etc/apache2/apache2.conf | ||
|
||
COPY docker/000-default.conf /etc/apache2/sites-enabled/000-default.conf | ||
|
||
COPY . /var/www/html | ||
|
||
#apachectl start | ||
|
||
RUN a2enmod rewrite | ||
|
||
#RUN apt-get install -y patch | ||
|
||
############ INITIAL APPLICATION SETUP ##################### | ||
|
||
COPY docker/app_start.patch /tmp/app_start.patch | ||
|
@@ -71,19 +59,16 @@ RUN cp -n /var/www/html/app/config/production/app.example.php /var/www/html/app/ | |
# Change default hostname to blank...I guess? | ||
RUN sed -i s%http://staging.yourserver.com%% /var/www/html/app/config/production/app.php | ||
|
||
# turn off the toolbar | ||
RUN sed -i 's%\x27debug\x27 => true%\x27debug\x27 => false%' /var/www/html/app/config/production/app.php | ||
|
||
RUN chown -R docker /var/www/html | ||
|
||
############## DEPENDENCIES via COMPOSER ################### | ||
|
||
# get curl (this feels yucky, doesn' it?) | ||
#RUN apt-get install -y curl | ||
|
||
#global install of composer | ||
RUN cd /tmp;curl -sS https://getcomposer.org/installer | php;mv /tmp/composer.phar /usr/local/bin/composer | ||
|
||
# Composer won't install without git (doctrine/inflector specifically?) | ||
#RUN apt-get install -y git | ||
|
||
# Get dependencies | ||
RUN cd /var/www/html;composer install | ||
|
||
|
@@ -100,4 +85,4 @@ RUN cd /var/www/html;composer install | |
|
||
CMD . /etc/apache2/envvars ;apache2 -DFOREGROUND | ||
|
||
EXPOSE 80 | ||
EXPOSE 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<?php | ||
|
||
use Illuminate\Console\Command; | ||
use Symfony\Component\Console\Input\InputOption; | ||
use Symfony\Component\Console\Input\InputArgument; | ||
|
||
class SendExpirationAlerts extends Command { | ||
|
||
/** | ||
* The console command name. | ||
* | ||
* @var string | ||
*/ | ||
protected $name = 'alerts:expiring'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'This command checks for expiring warrantees and service agreements, and sends out an alert email.'; | ||
|
||
/** | ||
* Create a new command instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
} | ||
|
||
/** | ||
* Execute the console command. | ||
* | ||
* @return mixed | ||
*/ | ||
public function fire() | ||
{ | ||
$expiring_assets = Asset::getExpiringWarrantee(60); | ||
|
||
$data['count'] = count($expiring_assets); | ||
$data['email_content'] =''; | ||
|
||
|
||
|
||
foreach ($expiring_assets as $asset) { | ||
$now = date("Y-m-d"); | ||
$expires = $asset->warrantee_expires(); | ||
$difference = round(abs(strtotime($expires) - strtotime($now))/86400); | ||
|
||
if ($difference > 30) { | ||
$data['email_content'] .= '<tr style="background-color: #fcffa3;">'; | ||
} else { | ||
$data['email_content'] .= '<tr style="background-color:#d9534f;">'; | ||
} | ||
$data['email_content'] .= '<td><a href="'.Config::get('app.url').'/hardware/'.$asset->id.'/view">'; | ||
$data['email_content'] .= $asset->name.'</a></td><td>'.$asset->asset_tag.'</td>'; | ||
$data['email_content'] .= '<td>'.$asset->warrantee_expires().'</td>'; | ||
$data['email_content'] .= '<td>'.$difference.' days</td>'; | ||
$data['email_content'] .= '</tr>'; | ||
} | ||
|
||
if ((Setting::getSettings()->alert_email!='') && (Setting::getSettings()->alerts_enabled==1)){ | ||
|
||
if (count($expiring_assets) > 0) { | ||
|
||
Mail::send('emails.expiring-report', $data, function ($m) { | ||
$m->to(Setting::getSettings()->alert_email, Setting::getSettings()->site_name); | ||
$m->subject('Expiring Assets Report'); | ||
}); | ||
|
||
} | ||
|
||
} else { | ||
|
||
if (Setting::getSettings()->alert_email=='') { | ||
echo "Could not send email. No alert email configured in settings. \n"; | ||
} elseif (Setting::getSettings()->alerts_enabled!=1) { | ||
echo "Alerts are disabled in the settings. No mail will be sent. \n"; | ||
} | ||
|
||
} | ||
|
||
|
||
|
||
|
||
} | ||
|
||
|
||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.