diff --git a/Dockerfile b/Dockerfile index 188dfe9..d001c34 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM php:7-apache AS builder -ARG COMPOSER=composer-es2x.json +ARG COMPOSER=composer-es7x.json WORKDIR /app RUN apt-get update && \ @@ -74,6 +74,11 @@ RUN ln -sf /data/411.conf /etc/apache2/sites-available/000-default.conf RUN ln -sf /data/mail.ini /usr/local/etc/php/conf.d/ RUN ln -sf /data/411_cron /etc/cron.d/ +RUN cp /etc/exim4/passwd.client /data/passwd.client +RUN cp /etc/exim4/update-exim4.conf.conf /data/update-exim4.conf.conf +RUN ln -sf /data/passwd.client /etc/exim4/passwd.client +RUN ln -sf /data/update-exim4.conf.conf /etc/exim4/update-exim4.conf.conf + VOLUME /data EXPOSE 80 CMD ["/usr/bin/supervisord", "-c", "/data/supervisord.conf"] diff --git a/composer-es7x.json b/composer-es7x.json new file mode 100755 index 0000000..ead7090 --- /dev/null +++ b/composer-es7x.json @@ -0,0 +1,42 @@ +{ + "name": "etsy/411", + "description": "An Alert Management Web Application", + "config": { + "platform": { + "php": "7.0.0" + } + }, + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/dsvetlov/esquery" + } + ], + "require": { + "mtdowling/cron-expression": "^1.1", + "php-curl-class/php-curl-class": "^4.6", + "setasign/fpdf": "^1.7", + "symfony/expression-language": "^3.1", + "elasticsearch/elasticsearch": "^6.0", + "kiwiz/esquery": "dev-master", + "kiwiz/ecl": ">=1.0", + "ext-pcntl": ">=5.5", + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.8", + "d11wtq/boris": "^1.0", + "phpdocumentor/phpdocumentor": "^2.8", + "techlivezheng/phpctags": "^0.6.0" + }, + "authors": [ + { + "name": "Kai Zhong", + "email": "z@kwi.li" + }, + { + "name": "Ken Lee", + "email": "kennysanx@hotmail.com" + } + ] +} diff --git a/htdocs/assets/js/views/searches/search/load.js b/htdocs/assets/js/views/searches/search/load.js index d723bd0..7a0090d 100755 --- a/htdocs/assets/js/views/searches/search/load.js +++ b/htdocs/assets/js/views/searches/search/load.js @@ -19,7 +19,7 @@ define(function(require) { SearchView.registerSubclass('http', HTTPSearchView); SearchView.registerSubclass('graphite', GraphiteSearchView); SearchView.registerSubclass('threatexchange', ThreatexchangeSearchView); - SearchView.registerSubclass('es', ElasticsearchSearchView); + SearchView.registerSubclass('_doc', ElasticsearchSearchView); SearchView.registerSubclass('alert', ElasticsearchSearchView); SearchView.registerSubclass('ecl', ECLSearchView); SearchView.registerSubclass('push', PushSearchView); diff --git a/phplib/ESClient.php b/phplib/ESClient.php index 11206ff..8f0107e 100644 --- a/phplib/ESClient.php +++ b/phplib/ESClient.php @@ -87,7 +87,6 @@ public function initializeIndex() { 'body' => [ 'template' => '411_alerts_*', 'mappings' => [ - '_default_' => [ 'properties' => [ 'alert_date' => ['type' => 'date', 'format' => 'epoch_second'], 'assignee_type' => ['type' => 'long'], @@ -109,7 +108,6 @@ public function initializeIndex() { 'update_date' => ['type' => 'date', 'format' => 'epoch_second'], ] ] - ] ] ]); } diff --git a/phplib/Search/ES.php b/phplib/Search/ES.php index ec3c3ab..68db9c0 100644 --- a/phplib/Search/ES.php +++ b/phplib/Search/ES.php @@ -3,7 +3,7 @@ namespace FOO; class ES_Search extends Elasticsearch_Search { - public static $TYPE = 'es'; + public static $TYPE = '_doc'; public static function getSources() { $sources = []; diff --git a/phplib/Target/Jira.php b/phplib/Target/Jira.php index f80b365..35c15a7 100644 --- a/phplib/Target/Jira.php +++ b/phplib/Target/Jira.php @@ -39,7 +39,7 @@ public function process(Alert $alert, $date) { $title = sprintf('[%s] %s', $site['name'], $search['name']); $desc = []; $desc[] = sprintf('Date: %s', gmdate(DATE_RSS, $alert['alert_date'])); - + // Don't show the link if this Alert isn't persisted. if(!$alert->isNew()) { $desc[] = sprintf('[Link to Alert|%s]', $site->urlFor(