From 14037c5f214061feeb57c8c4a5f283f718593e64 Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 27 Jun 2018 11:53:32 -0400 Subject: [PATCH] Added more extension types and adjusted global stats histograms --- od_util.py | 9 +++-- search/search.py | 6 ++-- static/js/report.js | 80 +++++++++++++++++++++++---------------------- 3 files changed, 51 insertions(+), 44 deletions(-) diff --git a/od_util.py b/od_util.py index a111e15..69bffae 100644 --- a/od_util.py +++ b/od_util.py @@ -45,6 +45,8 @@ category_map = { 'torrent': 'application', 'rpm': 'application', 'deb': 'application', 'atr': 'application', 'class': 'application', 'ttf': 'application', 'img': 'application', 'msi': 'application', 'run': 'application', + 'drpm': 'application', 'udeb': 'application', 'patch': 'application', + 'nes': 'application', 'ebuild': 'application', 'scr': 'application', # Text category 'java': 'text', 'cpp': 'text', 'rb': 'text', 'bat': 'text', 'latex': 'text', 'xml': 'text', @@ -59,6 +61,7 @@ category_map = { 'cbz': 'text', 'docx': 'text', 'mobi': 'text', 'chm': 'text', 'xlsx': "text", 'djvu': 'text', 'rtf': 'text', 'log': 'text', 'md': 'text', + 'dsc': 'text', 'info': 'text', # Video category '3g2': 'video', '3gp': 'video', 'asf': 'video', 'asx': 'video', 'avi': 'video', 'flv': 'video', @@ -68,7 +71,8 @@ category_map = { 'mp4': 'video', 'mpa': 'video', 'mpe': 'video', 'mpeg': 'video', 'mpg': 'video', 'mkv': 'video', 'wmv': 'video', 'm4s': 'video', 'ogv': 'video', - 'm4b': 'video', 'm4v': 'video', + 'm4b': 'video', 'm4v': 'video', 'ts': 'video', + # Audio category 'wav': 'audio', 'snd': 'audio', 'mp2': 'audio', 'aif': 'audio', 'iff': 'audio', 'm4a': 'audio', @@ -86,7 +90,7 @@ category_map = { 'ppm': 'image', 'xpm': 'image', 'xbm': 'image', 'rgb': 'image', 'svg': 'image', 'psd': 'image', 'yuv': 'image', 'ai': 'image', 'eps': 'image', - 'bw': 'image', + 'bw': 'image', 'hdr': 'image', # Archive category 'ar': 'archive', 'cpio': 'archive', 'shar': 'archive', 'iso': 'archive', 'lbr': 'archive', 'mar': 'archive', @@ -119,6 +123,7 @@ category_map = { 'zipx': 'archive', 'zoo': 'archive', 'zpaq': 'archive', 'zz': 'archive', 'xpi': 'archive', 'tgz': 'archive', 'tbz': 'archive', 'tar': 'archive', 'bz': 'archive', + 'diz': 'archive', } colors = { diff --git a/search/search.py b/search/search.py index bdbc6d6..ff98aaf 100644 --- a/search/search.py +++ b/search/search.py @@ -330,15 +330,15 @@ class ElasticSearchEngine(SearchEngine): "sizes": { "histogram": { "field": "size", - "interval": 10000000, # 10Mb - "min_doc_count": 5 + "interval": 50000000, # 50Mb + "min_doc_count": 100 } }, "dates": { "date_histogram": { "field": "mtime", "interval": "1y", - "min_doc_count": 5, + "min_doc_count": 100, "format": "yyyy" } } diff --git a/static/js/report.js b/static/js/report.js index b7de945..3d4df44 100644 --- a/static/js/report.js +++ b/static/js/report.js @@ -72,7 +72,7 @@ function drawWebsiteScatter(rData) { }, tooltips: { callbacks: { - label: function(tooltipItem, data) { + label: function (tooltipItem, data) { return data.labels[tooltipItem.index]; } } @@ -91,7 +91,7 @@ function drawSizeHistogram(rData) { let slice = rData["sizes_histogram"][i]; dataSet.push(slice[1]); - labels.push("[" + humanFileSize(slice[0]) + ", " + humanFileSize(slice[0] + 10000000) + "]") + labels.push("[" + humanFileSize(slice[0]) + ", " + humanFileSize(slice[0] + 50000000) + "]") } let ctx = document.getElementById('sizeHistogram').getContext('2d'); @@ -292,38 +292,31 @@ function getRandomTintOfColor(color) { } category_map = { - - //Application category - 'bcpio': 'application', 'bin': 'application', - 'cdf': 'application', 'csh': 'application', - 'dll': 'application', 'doc': 'application', - 'dot': 'application', 'dvi': 'application', - 'eml': 'application', 'exe': 'application', - 'hdf': 'application', 'man': 'application', - 'me': 'application', 'mht': 'application', - 'mhtml': 'application', 'mif': 'application', - 'ms': 'application', 'nc': 'application', - 'nws': 'application', 'o': 'application', - 'obj': 'application', 'oda': 'application', - 'p12': 'application', 'p7c': 'application', - 'pfx': 'application', 'tr': 'application', - 'ppa': 'application', 'pps': 'application', - 'ppt': 'application', 'ps': 'application', - 'pwz': 'application', 'pyc': 'application', - 'pyo': 'application', 'ram': 'application', - 'rdf': 'application', 'roff': 'application', - 'sh': 'application', 'so': 'application', - 'src': 'application', 'sv4cpio': 'application', - 'sv4crc': 'application', 't': 'application', - 'tcl': 'application', 'tex': 'application', - 'texi': 'application', 'texinfo': 'application', - 'ustar': 'application', 'wiz': 'application', - 'wsdl': 'application', 'xlb': 'application', - 'xls': 'application', 'xpdl': 'application', - 'xsl': 'application', 'torrent': 'application', - 'deb': 'application', 'rpm': 'application', - 'atr': 'application', - //Text category + // Application category + 'bcpio': 'application', 'bin': 'application', 'cdf': 'application', + 'csh': 'application', 'dll': 'application', 'doc': 'application', + 'dot': 'application', 'dvi': 'application', 'eml': 'application', + 'exe': 'application', 'hdf': 'application', + 'man': 'application', 'me': 'application', 'mht': 'application', + 'mhtml': 'application', 'mif': 'application', 'ms': 'application', + 'nc': 'application', 'nws': 'application', 'o': 'application', + 'obj': 'application', 'oda': 'application', 'p12': 'application', + 'p7c': 'application', 'pfx': 'application', 'tr': 'application', + 'ppa': 'application', 'pps': 'application', 'ppt': 'application', + 'ps': 'application', 'pwz': 'application', 'pyc': 'application', + 'pyo': 'application', 'ram': 'application', 'rdf': 'application', + 'roff': 'application', 'sh': 'application', 'so': 'application', + 'src': 'application', 'sv4cpio': 'application', 'sv4crc': 'application', + 't': 'application', 'tcl': 'application', 'tex': 'application', + 'texi': 'application', 'texinfo': 'application', 'ustar': 'application', + 'wiz': 'application', 'wsdl': 'application', 'xlb': 'application', + 'xls': 'application', 'xpdl': 'application', 'xsl': 'application', + 'torrent': 'application', 'rpm': 'application', 'deb': 'application', + 'atr': 'application', 'class': 'application', 'ttf': 'application', + 'img': 'application', 'msi': 'application', 'run': 'application', + 'drpm': 'application', 'udeb': 'application', 'patch': 'application', + 'nes': 'application', 'ebuild': 'application', 'scr': 'application', + // Text category 'java': 'text', 'cpp': 'text', 'rb': 'text', 'bat': 'text', 'latex': 'text', 'xml': 'text', 'etx': 'text', 'htm': 'text', 'c': 'text', @@ -333,8 +326,12 @@ category_map = { 'h': 'text', 'tsv': 'text', 'rtx': 'text', 'sgm': 'text', 'sgml': 'text', 'txt': 'text', 'vcf': 'text', 'pdf': 'text', 'epub': 'text', - 'srt': 'text', 'cbr': 'text', 'inc': 'text', - //Video category + 'srt': 'text', 'inc': 'text', 'php': 'text', + 'cbz': 'text', 'docx': 'text', 'mobi': 'text', + 'chm': 'text', 'xlsx': "text", 'djvu': 'text', + 'rtf': 'text', 'log': 'text', 'md': 'text', + 'dsc': 'text', 'info': 'text', + // Video category '3g2': 'video', '3gp': 'video', 'asf': 'video', 'asx': 'video', 'avi': 'video', 'flv': 'video', 'swf': 'video', 'vob:': 'video', 'qt': 'video', @@ -342,14 +339,17 @@ category_map = { 'm3u': 'video', 'm3u8': 'video', 'movie': 'video', 'mp4': 'video', 'mpa': 'video', 'mpe': 'video', 'mpeg': 'video', 'mpg': 'video', 'mkv': 'video', - 'wmv': 'video', 'm4s': 'video', 'm4v': 'video', - 'mp4a': 'video', + 'wmv': 'video', 'm4s': 'video', 'ogv': 'video', + 'm4b': 'video', 'm4v': 'video', 'ts': 'video', + // Audio category 'wav': 'audio', 'snd': 'audio', 'mp2': 'audio', 'aif': 'audio', 'iff': 'audio', 'm4a': 'audio', 'mid': 'audio', 'midi': 'audio', 'mp3': 'audio', 'wma': 'audio', 'ra': 'audio', 'aifc': 'audio', 'aiff': 'audio', 'au': 'audio', 'flac': 'audio', + 'ogg': 'audio', 'oga': 'audio', 'mka': 'video', + 'ac3': 'audio', // Image category 'bmp': 'image', 'gif': 'image', 'jpg': 'image', 'xwd': 'image', 'tif': 'image', 'tiff': 'image', @@ -359,6 +359,7 @@ category_map = { 'ppm': 'image', 'xpm': 'image', 'xbm': 'image', 'rgb': 'image', 'svg': 'image', 'psd': 'image', 'yuv': 'image', 'ai': 'image', 'eps': 'image', + 'bw': 'image', 'hdr': 'image', // Archive category 'ar': 'archive', 'cpio': 'archive', 'shar': 'archive', 'iso': 'archive', 'lbr': 'archive', 'mar': 'archive', @@ -390,7 +391,8 @@ category_map = { 'xp3': 'archive', 'yz1': 'archive', 'zip': 'archive', 'zipx': 'archive', 'zoo': 'archive', 'zpaq': 'archive', 'zz': 'archive', 'xpi': 'archive', 'tgz': 'archive', - 'tbz': 'archive', + 'tbz': 'archive', 'tar': 'archive', 'bz': 'archive', + 'diz': 'archive', }; colors_map = {