Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add es7x support #210

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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 && \
Expand Down Expand Up @@ -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"]
42 changes: 42 additions & 0 deletions composer-es7x.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
2 changes: 1 addition & 1 deletion htdocs/assets/js/views/searches/search/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions phplib/ESClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand All @@ -109,7 +108,6 @@ public function initializeIndex() {
'update_date' => ['type' => 'date', 'format' => 'epoch_second'],
]
]
]
]
]);
}
Expand Down
2 changes: 1 addition & 1 deletion phplib/Search/ES.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down
2 changes: 1 addition & 1 deletion phplib/Target/Jira.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down