Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f04905d22 | ||
|
|
0ab6391bf3 | ||
|
|
a66dfa8530 | ||
|
|
09cf83c31b | ||
|
|
aac8e9786d | ||
|
|
bcfea0cfad | ||
|
|
8a097b5956 | ||
|
|
effeae054e | ||
|
|
daabdbb566 | ||
|
|
2ed3a2bf3c | ||
|
|
3b12ce1786 | ||
|
|
6c3acfe5e9 |
@@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
function exit_func {
|
||||||
|
echo "SIGTERM detected"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
trap exit_func SIGTERM SIGINT
|
||||||
|
|
||||||
|
ASD_BINDIR="/home/${DDNINJA_AUTHOR}/private/${DDNINJA_BUILDNAME}/bin"
|
||||||
|
|
||||||
|
mkdir -p "/tmp/${DDNINJA_AUTHOR}/${DDNINJA_BUILDNAME}"
|
||||||
|
mkdir -p "/home/${DDNINJA_AUTHOR}/storage/${DDNINJA_BUILDNAME}/media/"
|
||||||
|
mkdir -p "/var/log/${DDNINJA_AUTHOR}/${DDNINJA_BUILDNAME}/"
|
||||||
|
|
||||||
|
php /home/${DDNINJA_AUTHOR}/private/${DDNINJA_BUILDNAME}/bin/worker.php & wait
|
||||||
|
exit $?
|
||||||
Executable
+83
@@ -0,0 +1,83 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use ASD\ThresholdTimer;
|
||||||
|
|
||||||
|
require_once(dirname(__FILE__)."/../load.php");
|
||||||
|
|
||||||
|
require_once("/home/ddninja/private/asdphp/lib/core/ThresholdTimer.php");
|
||||||
|
|
||||||
|
|
||||||
|
$timer = new ThresholdTimer(60);
|
||||||
|
|
||||||
|
function logInfo(string $msg) {
|
||||||
|
echo date("Y-m-d H:i")." - ".$msg,PHP_EOL;
|
||||||
|
}
|
||||||
|
function execHour() {
|
||||||
|
return intval(date('i')) == 0;
|
||||||
|
}
|
||||||
|
function execDay() {
|
||||||
|
return execHour() && intval(date('H')) == 3;
|
||||||
|
}
|
||||||
|
function getMinuteTasks() {
|
||||||
|
return [
|
||||||
|
GenerateAdminActivationMailTask::class,
|
||||||
|
GenerateUserActivationMailTask::class,
|
||||||
|
GenerateAdminPasswordRecoveryMailTask::class,
|
||||||
|
GenerateUserPasswordRecoveryMailTask::class,
|
||||||
|
MailSendTask::class
|
||||||
|
];
|
||||||
|
}
|
||||||
|
function getHourTasks() {
|
||||||
|
return [
|
||||||
|
// NewsletterCheckTask::class,
|
||||||
|
DeleteOldPasswordResetRequestsTask::class,
|
||||||
|
UpdateMeteoCacheTask::class,
|
||||||
|
GenerateCommentiWarningMailTask::class
|
||||||
|
];
|
||||||
|
}
|
||||||
|
function getDailyTasks() {
|
||||||
|
return [
|
||||||
|
// SendBackupTask::class
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
function execute($taskName) {
|
||||||
|
try {
|
||||||
|
if ($taskName::isActive()){
|
||||||
|
logInfo("Executing task $taskName");
|
||||||
|
$taskName::execute();
|
||||||
|
logInfo("Task $taskName executed with success");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception $ex) {
|
||||||
|
logInfo("Task $taskName failed execution");
|
||||||
|
var_dump($ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
logInfo("Worker STARTED!!");
|
||||||
|
|
||||||
|
$count = 1;
|
||||||
|
while (1) {
|
||||||
|
logInfo("Executing Minute");
|
||||||
|
foreach (getMinuteTasks() as $task ) {
|
||||||
|
execute($task);
|
||||||
|
}
|
||||||
|
if (execHour()) {
|
||||||
|
logInfo("Exec hourly");
|
||||||
|
foreach (getHourTasks() as $task ) {
|
||||||
|
execute($task);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (execDay()) {
|
||||||
|
logInfo("Exec Daily");
|
||||||
|
foreach (getDailyTasks() as $task ) {
|
||||||
|
execute($task);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$timer->waitUntilThresholdReached(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
@@ -132,4 +132,11 @@ $config->cbs2->serverPort = $cbs2->serverPort;
|
|||||||
|
|
||||||
$config->database = $database;
|
$config->database = $database;
|
||||||
|
|
||||||
|
$config->mailer = new stdClass();
|
||||||
|
$config->mailer->address = "email-smtp.eu-west-1.amazonaws.com";
|
||||||
|
$config->mailer->port = "587";
|
||||||
|
$config->mailer->username = "AKIASMB7IW2MQPUP5CXS";
|
||||||
|
$config->mailer->password = "BHv+82Nns1kIKg99Hx0sjKlEpR+X4+1EgX+ec64n/mBt";
|
||||||
|
$config->mailer->smtpAuth = true;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -61,17 +61,16 @@ class BannerHelper {
|
|||||||
|
|
||||||
|
|
||||||
private static function getBannerImpressions($bannerIds) {
|
private static function getBannerImpressions($bannerIds) {
|
||||||
|
$time = strtotime("today CET");
|
||||||
$stats = GlobalVariables::get("dao")->query(
|
$stats = GlobalVariables::get("dao")->query(
|
||||||
BannerStatsModel::class,
|
BannerStatsModel::class,
|
||||||
[
|
[
|
||||||
'_id' => [
|
'banner' => [
|
||||||
'$in' => array_map(
|
'$in' => $bannerIds
|
||||||
function($banner) {
|
|
||||||
return new \MongoDB\BSON\ObjectID($banner);
|
|
||||||
},
|
|
||||||
$bannerIds
|
|
||||||
)
|
|
||||||
],
|
],
|
||||||
|
'y' => intval(date('Y', $time)),
|
||||||
|
'm' => intval(date('m', $time)),
|
||||||
|
'd' => intval(date('d', $time))
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
$rval = array_reduce(
|
$rval = array_reduce(
|
||||||
@@ -83,7 +82,7 @@ class BannerHelper {
|
|||||||
[]
|
[]
|
||||||
);
|
);
|
||||||
foreach ($stats as $stat) {
|
foreach ($stats as $stat) {
|
||||||
$rval[strval($stat->id)] = intval($stat->views);
|
$rval[strval($stat->banner)] = intval($stat->views);
|
||||||
}
|
}
|
||||||
return $rval;
|
return $rval;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,21 +42,23 @@ class MailModel extends Model implements FDN_MailInterface{
|
|||||||
return parent::__set($attr, $value);
|
return parent::__set($attr, $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getMailObject(){
|
|
||||||
$email = new PHPMailer();
|
|
||||||
$email->CharSet = "UTF-8";
|
|
||||||
$email->isMail();
|
|
||||||
|
|
||||||
$email->From = $this->from;
|
public function getMailObject() {
|
||||||
|
$email = new PHPMailer();
|
||||||
|
$email->CharSet = "UTF-8";
|
||||||
|
$email->isMail();
|
||||||
|
|
||||||
|
$email->From = $this->from;
|
||||||
if ($this->hasProperty("fromName")){
|
if ($this->hasProperty("fromName")){
|
||||||
$email->FromName = $this->fromName;
|
$email->FromName = $this->fromName;
|
||||||
}
|
}
|
||||||
|
|
||||||
$email->Subject = $this->subject;
|
$email->Subject = $this->subject;
|
||||||
|
|
||||||
$email->IsHTML(true);
|
$email->IsHTML(true);
|
||||||
|
|
||||||
$email->Body = $this->body;
|
|
||||||
|
$email->Body = $this->body;
|
||||||
if ($this->hasProperty("altBody")){
|
if ($this->hasProperty("altBody")){
|
||||||
$email->AltBody = $this->altBody;
|
$email->AltBody = $this->altBody;
|
||||||
}
|
}
|
||||||
@@ -64,14 +66,24 @@ class MailModel extends Model implements FDN_MailInterface{
|
|||||||
$email->AltBody = strip_tags($this->body);
|
$email->AltBody = strip_tags($this->body);
|
||||||
}
|
}
|
||||||
|
|
||||||
$email->AddAddress($this->recipient);
|
|
||||||
|
$email->AddAddress($this->recipient);
|
||||||
|
|
||||||
if ($this->hasProperty("attachment")){
|
if ($this->hasProperty("attachment")){
|
||||||
$email->AddAttachment( $this->attachment , basename($this->attachment) );
|
$email->AddAttachment( $this->attachment , basename($this->attachment) );
|
||||||
}
|
}
|
||||||
|
|
||||||
return $email;
|
$cfg = GlobalVariables::get("config");
|
||||||
}
|
|
||||||
|
$email->IsSMTP();
|
||||||
|
$email->Host = $cfg->mailer->address;
|
||||||
|
$email->Port = $cfg->mailer->port;
|
||||||
|
$email->Username = $cfg->mailer->username;
|
||||||
|
$email->Password = $cfg->mailer->password;
|
||||||
|
$email->SMTPAuth = $cfg->mailer->smtpAuth;
|
||||||
|
|
||||||
|
return $email;
|
||||||
|
}
|
||||||
|
|
||||||
public static function getCollectionName(){
|
public static function getCollectionName(){
|
||||||
return "mail";
|
return "mail";
|
||||||
|
|||||||
@@ -28,9 +28,9 @@ class MenuGenerator {
|
|||||||
|
|
||||||
array("label"=>"Utenti registrati","page"=>"listUsers.php","requires"=>AdminModel::ADMIN_TYPE_NORMALADMIN),
|
array("label"=>"Utenti registrati","page"=>"listUsers.php","requires"=>AdminModel::ADMIN_TYPE_NORMALADMIN),
|
||||||
array("label"=>"Newsletter", "subvoices"=>array(
|
array("label"=>"Newsletter", "subvoices"=>array(
|
||||||
array("label"=>"Nuova","page"=>"editNewsletter.php","requires"=>AdminModel::ADMIN_TYPE_NEWSLETTER),
|
// array("label"=>"Nuova","page"=>"editNewsletter.php","requires"=>AdminModel::ADMIN_TYPE_NEWSLETTER),
|
||||||
array("label"=>"Da inviare","page"=>"pendingNewsletters.php","requires"=>AdminModel::ADMIN_TYPE_NEWSLETTER),
|
// array("label"=>"Da inviare","page"=>"pendingNewsletters.php","requires"=>AdminModel::ADMIN_TYPE_NEWSLETTER),
|
||||||
array("label"=>"Inviate","page"=>"sentNewsletters.php","requires"=>AdminModel::ADMIN_TYPE_NEWSLETTER),
|
// array("label"=>"Inviate","page"=>"sentNewsletters.php","requires"=>AdminModel::ADMIN_TYPE_NEWSLETTER),
|
||||||
array("label"=>"Nuova Mail","page"=>"editMail.php","requires"=>AdminModel::ADMIN_TYPE_SUPERADMIN),
|
array("label"=>"Nuova Mail","page"=>"editMail.php","requires"=>AdminModel::ADMIN_TYPE_SUPERADMIN),
|
||||||
array("label"=>"Coda Mail","page"=>"listMail.php","requires"=>AdminModel::ADMIN_TYPE_SUPERADMIN)
|
array("label"=>"Coda Mail","page"=>"listMail.php","requires"=>AdminModel::ADMIN_TYPE_SUPERADMIN)
|
||||||
)),
|
)),
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ HTMLHelper::generateAdminHead();
|
|||||||
<li>Banner testata:<b>180x60px</b></li>
|
<li>Banner testata:<b>180x60px</b></li>
|
||||||
<li>Banner corpo:<b>160x120px</b></li>
|
<li>Banner corpo:<b>160x120px</b></li>
|
||||||
<li>Banner lungo:<b>160x240px</b></li>
|
<li>Banner lungo:<b>160x240px</b></li>
|
||||||
<li>Banner Inizio pagina:<b>1000x120px</b></li>
|
<li>Banner Inizio pagina:<b>1000x150px</b></li>
|
||||||
<li>Banner Fine pagina:<b>1000x200px</b></li>
|
<li>Banner Fine pagina:<b>1000x200px</b></li>
|
||||||
</ul>
|
</ul>
|
||||||
Tale restizione è consigliata anche per i banner di tipo <i>HTML5</i>.
|
Tale restizione è consigliata anche per i banner di tipo <i>HTML5</i>.
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ GUIHandler::generateHtmlHeaders(array("additionalMetadata"=>$additionalHeaders,"
|
|||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
<div class="articoloTitle">
|
<div class="articoloTitle">
|
||||||
<div class="title" itemprop="name"><?php echo htmlentities($articolo->titolo);?></div>
|
<h1 class="title" itemprop="name"><?php echo htmlentities($articolo->titolo);?></h1>
|
||||||
<div class="subTitle">
|
<div class="subTitle">
|
||||||
<span><?php echo $data;?> —</span>
|
<span><?php echo $data;?> —</span>
|
||||||
<span itemprop="headline"><?php echo $articolo->sottotitolo;?></span>
|
<span itemprop="headline"><?php echo $articolo->sottotitolo;?></span>
|
||||||
|
|||||||
@@ -66,5 +66,5 @@ function resortGroup(group) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function compareEle(a, b) {
|
function compareEle(a, b) {
|
||||||
return a.views >= b.views;
|
return a.views - b.views;
|
||||||
}
|
}
|
||||||
@@ -198,7 +198,7 @@ GUIHandlerMobile::generateHtmlHeaders(array("additionalMetadata"=>$additionalHea
|
|||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
<div class="articoloTitle">
|
<div class="articoloTitle">
|
||||||
<p class="title" itemprop="name"><?php echo htmlentities($articolo->titolo);?></p>
|
<h1 class="title" itemprop="name"><?php echo htmlentities($articolo->titolo);?></h1>
|
||||||
<p class="subTitle">
|
<p class="subTitle">
|
||||||
<span><?php echo $data;?> —</span>
|
<span><?php echo $data;?> —</span>
|
||||||
<span itemprop="headline"><?php echo $articolo->sottotitolo;?></span>
|
<span itemprop="headline"><?php echo $articolo->sottotitolo;?></span>
|
||||||
|
|||||||
@@ -4,29 +4,6 @@ Author: Riccardo Di Dato
|
|||||||
Creation Date: 02/mar/2016
|
Creation Date: 02/mar/2016
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once(dirname(__FILE__)."/../../load.php");
|
include(dirname(__FILE__)."/../../stats/bannerClick.php");
|
||||||
|
|
||||||
try {
|
|
||||||
if (array_key_exists("HTTP_REFERER",$_SERVER)){
|
|
||||||
$host = parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST);
|
|
||||||
|
|
||||||
if (strcmp($host,$_SERVER["SERVER_NAME"])==0){
|
|
||||||
$banner = PostHandler::get("banner");
|
|
||||||
$source = PostHandler::get("source");
|
|
||||||
if (!is_null($banner) && !is_null($source)){
|
|
||||||
AnalyticsHelper::saveBannerClick($banner, $source);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
LoggingFacilityManager::getLogger("gui")->log(LoggingFacility::$LEVEL_INFO,"Dropped statistical data coming from referer '".$host."'");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
LoggingFacilityManager::getLogger("gui")->log(LoggingFacility::$LEVEL_INFO,"Dropped statistical data coming from null referer. Related ip '".$_SERVER['REMOTE_ADDR']."'");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception $ex){
|
|
||||||
LoggingFacilityManager::getLogger("gui")->log(LoggingFacility::$LEVEL_INFO,"Error while logging statistical data. Message: '".$ex->getMessage()."'");
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -4,30 +4,6 @@ Author: Riccardo Di Dato
|
|||||||
Creation Date: 02/mar/2016
|
Creation Date: 02/mar/2016
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once(dirname(__FILE__)."/../../load.php");
|
include(dirname(__FILE__)."/../../stats/bannerImpression.php");
|
||||||
|
|
||||||
try {
|
|
||||||
if (array_key_exists("HTTP_REFERER",$_SERVER)){
|
|
||||||
$host = parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST);
|
|
||||||
|
|
||||||
if (strcmp($host,$_SERVER["SERVER_NAME"])==0){
|
|
||||||
$ip = PostHandler::get("ip");
|
|
||||||
$banner = PostHandler::get("banner");
|
|
||||||
$source = PostHandler::get("source");
|
|
||||||
if (!is_null($ip) && !is_null($banner) && !is_null($source)){
|
|
||||||
AnalyticsHelper::saveBannerImpression($ip, $banner, $source);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
LoggingFacilityManager::getLogger("gui")->log(LoggingFacility::$LEVEL_INFO,"Dropped statistical data coming from referer '".$host."'");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
LoggingFacilityManager::getLogger("gui")->log(LoggingFacility::$LEVEL_INFO,"Dropped statistical data coming from null referer. Related ip '".$_SERVER['REMOTE_ADDR']."'");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception $ex){
|
|
||||||
LoggingFacilityManager::getLogger("gui")->log(LoggingFacility::$LEVEL_INFO,"Error while logging statistical data. Message: '".$ex->getMessage()."'");
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
Author: Riccardo Di Dato
|
||||||
|
Creation Date: 02/mar/2016
|
||||||
|
*/
|
||||||
|
|
||||||
|
include(dirname(__FILE__)."/../../stats/bannerMultiImpression.php");
|
||||||
|
|
||||||
|
?>
|
||||||
@@ -3,31 +3,6 @@
|
|||||||
Author: Riccardo Di Dato
|
Author: Riccardo Di Dato
|
||||||
Creation Date: 28/gen/2016
|
Creation Date: 28/gen/2016
|
||||||
*/
|
*/
|
||||||
|
include(dirname(__FILE__)."/../../stats/notiziaImpression.php");
|
||||||
require_once(dirname(__FILE__)."/../../load.php");
|
|
||||||
|
|
||||||
try {
|
|
||||||
if (array_key_exists("HTTP_REFERER",$_SERVER)){
|
|
||||||
$host = parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST);
|
|
||||||
|
|
||||||
if (strcmp($host,$_SERVER["SERVER_NAME"])==0){
|
|
||||||
$ip = PostHandler::get("ip");
|
|
||||||
$notizia = PostHandler::get("notizia");
|
|
||||||
$source = PostHandler::get("source");
|
|
||||||
if (!is_null($ip) && !is_null($notizia) && !is_null($source)){
|
|
||||||
AnalyticsHelper::saveNotiziaImpression($ip, $notizia, $source);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
LoggingFacilityManager::getLogger("gui")->log(LoggingFacility::$LEVEL_INFO,"Dropped statistical data coming from referer '".$host."'");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
LoggingFacilityManager::getLogger("gui")->log(LoggingFacility::$LEVEL_INFO,"Dropped statistical data coming from null referer. Related ip '".$_SERVER['REMOTE_ADDR']."'");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception $ex){
|
|
||||||
LoggingFacilityManager::getLogger("gui")->log(LoggingFacility::$LEVEL_INFO,"Error while logging statistical data. Message: '".$ex->getMessage()."'");
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -4,30 +4,6 @@ Author: Riccardo Di Dato
|
|||||||
Creation Date: 27/gen/2016
|
Creation Date: 27/gen/2016
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once(dirname(__FILE__)."/../../load.php");
|
include(dirname(__FILE__)."/../../stats/pageImpression.php");
|
||||||
|
|
||||||
try {
|
|
||||||
if (array_key_exists("HTTP_REFERER",$_SERVER)){
|
|
||||||
$host = parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST);
|
|
||||||
|
|
||||||
if (strcmp($host,$_SERVER["SERVER_NAME"])==0){
|
|
||||||
$ip = PostHandler::get("ip");
|
|
||||||
$content = PostHandler::get("content");
|
|
||||||
$source = PostHandler::get("source");
|
|
||||||
if (!is_null($ip) && !is_null($content) && !is_null($source)){
|
|
||||||
AnalyticsHelper::savePageImpression($ip, $content, $source);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
LoggingFacilityManager::getLogger("gui")->log(LoggingFacility::$LEVEL_INFO,"Dropped statistical data coming from referer '".$host."'");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
LoggingFacilityManager::getLogger("gui")->log(LoggingFacility::$LEVEL_INFO,"Dropped statistical data coming from null referer. Related ip '".$_SERVER['REMOTE_ADDR']."'");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception $ex){
|
|
||||||
LoggingFacilityManager::getLogger("gui")->log(LoggingFacility::$LEVEL_INFO,"Error while logging statistical data. Message: '".$ex->getMessage()."'");
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -154,7 +154,7 @@ body{font-family:lato, arial;}
|
|||||||
.headArticolo .newsImage{width:100vw;text-align:center;overflow:hidden;}
|
.headArticolo .newsImage{width:100vw;text-align:center;overflow:hidden;}
|
||||||
.headArticolo .newsImage img{max-width:100%;}
|
.headArticolo .newsImage img{max-width:100%;}
|
||||||
.articoloTitle{width:90%;padding:10px;margin:auto;}
|
.articoloTitle{width:90%;padding:10px;margin:auto;}
|
||||||
.articoloTitle .title{ font-weight:bold; color:black; }
|
.articoloTitle .title{ font-weight:bold; color:black; margin: 0; font-size: 1.8em; }
|
||||||
.articoloTitle .subTitle{font-weight:italic;color:#9a9a9a;}
|
.articoloTitle .subTitle{font-weight:italic;color:#9a9a9a;}
|
||||||
.articoloBody{width:90vw;margin:auto;}
|
.articoloBody{width:90vw;margin:auto;}
|
||||||
.articoloBody .articoloTesto{text-align:justify;padding:5px;}
|
.articoloBody .articoloTesto{text-align:justify;padding:5px;}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ body{font-family:lato, arial;}
|
|||||||
.rightBanner{position:absolute;top:45px;right:10px;}
|
.rightBanner{position:absolute;top:45px;right:10px;}
|
||||||
.topBanner{width:180px;height:60px;}
|
.topBanner{width:180px;height:60px;}
|
||||||
.topBanner > * { max-width:100%; max-height:100%; }
|
.topBanner > * { max-width:100%; max-height:100%; }
|
||||||
.subheadBanner { width:1000px; height:120px; }
|
.subheadBanner { width:1000px; height:150px; }
|
||||||
.footerBanner { width:1000px; height:200px; }
|
.footerBanner { width:1000px; height:200px; }
|
||||||
|
|
||||||
|
|
||||||
@@ -370,7 +370,7 @@ display: inline-block;
|
|||||||
.articoloMainMedia.mediaContent img{max-height:225px;cursor:pointer;}
|
.articoloMainMedia.mediaContent img{max-height:225px;cursor:pointer;}
|
||||||
|
|
||||||
.articoloTitle{display:inline-block;width:550px;padding:0px 20px;vertical-align:top;text-align:left;}
|
.articoloTitle{display:inline-block;width:550px;padding:0px 20px;vertical-align:top;text-align:left;}
|
||||||
.articoloTitle > .title{font-size:20px;font-weight:bold;text-transform:uppercase;font-family:"Arial Bold";}
|
.articoloTitle > .title{font-size:20px;font-weight:bold;text-transform:uppercase;font-family:"Arial Bold"; margin: 0;}
|
||||||
.articoloTitle > .subTitle{font-style:italic;font-family:"Arial Bold";}
|
.articoloTitle > .subTitle{font-style:italic;font-family:"Arial Bold";}
|
||||||
.subTitle > span:first-child{color:rgb(150,150,150);text-transform:none;font-weight:bold;}
|
.subTitle > span:first-child{color:rgb(150,150,150);text-transform:none;font-weight:bold;}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
FROM alpine:3.6
|
||||||
|
|
||||||
|
RUN apk add --no-cache --upgrade bash mongodb-tools
|
||||||
|
|
||||||
|
# copy crontabs for root user
|
||||||
|
COPY crontab /etc/crontabs/root
|
||||||
|
|
||||||
|
# copy backup script
|
||||||
|
COPY backup /myscripts/backup
|
||||||
|
RUN chmod 0744 /myscripts/backup
|
||||||
|
|
||||||
|
# start crond with log level 8 in foreground, output to stderr
|
||||||
|
CMD ["crond", "-f", "-d", "8"]
|
||||||
Executable
+24
@@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
DATE=`date +"%Y-%m-%d_%H:%M"`
|
||||||
|
|
||||||
|
echo "Generating backup $DATE"
|
||||||
|
|
||||||
|
DATABASE_HOST="fdn2.production.database"
|
||||||
|
DATABASE_NAME="fdn2"
|
||||||
|
DATABASE_PORT="27017"
|
||||||
|
WORKDIR="/workdir"
|
||||||
|
STORAGE="/backups"
|
||||||
|
|
||||||
|
mkdir -p $WORKDIR
|
||||||
|
|
||||||
|
mongodump --host $DATABASE_HOST -d $DATABASE_NAME --port $DATABASE_PORT --out "$WORKDIR"
|
||||||
|
|
||||||
|
tar -cvzf "$STORAGE/dump-$DATE.tar.gz" "$WORKDIR"
|
||||||
|
|
||||||
|
for old in `ls -t $STORAGE | tail -n +7`; do
|
||||||
|
TOREMOVE="$STORAGE/$old"
|
||||||
|
echo "Removing '$TOREMOVE'";
|
||||||
|
rm -r $TOREMOVE
|
||||||
|
done
|
||||||
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
4 0 * * * /myscripts/backup 2>&1
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
version: "3"
|
||||||
|
services:
|
||||||
|
backup:
|
||||||
|
image: cronjob
|
||||||
|
build: ./
|
||||||
|
networks:
|
||||||
|
- backup-network
|
||||||
|
restart: "unless-stopped"
|
||||||
|
volumes:
|
||||||
|
- /home/ddninja/fdn2/backups:/backups
|
||||||
|
|
||||||
|
|
||||||
|
networks:
|
||||||
|
backup-network:
|
||||||
|
external: true
|
||||||
|
name:
|
||||||
|
backup-network
|
||||||
@@ -5,8 +5,11 @@ services:
|
|||||||
restart: "on-failure:5"
|
restart: "on-failure:5"
|
||||||
networks:
|
networks:
|
||||||
db-network:
|
db-network:
|
||||||
|
backup-network:
|
||||||
|
aliases:
|
||||||
|
- §PROJECT_BUILDNAME§.§ENVIRONMENT_TYPE§.database
|
||||||
volumes:
|
volumes:
|
||||||
- ./persistence/database/mongodb:/usr/local/mongodb
|
- ./persistence/database/mongodb:/data/db/
|
||||||
logging:
|
logging:
|
||||||
driver: "json-file"
|
driver: "json-file"
|
||||||
options:
|
options:
|
||||||
@@ -30,7 +33,7 @@ services:
|
|||||||
links:
|
links:
|
||||||
- mongo:database
|
- mongo:database
|
||||||
volumes:
|
volumes:
|
||||||
- ./persistence/webserver/storage:/home/§PROJECT_AUTHOR§/storage/§PROJECT_BUILDNAME§
|
- ./persistence/storage:/home/§PROJECT_AUTHOR§/storage/§PROJECT_BUILDNAME§
|
||||||
- §PROJECT_BUILDNAME§-ws-log:/var/log/§PROJECT_AUTHOR§/
|
- §PROJECT_BUILDNAME§-ws-log:/var/log/§PROJECT_AUTHOR§/
|
||||||
- §PROJECT_BUILDNAME§-job-comms:/jobComunication/
|
- §PROJECT_BUILDNAME§-job-comms:/jobComunication/
|
||||||
logging:
|
logging:
|
||||||
@@ -38,23 +41,32 @@ services:
|
|||||||
options:
|
options:
|
||||||
max-file: "5"
|
max-file: "5"
|
||||||
max-size: "150m"
|
max-size: "150m"
|
||||||
# worker:
|
worker:
|
||||||
# image: 662348923997.dkr.ecr.eu-west-1.amazonaws.com/§PROJECT_GROUP§/edenlandia-worker:§TAG_NAME§
|
image: §PROJECT_REPOSITORY§/§PROJECT_GROUP§/§PROJECT_BUILDNAME§:§TAG_NAME§-worker
|
||||||
# env_file: worker.env
|
env_file:
|
||||||
# restart: "no"
|
- environments/common/worker.env
|
||||||
# networks:
|
- environments/§ENVIRONMENT_TYPE§/worker.env
|
||||||
# db-network:
|
depends_on:
|
||||||
# §PROJECT_BUILDNAME§-network:
|
- mongo
|
||||||
# links:
|
- memcached
|
||||||
# - mongo:database
|
restart: "on-failure:3"
|
||||||
# volumes:
|
networks:
|
||||||
# - §PROJECT_BUILDNAME§-storage:/home/asdynamics/storage/edenlandia-worker
|
db-network:
|
||||||
# - edenlandia-worker-log:/var/log/asdynamics/
|
§PROJECT_BUILDNAME§-network:
|
||||||
# - ~/workspace-azzurro/webapps/edenlandia-worker/app/private:/home/asdynamics/private/§PROJECT_BUILDNAME§:ro
|
links:
|
||||||
# - §PROJECT_BUILDNAME§-job-comms:/jobComunication/
|
- mongo:database
|
||||||
|
volumes:
|
||||||
|
- ./persistence/storage:/home/§PROJECT_AUTHOR§/storage/§PROJECT_BUILDNAME§
|
||||||
|
- §PROJECT_BUILDNAME§-wk-log:/var/log/§PROJECT_AUTHOR§/
|
||||||
|
- §PROJECT_BUILDNAME§-job-comms:/jobComunication/
|
||||||
|
logging:
|
||||||
|
driver: "json-file"
|
||||||
|
options:
|
||||||
|
max-file: "5"
|
||||||
|
max-size: "150m"
|
||||||
memcached:
|
memcached:
|
||||||
image: memcached:1.6.9-alpine
|
image: memcached:1.6.9-alpine
|
||||||
restart: "on-failure:3"
|
restart: "on-failure:5"
|
||||||
networks:
|
networks:
|
||||||
§PROJECT_BUILDNAME§-network:
|
§PROJECT_BUILDNAME§-network:
|
||||||
logging:
|
logging:
|
||||||
@@ -66,6 +78,10 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
db-network:
|
db-network:
|
||||||
§PROJECT_BUILDNAME§-network:
|
§PROJECT_BUILDNAME§-network:
|
||||||
|
backup-network:
|
||||||
|
external: true
|
||||||
|
name:
|
||||||
|
backup-network
|
||||||
nginx-network:
|
nginx-network:
|
||||||
external: true
|
external: true
|
||||||
name:
|
name:
|
||||||
@@ -74,5 +90,7 @@ networks:
|
|||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
§PROJECT_BUILDNAME§-ws-log:
|
§PROJECT_BUILDNAME§-ws-log:
|
||||||
|
§PROJECT_BUILDNAME§-wk-log:
|
||||||
§PROJECT_BUILDNAME§-db-persist:
|
§PROJECT_BUILDNAME§-db-persist:
|
||||||
§PROJECT_BUILDNAME§-job-comms:
|
§PROJECT_BUILDNAME§-job-comms:
|
||||||
|
|
||||||
@@ -5,12 +5,13 @@ services:
|
|||||||
restart: "no"
|
restart: "no"
|
||||||
networks:
|
networks:
|
||||||
db-network:
|
db-network:
|
||||||
|
backup-network:
|
||||||
aliases:
|
aliases:
|
||||||
- §PROJECT_BUILDNAME§.§ENVIRONMENT_TYPE§.database
|
- §PROJECT_BUILDNAME§.local.database
|
||||||
volumes:
|
volumes:
|
||||||
- §PROJECT_BUILDNAME§-db-persist:/usr/local/mongodb
|
- §PROJECT_BUILDNAME§-db-persist:/data/db/
|
||||||
webserver:
|
webserver:
|
||||||
image: §PROJECT_REPOSITORY§/§PROJECT_GROUP§/§PROJECT_BUILDNAME§:§TAG_NAME§-debug
|
image: §PROJECT_REPOSITORY§/§PROJECT_GROUP§/§PROJECT_BUILDNAME§:§TAG_NAME§-webserver-debug
|
||||||
env_file:
|
env_file:
|
||||||
- environments/common/webserver.env
|
- environments/common/webserver.env
|
||||||
- environments/local/webserver.env
|
- environments/local/webserver.env
|
||||||
@@ -28,20 +29,22 @@ services:
|
|||||||
- §DEBUG_HOST_PROJECT_FOLDER§/app/public:/var/www/§PROJECT_BUILDNAME§:ro
|
- §DEBUG_HOST_PROJECT_FOLDER§/app/public:/var/www/§PROJECT_BUILDNAME§:ro
|
||||||
- §DEBUG_HOST_PROJECT_FOLDER§/app/private:/home/§PROJECT_AUTHOR§/private/§PROJECT_BUILDNAME§:ro
|
- §DEBUG_HOST_PROJECT_FOLDER§/app/private:/home/§PROJECT_AUTHOR§/private/§PROJECT_BUILDNAME§:ro
|
||||||
- §PROJECT_BUILDNAME§-job-comms:/jobComunication/
|
- §PROJECT_BUILDNAME§-job-comms:/jobComunication/
|
||||||
# worker:
|
worker:
|
||||||
# image: 662348923997.dkr.ecr.eu-west-1.amazonaws.com/§PROJECT_GROUP§/edenlandia-worker:§TAG_NAME§
|
image: §PROJECT_REPOSITORY§/§PROJECT_GROUP§/§PROJECT_BUILDNAME§:§TAG_NAME§-worker-debug
|
||||||
# env_file: worker.env
|
env_file:
|
||||||
# restart: "no"
|
- environments/common/worker.env
|
||||||
# networks:
|
- environments/local/worker.env
|
||||||
# db-network:
|
restart: "no"
|
||||||
# §PROJECT_BUILDNAME§-network:
|
networks:
|
||||||
# links:
|
db-network:
|
||||||
# - mongo:database
|
§PROJECT_BUILDNAME§-network:
|
||||||
# volumes:
|
links:
|
||||||
# - §PROJECT_BUILDNAME§-storage:/home/asdynamics/storage/edenlandia-worker
|
- mongo:database
|
||||||
# - edenlandia-worker-log:/var/log/asdynamics/
|
volumes:
|
||||||
# - ~/workspace-azzurro/webapps/edenlandia-worker/app/private:/home/asdynamics/private/§PROJECT_BUILDNAME§:ro
|
- §PROJECT_BUILDNAME§-storage:/home/§PROJECT_AUTHOR§/storage/§PROJECT_BUILDNAME§
|
||||||
# - §PROJECT_BUILDNAME§-job-comms:/jobComunication/
|
- ./worker-logs:/var/log/§PROJECT_AUTHOR§/
|
||||||
|
- §DEBUG_HOST_PROJECT_FOLDER§/app/private:/home/§PROJECT_AUTHOR§/private/§PROJECT_BUILDNAME§:ro
|
||||||
|
- §PROJECT_BUILDNAME§-job-comms:/jobComunication/
|
||||||
memcached:
|
memcached:
|
||||||
image: memcached:1.6.9-alpine
|
image: memcached:1.6.9-alpine
|
||||||
restart: "no"
|
restart: "no"
|
||||||
@@ -51,11 +54,14 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
db-network:
|
db-network:
|
||||||
§PROJECT_BUILDNAME§-network:
|
§PROJECT_BUILDNAME§-network:
|
||||||
|
backup-network:
|
||||||
|
external: true
|
||||||
|
name:
|
||||||
|
backup-network
|
||||||
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
§PROJECT_BUILDNAME§-storage:
|
§PROJECT_BUILDNAME§-storage:
|
||||||
§PROJECT_BUILDNAME§-log:
|
§PROJECT_BUILDNAME§-log:
|
||||||
# edenlandia-worker-log:
|
|
||||||
§PROJECT_BUILDNAME§-db-persist:
|
§PROJECT_BUILDNAME§-db-persist:
|
||||||
§PROJECT_BUILDNAME§-job-comms:
|
§PROJECT_BUILDNAME§-job-comms:
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
# Use a PHP runtime as a parent image
|
# Use a PHP runtime as a parent image
|
||||||
FROM §FRAMEWORK_REPOSITORY§/§FRAMEWORK_IMAGE§:§FRAMEWORK_VERSION§-§FRAMEWORK_TYPE§
|
FROM §FRAMEWORK_REPOSITORY§/§FRAMEWORK_IMAGE§:§FRAMEWORK_VERSION§-webserver
|
||||||
|
|
||||||
# Set the working directory to /app
|
# Set the working directory to /app
|
||||||
WORKDIR /§PROJECT_BUILDNAME§
|
WORKDIR /§PROJECT_BUILDNAME§
|
||||||
@@ -27,7 +27,7 @@ COPY ./install /§PROJECT_BUILDNAME§
|
|||||||
|
|
||||||
RUN chmod 744 /§PROJECT_BUILDNAME§/install
|
RUN chmod 744 /§PROJECT_BUILDNAME§/install
|
||||||
|
|
||||||
RUN /§PROJECT_BUILDNAME§/install
|
RUN /§PROJECT_BUILDNAME§/install webserver
|
||||||
|
|
||||||
|
|
||||||
ENTRYPOINT ["§PROJECT_BUILDNAME§-entrypoint"]
|
ENTRYPOINT ["§PROJECT_BUILDNAME§-entrypoint"]
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Use a PHP runtime as a parent image
|
# Use a PHP runtime as a parent image
|
||||||
FROM §FRAMEWORK_REPOSITORY§/§FRAMEWORK_IMAGE§:§FRAMEWORK_VERSION§-§FRAMEWORK_TYPE§
|
FROM §FRAMEWORK_REPOSITORY§/§FRAMEWORK_IMAGE§:§FRAMEWORK_VERSION§-webserver
|
||||||
|
|
||||||
# Set the working directory to /app
|
# Set the working directory to /app
|
||||||
WORKDIR /§PROJECT_BUILDNAME§
|
WORKDIR /§PROJECT_BUILDNAME§
|
||||||
@@ -27,7 +27,7 @@ COPY ./install /§PROJECT_BUILDNAME§
|
|||||||
|
|
||||||
RUN chmod 744 /§PROJECT_BUILDNAME§/install
|
RUN chmod 744 /§PROJECT_BUILDNAME§/install
|
||||||
|
|
||||||
RUN /§PROJECT_BUILDNAME§/install
|
RUN /§PROJECT_BUILDNAME§/install webserver
|
||||||
|
|
||||||
ENTRYPOINT ["§PROJECT_BUILDNAME§-entrypoint"]
|
ENTRYPOINT ["§PROJECT_BUILDNAME§-entrypoint"]
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM §FRAMEWORK_REPOSITORY§/§FRAMEWORK_IMAGE§:§FRAMEWORK_VERSION§-§FRAMEWORK_TYPE§-unit
|
FROM §FRAMEWORK_REPOSITORY§/§FRAMEWORK_IMAGE§:§FRAMEWORK_VERSION§-webserver-unit
|
||||||
|
|
||||||
WORKDIR /§PROJECT_BUILDNAME§
|
WORKDIR /§PROJECT_BUILDNAME§
|
||||||
COPY ./app /§PROJECT_BUILDNAME§
|
COPY ./app /§PROJECT_BUILDNAME§
|
||||||
@@ -9,7 +9,7 @@ COPY ./test/install /§PROJECT_BUILDNAME§
|
|||||||
|
|
||||||
RUN chmod 744 /§PROJECT_BUILDNAME§/install
|
RUN chmod 744 /§PROJECT_BUILDNAME§/install
|
||||||
|
|
||||||
RUN /§PROJECT_BUILDNAME§/install
|
RUN /§PROJECT_BUILDNAME§/install webserver
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/local/bin/phpunit"]
|
ENTRYPOINT ["/usr/local/bin/phpunit"]
|
||||||
CMD ["--help"]
|
CMD ["--help"]
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Use a PHP runtime as a parent image
|
# Use a PHP runtime as a parent image
|
||||||
FROM §FRAMEWORK_REPOSITORY§/§FRAMEWORK_IMAGE§:§FRAMEWORK_VERSION§-§FRAMEWORK_TYPE§
|
FROM §FRAMEWORK_REPOSITORY§/§FRAMEWORK_IMAGE§:§FRAMEWORK_VERSION§-worker
|
||||||
|
|
||||||
# Set the working directory to /app
|
# Set the working directory to /app
|
||||||
WORKDIR /§PROJECT_BUILDNAME§
|
WORKDIR /§PROJECT_BUILDNAME§
|
||||||
@@ -27,7 +27,7 @@ COPY ./install /§PROJECT_BUILDNAME§
|
|||||||
|
|
||||||
RUN chmod 744 /§PROJECT_BUILDNAME§/install
|
RUN chmod 744 /§PROJECT_BUILDNAME§/install
|
||||||
|
|
||||||
RUN /§PROJECT_BUILDNAME§/install
|
RUN /§PROJECT_BUILDNAME§/install worker
|
||||||
|
|
||||||
|
|
||||||
ENTRYPOINT ["§PROJECT_BUILDNAME§-entrypoint"]
|
ENTRYPOINT ["§PROJECT_BUILDNAME§-entrypoint"]
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Use a PHP runtime as a parent image
|
# Use a PHP runtime as a parent image
|
||||||
FROM §FRAMEWORK_REPOSITORY§/§FRAMEWORK_IMAGE§:§FRAMEWORK_VERSION§-§FRAMEWORK_TYPE§
|
FROM §FRAMEWORK_REPOSITORY§/§FRAMEWORK_IMAGE§:§FRAMEWORK_VERSION§-worker
|
||||||
|
|
||||||
# Set the working directory to /app
|
# Set the working directory to /app
|
||||||
WORKDIR /§PROJECT_BUILDNAME§
|
WORKDIR /§PROJECT_BUILDNAME§
|
||||||
@@ -27,7 +27,7 @@ COPY ./install /§PROJECT_BUILDNAME§
|
|||||||
|
|
||||||
RUN chmod 744 /§PROJECT_BUILDNAME§/install
|
RUN chmod 744 /§PROJECT_BUILDNAME§/install
|
||||||
|
|
||||||
RUN /§PROJECT_BUILDNAME§/install
|
RUN /§PROJECT_BUILDNAME§/install worker
|
||||||
|
|
||||||
ENTRYPOINT ["§PROJECT_BUILDNAME§-entrypoint"]
|
ENTRYPOINT ["§PROJECT_BUILDNAME§-entrypoint"]
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM §FRAMEWORK_REPOSITORY§/§FRAMEWORK_IMAGE§:§FRAMEWORK_VERSION§-§FRAMEWORK_TYPE§-unit
|
FROM §FRAMEWORK_REPOSITORY§/§FRAMEWORK_IMAGE§:§FRAMEWORK_VERSION§-worker-unit
|
||||||
|
|
||||||
WORKDIR /§PROJECT_BUILDNAME§
|
WORKDIR /§PROJECT_BUILDNAME§
|
||||||
COPY ./app /§PROJECT_BUILDNAME§
|
COPY ./app /§PROJECT_BUILDNAME§
|
||||||
@@ -9,7 +9,7 @@ COPY ./test/install /§PROJECT_BUILDNAME§
|
|||||||
|
|
||||||
RUN chmod 744 /§PROJECT_BUILDNAME§/install
|
RUN chmod 744 /§PROJECT_BUILDNAME§/install
|
||||||
|
|
||||||
RUN /§PROJECT_BUILDNAME§/install
|
RUN /§PROJECT_BUILDNAME§/install worker
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/local/bin/phpunit"]
|
ENTRYPOINT ["/usr/local/bin/phpunit"]
|
||||||
CMD ["--help"]
|
CMD ["--help"]
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
DDNINJA_PROJECTNAME=FDN2
|
||||||
|
DDNINJA_BUILDNAME=fdn2
|
||||||
|
DDNINJA_AUTHOR=ddninja
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
DDNINJA_ENVIRONMENT_NAME=local
|
||||||
|
DDNINJA_IS_PRODUCTION=false
|
||||||
|
|
||||||
|
DDNINJA_MONGO_DBNAME=fdn2
|
||||||
|
DDNINJA_MONGO_LOCATION=database
|
||||||
|
|
||||||
|
DDNINJA_PUBLIC_URL=http://www.fdn2.loc:8800
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
DDNINJA_ENVIRONMENT_NAME=production
|
||||||
|
DDNINJA_IS_PRODUCTION=true
|
||||||
|
|
||||||
|
DDNINJA_MONGO_DBNAME=fdn2
|
||||||
|
DDNINJA_MONGO_LOCATION=database
|
||||||
|
|
||||||
|
DDNINJA_PUBLIC_URL=http://preproduction.ifattidinapoli.it
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
DDNINJA_ENVIRONMENT_NAME=test
|
||||||
|
DDNINJA_IS_PRODUCTION=false
|
||||||
|
|
||||||
|
DDNINJA_MONGO_DBNAME=fdn2_test
|
||||||
|
DDNINJA_MONGO_LOCATION=database
|
||||||
|
|
||||||
|
DDNINJA_PUBLIC_URL=http://test.ifattidinapoli.it
|
||||||
@@ -4,7 +4,6 @@ declare -A CONFIG=(
|
|||||||
["FRAMEWORK_REPOSITORY"]="299952237278.dkr.ecr.eu-west-1.amazonaws.com"
|
["FRAMEWORK_REPOSITORY"]="299952237278.dkr.ecr.eu-west-1.amazonaws.com"
|
||||||
["FRAMEWORK_IMAGE"]="ddninja/phpframework"
|
["FRAMEWORK_IMAGE"]="ddninja/phpframework"
|
||||||
["FRAMEWORK_VERSION"]="2.5.4"
|
["FRAMEWORK_VERSION"]="2.5.4"
|
||||||
["FRAMEWORK_TYPE"]="webserver"
|
|
||||||
["FRAMEWORK_AUTHOR"]="ddninja"
|
["FRAMEWORK_AUTHOR"]="ddninja"
|
||||||
|
|
||||||
["PROJECT_REPOSITORY"]="299952237278.dkr.ecr.eu-west-1.amazonaws.com"
|
["PROJECT_REPOSITORY"]="299952237278.dkr.ecr.eu-west-1.amazonaws.com"
|
||||||
@@ -23,7 +22,6 @@ declare -A CONFIG=(
|
|||||||
FRAMEWORK_REPOSITORY=${CONFIG['FRAMEWORK_REPOSITORY']}
|
FRAMEWORK_REPOSITORY=${CONFIG['FRAMEWORK_REPOSITORY']}
|
||||||
FRAMEWORK_IMAGE=${CONFIG['FRAMEWORK_IMAGE']}
|
FRAMEWORK_IMAGE=${CONFIG['FRAMEWORK_IMAGE']}
|
||||||
FRAMEWORK_VERSION=${CONFIG['FRAMEWORK_VERSION']}
|
FRAMEWORK_VERSION=${CONFIG['FRAMEWORK_VERSION']}
|
||||||
FRAMEWORK_TYPE=${CONFIG['FRAMEWORK_TYPE']}
|
|
||||||
FRAMEWORK_AUTHOR=${CONFIG['FRAMEWORK_AUTHOR']}
|
FRAMEWORK_AUTHOR=${CONFIG['FRAMEWORK_AUTHOR']}
|
||||||
|
|
||||||
PROJECT_REPOSITORY=${CONFIG['PROJECT_REPOSITORY']}
|
PROJECT_REPOSITORY=${CONFIG['PROJECT_REPOSITORY']}
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ "$#" -ne 1 ]; then
|
||||||
|
echo "Illegal number of parameters"
|
||||||
|
fi
|
||||||
|
|
||||||
|
TYPE=$1
|
||||||
|
|
||||||
my_dir="$(dirname "$0")"
|
my_dir="$(dirname "$0")"
|
||||||
DIR_RETURN=`pwd`
|
DIR_RETURN=`pwd`
|
||||||
|
|
||||||
@@ -25,11 +31,13 @@ chown -R www-data:www-data /var/log/$PROJECT_AUTHOR
|
|||||||
chmod 0744 /home/$PROJECT_AUTHOR/private/$PROJECT_BUILDNAME/bin/*
|
chmod 0744 /home/$PROJECT_AUTHOR/private/$PROJECT_BUILDNAME/bin/*
|
||||||
|
|
||||||
# Apache
|
# Apache
|
||||||
cat ./os/000-${PROJECT_TYPE}.template.conf |
|
if [[ $TYPE == "webserver" ]]; then
|
||||||
sed -e "s/§PROJECT_BUILDNAME§/${PROJECT_BUILDNAME}/g" \
|
cat ./os/000-${PROJECT_TYPE}.template.conf |
|
||||||
> /etc/apache2/sites-available/000-default.conf
|
sed -e "s/§PROJECT_BUILDNAME§/${PROJECT_BUILDNAME}/g" \
|
||||||
|
> /etc/apache2/sites-available/000-default.conf
|
||||||
|
|
||||||
a2enmod rewrite
|
a2enmod rewrite
|
||||||
|
fi
|
||||||
|
|
||||||
# Overwrite opcache default config
|
# Overwrite opcache default config
|
||||||
cat ./os/opcache.template.ini |
|
cat ./os/opcache.template.ini |
|
||||||
@@ -40,7 +48,7 @@ cat ./os/opcache.template.ini |
|
|||||||
cat ./os/php.template.ini > /usr/local/etc/php/php.ini
|
cat ./os/php.template.ini > /usr/local/etc/php/php.ini
|
||||||
|
|
||||||
# Generate Entrypoint
|
# Generate Entrypoint
|
||||||
cp "./os/webserver-entrypoint" "/usr/local/bin/$PROJECT_BUILDNAME-entrypoint"
|
cp "./os/${TYPE}-entrypoint" "/usr/local/bin/$PROJECT_BUILDNAME-entrypoint"
|
||||||
chmod 0744 /usr/local/bin/$PROJECT_BUILDNAME-entrypoint
|
chmod 0744 /usr/local/bin/$PROJECT_BUILDNAME-entrypoint
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
#!/usr/bin/php
|
|
||||||
<?php
|
|
||||||
require_once(dirname(__FILE__). "/../load.php");
|
|
||||||
|
|
||||||
// try {
|
|
||||||
|
|
||||||
// }
|
|
||||||
// catch (UNHADBException $unex){
|
|
||||||
// $msg = $application->core->loggingCatalogManager->getCatalog($unex->getMessage(),$unex->getData());
|
|
||||||
// LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,"log.task.errorWhileExecutingTask",array("ProcessMailQueue.php",$msg),true);
|
|
||||||
// }
|
|
||||||
// catch (Exception $ex){
|
|
||||||
// $msg = $application->core->loggingCatalogManager->getCatalog($ex->getMessage());
|
|
||||||
// LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,"log.task.errorWhileExecutingTask",array("ProcessMailQueue.php",$msg),true);
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
#!/usr/bin/php
|
|
||||||
<?php
|
|
||||||
require_once(dirname(__FILE__). "/../load.php");
|
|
||||||
|
|
||||||
$tasks = array("SendBackupTask");
|
|
||||||
|
|
||||||
if (sizeof($tasks)>0){
|
|
||||||
foreach ($tasks as $taskName){
|
|
||||||
try {
|
|
||||||
if ($taskName::isActive()){
|
|
||||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_INFO,"Executing task '".$taskName::getLabel()."' ");
|
|
||||||
$taskName::execute();
|
|
||||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_INFO,"Task '".$taskName::getLabel()."' completed successfully");
|
|
||||||
}
|
|
||||||
}catch (CoreException $ex){
|
|
||||||
$msg = "Error while executing task '".$taskName::getLabel()."' with message '".$ex->getMessage()."'";
|
|
||||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,$msg);
|
|
||||||
}
|
|
||||||
catch (Exception $ex){
|
|
||||||
$msg = "Unexpected error while executing task '".$taskName::getLabel()."' with message '".$ex->getMessage()."'";
|
|
||||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,$msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// try {
|
|
||||||
|
|
||||||
|
|
||||||
// }catch (UNHADBException $unex){
|
|
||||||
// $msg = $application->core->loggingCatalogManager->getCatalog($unex->getMessage(),$unex->getData());
|
|
||||||
// LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,"log.task.errorWhileExecutingTask",array("ProcessMailQueue.php",$msg),true);
|
|
||||||
// }
|
|
||||||
// catch (Exception $ex){
|
|
||||||
// $msg = $application->core->loggingCatalogManager->getCatalog($ex->getMessage());
|
|
||||||
// LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,"log.task.errorWhileExecutingTask",array("ProcessMailQueue.php",$msg),true);
|
|
||||||
// }
|
|
||||||
|
|
||||||
?>
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
#!/usr/bin/php
|
|
||||||
<?php
|
|
||||||
require_once(dirname(__FILE__). "/../load.php");
|
|
||||||
|
|
||||||
$tasks = array("NewsletterCheckTask","DeleteOldPasswordResetRequestsTask", "UpdateMeteoCacheTask", "GenerateCommentiWarningMailTask");
|
|
||||||
|
|
||||||
if (sizeof($tasks)>0){
|
|
||||||
foreach ($tasks as $taskName){
|
|
||||||
try {
|
|
||||||
if ($taskName::isActive()){
|
|
||||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_INFO,"Executing task '".$taskName::getLabel()."' ");
|
|
||||||
$taskName::execute();
|
|
||||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_INFO,"Task '".$taskName::getLabel()."' completed successfully");
|
|
||||||
}
|
|
||||||
}catch (CoreException $ex){
|
|
||||||
$msg = "Error while executing task '".$taskName::getLabel()."' with message '".$ex->getMessage()."'";
|
|
||||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,$msg);
|
|
||||||
}
|
|
||||||
catch (Exception $ex){
|
|
||||||
$msg = "Unexpected error while executing task '".$taskName::getLabel()."' with message '".$ex->getMessage()."'";
|
|
||||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,$msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// try {
|
|
||||||
// SystemController::executeTask("RefreshApiCache.php");
|
|
||||||
// }
|
|
||||||
// catch (UNHADBException $unex){
|
|
||||||
// $msg = $application->core->loggingCatalogManager->getCatalog($unex->getMessage(),$unex->getData());
|
|
||||||
// LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,"log.task.errorWhileExecutingTask",array("GenerateReminderMail.php",$msg),true);
|
|
||||||
|
|
||||||
// }
|
|
||||||
// catch (Exception $ex){
|
|
||||||
// $msg = $application->core->loggingCatalogManager->getCatalog($ex->getMessage());
|
|
||||||
// LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,"log.task.errorWhileExecutingTask",array("GenerateReminderMail.php",$msg),true);
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
?>
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
#!/usr/bin/php
|
|
||||||
<?php
|
|
||||||
/*
|
|
||||||
Author: Riccardo Di Dato
|
|
||||||
Creation Date: 12/gen/2016
|
|
||||||
*/
|
|
||||||
|
|
||||||
require_once(dirname(__FILE__). "/../load.php");
|
|
||||||
|
|
||||||
$tasks = array(
|
|
||||||
"GenerateAdminActivationMailTask",
|
|
||||||
"GenerateUserActivationMailTask",
|
|
||||||
"GenerateAdminPasswordRecoveryMailTask",
|
|
||||||
"GenerateUserPasswordRecoveryMailTask",
|
|
||||||
"MailSendTask",
|
|
||||||
);
|
|
||||||
|
|
||||||
if (sizeof($tasks)>0){
|
|
||||||
foreach ($tasks as $taskName){
|
|
||||||
try {
|
|
||||||
if ($taskName::isActive()){
|
|
||||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_INFO,"Executing task '".$taskName::getLabel()."' ");
|
|
||||||
$taskName::execute();
|
|
||||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_INFO,"Task '".$taskName::getLabel()."' completed successfully");
|
|
||||||
}
|
|
||||||
}catch (CoreException $ex){
|
|
||||||
$msg = "Error while executing task '".$taskName::getLabel()."' with message '".$ex->getMessage()."'";
|
|
||||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,$msg);
|
|
||||||
}
|
|
||||||
catch (Exception $ex){
|
|
||||||
$msg = "Unexpected error while executing task '".$taskName::getLabel()."' with message '".$ex->getMessage()."'";
|
|
||||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,$msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
#!/usr/bin/php
|
|
||||||
<?php
|
|
||||||
require_once(dirname(__FILE__). "/../load.php");
|
|
||||||
|
|
||||||
?>
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
#!/usr/bin/php
|
|
||||||
<?php
|
|
||||||
require_once(dirname(__FILE__). "/../load.php");
|
|
||||||
|
|
||||||
// try {
|
|
||||||
|
|
||||||
// }catch (UNHADBException $unex){
|
|
||||||
// $msg = $application->core->loggingCatalogManager->getCatalog($unex->getMessage(),$unex->getData());
|
|
||||||
// LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,"log.task.errorWhileExecutingTask",array("ProcessMailQueue.php",$msg),true);
|
|
||||||
// }
|
|
||||||
// catch (Exception $ex){
|
|
||||||
// $msg = $application->core->loggingCatalogManager->getCatalog($ex->getMessage());
|
|
||||||
// LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,"log.task.errorWhileExecutingTask",array("ProcessMailQueue.php",$msg),true);
|
|
||||||
// }
|
|
||||||
|
|
||||||
?>
|
|
||||||
+2
-2
@@ -97,7 +97,7 @@ if [[ $UNIT_MODE -gt 0 ]]; then
|
|||||||
OPTS+="v"
|
OPTS+="v"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$DIR/generateDockerfile.sh -$OPTS -o $DOCKERFILE
|
$DIR/generateDockerfile.sh -I "${TYPE}" -$OPTS -o $DOCKERFILE
|
||||||
|
|
||||||
msg "Building project image $TAG"
|
msg "Building project image $TAG"
|
||||||
docker build -t $PROJECT_REPOSITORY/$PROJECT_GROUP/$PROJECT_BUILDNAME:$TAG-unit -f $DOCKERFILE .
|
docker build -t $PROJECT_REPOSITORY/$PROJECT_GROUP/$PROJECT_BUILDNAME:$TAG-unit -f $DOCKERFILE .
|
||||||
@@ -112,7 +112,7 @@ if [[ $DEBUG_MODE -gt 0 ]]; then
|
|||||||
OPTS+="v"
|
OPTS+="v"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$DIR/generateDockerfile.sh -$OPTS -o $DOCKERFILE
|
$DIR/generateDockerfile.sh -I "${TYPE}" -$OPTS -o $DOCKERFILE
|
||||||
|
|
||||||
msg "Building project image $TAG"
|
msg "Building project image $TAG"
|
||||||
docker build -t $PROJECT_REPOSITORY/$PROJECT_GROUP/$PROJECT_BUILDNAME:$TAG-debug -f $DOCKERFILE .
|
docker build -t $PROJECT_REPOSITORY/$PROJECT_GROUP/$PROJECT_BUILDNAME:$TAG-debug -f $DOCKERFILE .
|
||||||
|
|||||||
+17
-5
@@ -125,10 +125,14 @@ if [[ $UNIT_MODE -eq 1 ]]; then
|
|||||||
BUILDOPT+="v"
|
BUILDOPT+="v"
|
||||||
UNITOPT="-v"
|
UNITOPT="-v"
|
||||||
fi
|
fi
|
||||||
msg "running ./build.sh -$BUILDOPT -t $TAG"
|
msg "running ./build.sh -I webserver -$BUILDOPT -t \"$TAG-webserver\""
|
||||||
./build.sh -$BUILDOPT -t $TAG
|
./build.sh -I webserver -$BUILDOPT -t "$TAG-webserver"
|
||||||
|
|
||||||
./run-unit.sh $UNITOPT -t $TAG
|
msg "running ./build.sh -I worker -$BUILDOPT -t \"$TAG-worker\""
|
||||||
|
./build.sh -I worker -$BUILDOPT -t "$TAG-worker"
|
||||||
|
|
||||||
|
./run-unit.sh $UNITOPT -t $TAG-webserver
|
||||||
|
./run-unit.sh $UNITOPT -t $TAG-worker
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $PUBLISH_MODE -eq 1 ]]; then
|
if [[ $PUBLISH_MODE -eq 1 ]]; then
|
||||||
@@ -151,7 +155,13 @@ if [[ $PUBLISH_MODE -eq 1 ]]; then
|
|||||||
|
|
||||||
./publish.sh $VERBOPT -t "$TAG-webserver"
|
./publish.sh $VERBOPT -t "$TAG-webserver"
|
||||||
|
|
||||||
|
# WORKER
|
||||||
|
msg "running ./build.sh -I worker -$BUILDOPT -t $TAG-worker"
|
||||||
|
./build.sh -I worker -$BUILDOPT -t "$TAG-worker"
|
||||||
|
|
||||||
|
./run-unit.sh $VERBOPT -t "$TAG-worker"
|
||||||
|
|
||||||
|
./publish.sh $VERBOPT -t "$TAG-worker"
|
||||||
|
|
||||||
if [[ $TAG_IMPLICIT -ne 1 ]]; then
|
if [[ $TAG_IMPLICIT -ne 1 ]]; then
|
||||||
git tag $TAG
|
git tag $TAG
|
||||||
@@ -165,8 +175,10 @@ if [[ $DEBUG_MODE -eq 1 ]]; then
|
|||||||
if [[ $VERBOSE -gt 0 ]]; then
|
if [[ $VERBOSE -gt 0 ]]; then
|
||||||
BUILDOPT+="v"
|
BUILDOPT+="v"
|
||||||
fi
|
fi
|
||||||
msg "running ./build.sh -$BUILDOPT -t $TAG"
|
msg "running ./build.sh -I webserver -$BUILDOPT -t $TAG-webserver"
|
||||||
./build.sh -$BUILDOPT -t $TAG
|
./build.sh -$BUILDOPT -I webserver -t $TAG-webserver
|
||||||
|
msg "running ./build.sh -I worker -$BUILDOPT -t $TAG-worker"
|
||||||
|
./build.sh -$BUILDOPT -I worker -t $TAG-worker
|
||||||
|
|
||||||
OUT_FOLDER="/home/$PROJECT_AUTHOR/$PROJECT_BUILDNAME/local"
|
OUT_FOLDER="/home/$PROJECT_AUTHOR/$PROJECT_BUILDNAME/local"
|
||||||
mkdir -p $OUT_FOLDER
|
mkdir -p $OUT_FOLDER
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
git pull --quiet
|
git pull --quiet
|
||||||
git tag -l --sort=-version:refname | head -n 1
|
git tag | tr - \~ | sort -V | tr \~ - | tail -n 1
|
||||||
Reference in New Issue
Block a user