diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 000000000..72fd96035 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,51 @@ +name: "Code scanning - action" + +on: + push: + pull_request: + schedule: + - cron: '0 0 * * 4' + +jobs: + CodeQL-Build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + # We must fetch at least the immediate parents so that if this is + # a pull request then we can checkout the head. + fetch-depth: 2 + + # If this run was triggered by a pull request event, then checkout + # the head of the pull request instead of the merge commit. + - run: git checkout HEAD^2 + if: ${{ github.event_name == 'pull_request' }} + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + # Override language selection by uncommenting this and choosing your languages + # with: + # languages: go, javascript, csharp, python, cpp, java + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/.gitignore b/.gitignore index c274e490c..91015fa63 100644 --- a/.gitignore +++ b/.gitignore @@ -6,9 +6,13 @@ tmp/ build.number build/ target/ +dist *.iml .vscode .idea +package-lock.json +*.ipr +*.iws .classpath .project .settings diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8a6abfb8d..ab9509107 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,7 +4,7 @@ LucidWorks is the commercial entity behind the long-standing and popular Open So Collaboration space (issues, wiki, etc.) for Banana will be setup soon. -##Guidelines for Contribution +## Guidelines for Contribution NOTE: All development on Banana proceeds on the develop branch. Periodically, we push releases to the release branch. diff --git a/README.md b/README.md index 9038841bb..06b61a0bc 100644 --- a/README.md +++ b/README.md @@ -8,66 +8,67 @@ including new panels that leverage [D3.js](http://d3js.org). The goal is to create a rich and flexible UI, enabling users to rapidly develop end-to-end applications that leverage the power of Apache Solr. Data can be ingested into Solr through a variety of ways, including [Logstash](https://www.elastic.co/products/logstash), [Flume](https://flume.apache.org) and other connectors. - -## To Release a New Version for Fusion - -When you are ready to do a new release for Lucidworks Fusion. Do the following steps: - -1. Edit `package.json` by increasing the version number. -1. Edit `dasheditor.html` to use the new version number. (This is the version number in Dashboard Settings page) -1. Update README -1. Run `grunt build` -1. Push your commit to Github. -1. Run `npm publish` ## IMPORTANT Pull the repo from the `release` branch for production deployment; version x.y.z will be tagged as x.y.z `develop` branch is used for active development and cutting edge features. - `fusion` branch is used for Lucidworks Fusion release. The code base and features are the same as `develop`. The main difference is in the configuration. -## Banana 1.6.23 +## Banana 1.6.26 + +This release includes the following bug fixes and improvement: -This release includes minor fixes for the default dashboards in Fusion 4.2: -* Change to use `query` field instead of `query_s` field in the Metrics dashboard (`lucidworks-metrics.json`). -* For the Signals dashboard (`lucidworks-signals.json`): - * Change from `query_s` to `query` field. - * Change from `type_s` to `type` field. - * Change from `doc_id_s` to `doc_ids_s` field. - * Remove `count_i` and `weight_d` fields. +1. Enhance heatmap + * Add axis and axis labels + * Add axis grid and ticks + * Add gradient legend and ranges + * Fix heatmap transpose icon + * Enhance positioning and padding of panel elements + * Fix bettermap tooltip and hint text +1. Enhance hits panel + * Add panel horizontal and vertical direction option + * Fix metrics text and label overlap and margins +1. Fix bettermap render issue when resized +1. Fix jshint warnings ## Older Release Notes You can find all previous [Release Notes](https://github.com/LucidWorks/banana/wiki/Release-Notes) on our wiki page. -### Changes to your dashboards -If you created dashboards for Banana 1.0.0, you did not have a global filtering panel. In some cases, these filter -values can be implicitly set to defaults that may lead to strange search results. We recommend updating your old -dashboards by adding a filtering panel. A good way to do it visually is to put the filtering panel on its own row and -hide it when it is not needed. - ## Installation and Quick Start ### Requirements * A modern web browser. The latest version of [Chrome](http://www.google.com/chrome/) and [Firefox](https://www.mozilla.org/en-US/firefox/new/) have been tested to work. [Safari](http://www.apple.com/safari/) also works, except for the "Export to File" feature for saving dashboards. We recommend that you use Chrome or Firefox while building dashboards. -* Solr 5 or 4.4+ (Solr server's endpoint must be open, or a proxy configured to allow access to it). +* Solr 6.x or at least 4.4+ (Solr server's endpoint must be open, or a proxy configured to allow access to it). * A webserver (optional). ### Installation Options #### Option 1: Run Banana webapp within your existing Solr instance -##### Solr 5 Instructions -1. Run Solr at least once to create the webapp directory: +##### Solr 5+ Instructions +1. Run Solr at least once to create the webapp directory (this step might be unnecessary for Solr 6): - cd $SOLR_HOME/bin/ + cd $SOLR_HOME/bin ./solr start -2. Copy banana folder to $SOLR_HOME/server/solr-webapp/webapp/ -3. Browse to [http://localhost:8983/solr/banana/src/index.html](http://localhost:8983/solr/banana/src/index.html) +2. Copy banana folder to `$SOLR_HOME/server/solr-webapp/webapp/` + + cd $SOLR_HOME/server/solr-webapp/webapp + cp -R $BANANA_HOME/src ./banana + + NOTES: For production, you should run `grunt build` command to generate the optimized code in `dist` directory. And then copy the `dist` directory to the production web server. For example: + + cd $BANANA_HOME + npm install + bower install + grunt build + cp -R ./dist $SOLR_HOME/server/solr-webapp/webapp/banana + +3. Browse to [http://localhost:8983/solr/banana/index.html](http://localhost:8983/solr/banana/index.html) ##### Solr 4 Instructions 1. Run Solr at least once to create the webapp directories: @@ -94,29 +95,30 @@ example collections and dashboards in order to rapidly enable proof-of-concepts See [http://www.lucidworks.com/lucidworks-silk/](http://www.lucidworks.com/lucidworks-silk/). #### Option 3: Building and installing from a WAR file +_NOTES: This option is only applicable to Solr 5 or 4. Solr 6 has a different architecture._ 1. Pull the source code of Banana version that you want from the [release](https://github.com/LucidWorks/banana/tree/release) branch in the repo; For example, version *x.y.z* will be tagged as `x.y.z`. -2. Run a command line "ant" from within the banana directory to build the war file: +2. Run a command line `ant` from within the banana directory to build the war file: ```bash - cd $BANANA_REPO_HOME + cd $BANANA_HOME ant ``` -3. The war file will be called *banana-\.war* and will be located in $BANANA\_REPO\_HOME/build. +3. The war file will be called *banana-\.war* and will be located in $BANANA_HOME/build. Copy the war file and banana's jetty context file to Solr directories: * For Solr 5: ```bash - cp $BANANA_REPO_HOME/build/banana-.war $SOLR_HOME/server/webapps/banana.war - cp $BANANA_REPO_HOME/jetty-contexts/banana-context.xml $SOLR_HOME/server/contexts/ + cp $BANANA_HOME/build/banana-.war $SOLR_HOME/server/webapps/banana.war + cp $BANANA_HOME/jetty-contexts/banana-context.xml $SOLR_HOME/server/contexts/ ``` * For Solr 4: ```bash - cp $BANANA_REPO_HOME/build/banana-.war $SOLR_HOME/example/webapps/banana.war - cp $BANANA_REPO_HOME/jetty-contexts/banana-context.xml $SOLR_HOME/example/contexts/ + cp $BANANA_HOME/build/banana-.war $SOLR_HOME/example/webapps/banana.war + cp $BANANA_HOME/jetty-contexts/banana-context.xml $SOLR_HOME/example/contexts/ ``` 4. Run Solr: * For Solr 5: @@ -139,9 +141,13 @@ You will need to enable [CORS](https://en.wikipedia.org/wiki/Cross-origin_resour you query, or configure a proxy that makes requests to banana and Solr as same-origin. We typically recommend the latter approach. -#### Storing Dashboards in Solr +### Storing Dashboards in Solr +If you want to save and load dashboards from Solr, then you need to create a collection called `banana-int` first. For Solr 6, here are the steps: + + cd $SOLR_HOME/bin + ./solr create -c banana-int -If you want to save and load dashboards from Solr, create a collection using the configuration files provided in either +For Solr 5 and 4, you have to create the `banana-int` collection using the configuration files provided in either the _resources/banana-int-solr-5.0_ (for Solr 5) directory or the _resources/banana-int-solr-4.5_ directory (for Solr 4.5). If you are using SolrCloud, you will need to upload the configuration into [ZooKeeper](https://zookeeper.apache.org) and then create the collection using that configuration. @@ -150,6 +156,12 @@ The Solr server configured in config.js will serve as the default node for each dashboard to point to a different Solr endpoint as long as your webserver and Solr put out the correct CORS headers. See the README file under the _resources/enable-cors_ directory for a guide. +### Changes to your dashboards +If you created dashboards for Banana 1.0.0, you did not have a global filtering panel. In some cases, these filter +values can be implicitly set to defaults that may lead to strange search results. We recommend updating your old +dashboards by adding a filtering panel. A good way to do it visually is to put the filtering panel on its own row and +hide it when it is not needed. + ## FAQ __Q__: How do I secure my Solr endpoint so that users do not have access to it? diff --git a/default.properties b/default.properties index e0572727f..ea98e00c0 100644 --- a/default.properties +++ b/default.properties @@ -1,7 +1,7 @@ name=banana -version=1.6.16 +version=1.6.17 final.name=${name}-${version} -year=2016 +year=2017 basedir = ./ src.dir = ./src diff --git a/dist/WEB-INF/web.xml b/dist/WEB-INF/web.xml deleted file mode 100644 index 814af5220..000000000 --- a/dist/WEB-INF/web.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - Banana Web Application - - - index.html - - - - default - / - - diff --git a/dist/app/app.js b/dist/app/app.js deleted file mode 100644 index 8fb70ac6a..000000000 --- a/dist/app/app.js +++ /dev/null @@ -1,32 +0,0 @@ -/*! banana-fusion - v1.6.23 - 2018-12-12 - * https://github.com/LucidWorks/banana/wiki - * Copyright (c) 2018 Andrew Thanalertvisuti; Licensed Apache-2.0 */ - -!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){function c(a){var b=!!a&&"length"in a&&a.length,c=na.type(a);return"function"===c||na.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}function d(a,b,c){if(na.isFunction(b))return na.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return na.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(xa.test(b))return na.filter(b,a,c);b=na.filter(b,a)}return na.grep(a,function(a){return na.inArray(a,b)>-1!==c})}function e(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}function f(a){var b={};return na.each(a.match(Da)||[],function(a,c){b[c]=!0}),b}function g(){da.addEventListener?(da.removeEventListener("DOMContentLoaded",h),a.removeEventListener("load",h)):(da.detachEvent("onreadystatechange",h),a.detachEvent("onload",h))}function h(){(da.addEventListener||"load"===a.event.type||"complete"===da.readyState)&&(g(),na.ready())}function i(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(Ia,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:Ha.test(c)?na.parseJSON(c):c}catch(e){}na.data(a,b,c)}else c=void 0}return c}function j(a){var b;for(b in a)if(("data"!==b||!na.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function k(a,b,c,d){if(Ga(a)){var e,f,g=na.expando,h=a.nodeType,i=h?na.cache:a,j=h?a[g]:a[g]&&g;if(j&&i[j]&&(d||i[j].data)||void 0!==c||"string"!=typeof b)return j||(j=h?a[g]=ca.pop()||na.guid++:g),i[j]||(i[j]=h?{}:{toJSON:na.noop}),("object"==typeof b||"function"==typeof b)&&(d?i[j]=na.extend(i[j],b):i[j].data=na.extend(i[j].data,b)),f=i[j],d||(f.data||(f.data={}),f=f.data),void 0!==c&&(f[na.camelCase(b)]=c),"string"==typeof b?(e=f[b],null==e&&(e=f[na.camelCase(b)])):e=f,e}}function l(a,b,c){if(Ga(a)){var d,e,f=a.nodeType,g=f?na.cache:a,h=f?a[na.expando]:na.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){na.isArray(b)?b=b.concat(na.map(b,na.camelCase)):b in d?b=[b]:(b=na.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;for(;e--;)delete d[b[e]];if(c?!j(d):!na.isEmptyObject(d))return}(c||(delete g[h].data,j(g[h])))&&(f?na.cleanData([a],!0):la.deleteExpando||g!=g.window?delete g[h]:g[h]=void 0)}}}function m(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return na.css(a,b,"")},i=h(),j=c&&c[3]||(na.cssNumber[b]?"":"px"),k=(na.cssNumber[b]||"px"!==j&&+i)&&Ka.exec(na.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,na.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}function n(a){var b=Sa.split("|"),c=a.createDocumentFragment();if(c.createElement)for(;b.length;)c.createElement(b.pop());return c}function o(a,b){var c,d,e=0,f="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||na.nodeName(d,b)?f.push(d):na.merge(f,o(d,b));return void 0===b||b&&na.nodeName(a,b)?na.merge([a],f):f}function p(a,b){for(var c,d=0;null!=(c=a[d]);d++)na._data(c,"globalEval",!b||na._data(b[d],"globalEval"))}function q(a){Oa.test(a.type)&&(a.defaultChecked=a.checked)}function r(a,b,c,d,e){for(var f,g,h,i,j,k,l,m=a.length,r=n(b),s=[],t=0;m>t;t++)if(g=a[t],g||0===g)if("object"===na.type(g))na.merge(s,g.nodeType?[g]:g);else if(Ua.test(g)){for(i=i||r.appendChild(b.createElement("div")),j=(Pa.exec(g)||["",""])[1].toLowerCase(),l=Ta[j]||Ta._default,i.innerHTML=l[1]+na.htmlPrefilter(g)+l[2],f=l[0];f--;)i=i.lastChild;if(!la.leadingWhitespace&&Ra.test(g)&&s.push(b.createTextNode(Ra.exec(g)[0])),!la.tbody)for(g="table"!==j||Va.test(g)?""!==l[1]||Va.test(g)?0:i:i.firstChild,f=g&&g.childNodes.length;f--;)na.nodeName(k=g.childNodes[f],"tbody")&&!k.childNodes.length&&g.removeChild(k);for(na.merge(s,i.childNodes),i.textContent="";i.firstChild;)i.removeChild(i.firstChild);i=r.lastChild}else s.push(b.createTextNode(g));for(i&&r.removeChild(i),la.appendChecked||na.grep(o(s,"input"),q),t=0;g=s[t++];)if(d&&na.inArray(g,d)>-1)e&&e.push(g);else if(h=na.contains(g.ownerDocument,g),i=o(r.appendChild(g),"script"),h&&p(i),c)for(f=0;g=i[f++];)Qa.test(g.type||"")&&c.push(g);return i=null,r}function s(){return!0}function t(){return!1}function u(){try{return da.activeElement}catch(a){}}function v(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)v(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=t;else if(!e)return a;return 1===f&&(g=e,e=function(a){return na().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=na.guid++)),a.each(function(){na.event.add(this,b,e,d,c)})}function w(a,b){return na.nodeName(a,"table")&&na.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function x(a){return a.type=(null!==na.find.attr(a,"type"))+"/"+a.type,a}function y(a){var b=eb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function z(a,b){if(1===b.nodeType&&na.hasData(a)){var c,d,e,f=na._data(a),g=na._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)na.event.add(b,c,h[c][d])}g.data&&(g.data=na.extend({},g.data))}}function A(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!la.noCloneEvent&&b[na.expando]){e=na._data(b);for(d in e.events)na.removeEvent(b,d,e.handle);b.removeAttribute(na.expando)}"script"===c&&b.text!==a.text?(x(b).text=a.text,y(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),la.html5Clone&&a.innerHTML&&!na.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&Oa.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}function B(a,b,c,d){b=fa.apply([],b);var e,f,g,h,i,j,k=0,l=a.length,m=l-1,n=b[0],p=na.isFunction(n);if(p||l>1&&"string"==typeof n&&!la.checkClone&&db.test(n))return a.each(function(e){var f=a.eq(e);p&&(b[0]=n.call(this,e,f.html())),B(f,b,c,d)});if(l&&(j=r(b,a[0].ownerDocument,!1,a,d),e=j.firstChild,1===j.childNodes.length&&(j=e),e||d)){for(h=na.map(o(j,"script"),x),g=h.length;l>k;k++)f=j,k!==m&&(f=na.clone(f,!0,!0),g&&na.merge(h,o(f,"script"))),c.call(a[k],f,k);if(g)for(i=h[h.length-1].ownerDocument,na.map(h,y),k=0;g>k;k++)f=h[k],Qa.test(f.type||"")&&!na._data(f,"globalEval")&&na.contains(i,f)&&(f.src?na._evalUrl&&na._evalUrl(f.src):na.globalEval((f.text||f.textContent||f.innerHTML||"").replace(fb,"")));j=e=null}return a}function C(a,b,c){for(var d,e=b?na.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||na.cleanData(o(d)),d.parentNode&&(c&&na.contains(d.ownerDocument,d)&&p(o(d,"script")),d.parentNode.removeChild(d));return a}function D(a,b){var c=na(b.createElement(a)).appendTo(b.body),d=na.css(c[0],"display");return c.detach(),d}function E(a){var b=da,c=jb[a];return c||(c=D(a,b),"none"!==c&&c||(ib=(ib||na("