Commit ae871c1c authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge remote-tracking branch 'origin/master' into 101-admin-panel-should-use-api

parents 6a53c71d 4ecece8f
minerva (11.0.0) stable; urgency=medium minerva (11.0.0) stable; urgency=medium
* Bug fix: security issue - access to specific map can be restricted
by the userlogin
* Bug fix: sbgn import
* Bug fix: mesh connector
* Rest API (documentation can be found here:
https://git-r3lab.uni.lu/piotr.gawron/minerva/blob/master/README.md)
* Selecting an element on the map shows info about it in the bottom left
corner (when Search tab is not open)
* Upload of data overlays allows to upload just names of the proteins
(or other elements), it can be done via file or just by typing in the
proper text box
* Layout changes: the main one is that there are only 3 tab panels
(search, overlay, info), so it should be easier to navigate
-- Piotr Gawron <piotr.gawron@uni.lu> Mon, 28 Aug 2017 12:00:00 +0200
minerva (10.0.5) stable; urgency=medium minerva (10.0.5) stable; urgency=medium
* Bug fix: interacting drugs can be found for RNAs * Bug fix: interacting drugs can be found for RNAs
......
...@@ -49,6 +49,8 @@ gzip $SRC_DIR/minerva.txt ...@@ -49,6 +49,8 @@ gzip $SRC_DIR/minerva.txt
#copy configuration of logrotate #copy configuration of logrotate
cp debian/logrotate/* $SRC_DIR/ cp debian/logrotate/* $SRC_DIR/
cp debian/scripts/common.sh $SRC_DIR/
#copy changelog file #copy changelog file
cp CHANGELOG $ROOT_DIR/debian/template/changelog cp CHANGELOG $ROOT_DIR/debian/template/changelog
...@@ -150,22 +152,17 @@ find -name '*.ex' ! -name 'minerva*' -type f -exec rm -f {} + ...@@ -150,22 +152,17 @@ find -name '*.ex' ! -name 'minerva*' -type f -exec rm -f {} +
#our pre/post inst/rm scripts use __CURRENT_VERSION__ as a version of currently #our pre/post inst/rm scripts use __CURRENT_VERSION__ as a version of currently
#installed package #installed package
sed -i "s/__CURRENT_VERSION__/$current_version/g" debian/preinst
sed -i "s/__CURRENT_VERSION__/$current_version/g" debian/postinst
sed -i "s/__CURRENT_VERSION__/$current_version/g" debian/prerm
sed -i "s/__CURRENT_VERSION__/$current_version/g" debian/postrm
sed -i "s/__LOG_FILE__/$LOG_FILE/g" debian/preinst
sed -i "s/__LOG_FILE__/$LOG_FILE/g" debian/postinst
sed -i "s/__LOG_FILE__/$LOG_FILE/g" debian/prerm
sed -i "s/__LOG_FILE__/$LOG_FILE/g" debian/postrm
sed -i "s/__CURRENT_VERSION__/$current_version/g" common.sh
sed -i "s/__LOG_FILE__/$LOG_FILE/g" common.sh
#__DB_SCRIPT_DIR__ in our scripts points to place where db schema files are placed #__DB_SCRIPT_DIR__ in our scripts points to place where db schema files are placed
#in the filesystem where package is installed #in the filesystem where package is installed
sed -i "s/__DB_SCRIPT_DIR__/$DB_SCRIPT_DIR/g" debian/postinst sed -i "s/__DB_SCRIPT_DIR__/$DB_SCRIPT_DIR/g" common.sh
sed -i "s/__DB_SCRIPT_DIR__/$DB_SCRIPT_DIR/g" debian/postrm
sed -i "s/__DB_SCRIPT_DIR__/$DB_SCRIPT_DIR/g" debian/prerm sed -i -e "1r common.sh" debian/postinst
sed -i "s/__DB_SCRIPT_DIR__/$DB_SCRIPT_DIR/g" debian/preinst sed -i -e "1r common.sh" debian/postrm
sed -i -e "1r common.sh" debian/preinst
sed -i -e "1r common.sh" debian/prerm
#put scripts into $DB_SCRIPT_DIR (it's a bit different than varaiable because it's not #put scripts into $DB_SCRIPT_DIR (it's a bit different than varaiable because it's not
#escaped #escaped
......
#file with common script functions for postrm/prerm/postinst/preinst
log(){
echo "[" $CURRENT_VERSION "]" "$@" >>__LOG_FILE__
}
LOG_FILE="__LOG_FILE__"
DB_SCRIPT_DIR="__DB_SCRIPT_DIR__"
#new (current) version of the package
CURRENT_VERSION="__CURRENT_VERSION__"
#if we update package then this will be the old version of the package
OLD_VERSION=$2
if [ "$OLD_VERSION" = "$CURRENT_VERSION" ]
then
OLD_VERSION="";
fi
TOMCAT_PACKAGE="";
TOMCAT7_OK=$(dpkg-query -W --showformat='${Status}\n' tomcat7|grep "install ok installed")
TOMCAT8_OK=$(dpkg-query -W --showformat='${Status}\n' tomcat8|grep "install ok installed")
if [ "$TOMCAT7_OK" != "" ];
then
TOMCAT_PACKAGE='tomcat7'
fi
if [ "$TOMCAT8_OK" != "" ];
then
TOMCAT_PACKAGE='tomcat8'
fi
...@@ -13,4 +13,4 @@ Description: Standalone web application for visualization, exploration and ...@@ -13,4 +13,4 @@ Description: Standalone web application for visualization, exploration and
Tomcat server later to change the address. Tomcat server later to change the address.
Section: science Section: science
Homepage: http://r3lab.uni.lu/web/minerva-website/ Homepage: http://r3lab.uni.lu/web/minerva-website/
Depends: ${misc:Depends}, tomcat7, oracle-java8-set-default, postgresql (>=9.3) Depends: ${misc:Depends}, tomcat7 | tomcat8, oracle-java8-set-default, postgresql (>=9.3)
minerva.war /var/lib/tomcat7/webapps minerva.war /usr/share/minerva/
...@@ -13,28 +13,12 @@ ...@@ -13,28 +13,12 @@
# <conflicting-package> <version> # <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or # for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package # the debian-policy package
log(){
echo "$@" >>__LOG_FILE__
}
log "Running postinst" $1 $2; log "Running postinst" $1 $2;
invoke-rc.d $TOMCAT_PACKAGE status >> $LOG_FILE
# we execute it here because if some packages are missing then dpkg will return non-zero exit code # we execute it here because if some packages are missing then dpkg will return non-zero exit code
set -e set -e
#new (current) version of the package
CURRENT_VERSION="__CURRENT_VERSION__"
#if we update package then this will be the old version of the package
OLD_VERSION=$2
DB_SCRIPT_DIR="__DB_SCRIPT_DIR__"
if [ "$OLD_VERSION" = "$CURRENT_VERSION" ]
then
OLD_VERSION="";
fi
case "$1" in case "$1" in
configure) configure)
invoke-rc.d postgresql start invoke-rc.d postgresql start
...@@ -42,9 +26,9 @@ case "$1" in ...@@ -42,9 +26,9 @@ case "$1" in
#if we install #if we install
if [ "$OLD_VERSION" = "" ] if [ "$OLD_VERSION" = "" ]
then then
su - postgres -c "createuser -d -r -s map_viewer" >>__LOG_FILE__ 2>>__LOG_FILE__ su - postgres -c "createuser -d -r -s map_viewer" >>$LOG_FILE 2>>$LOG_FILE
su - postgres -c "echo \"ALTER USER map_viewer WITH PASSWORD '123qweasdzxc';\"| psql" >>__LOG_FILE__ 2>>__LOG_FILE__ su - postgres -c "echo \"ALTER USER map_viewer WITH PASSWORD '123qweasdzxc';\"| psql" >>$LOG_FILE 2>>$LOG_FILE
su - postgres -c "createdb -O map_viewer map_viewer" >>__LOG_FILE__ 2>>__LOG_FILE__ su - postgres -c "createdb -O map_viewer map_viewer" >>$LOG_FILE 2>>$LOG_FILE
hba_conf=`su - postgres -c "psql -t -P format=unaligned -c 'show hba_file';"`; hba_conf=`su - postgres -c "psql -t -P format=unaligned -c 'show hba_file';"`;
cp $hba_conf $hba_conf".bac" cp $hba_conf $hba_conf".bac"
...@@ -53,13 +37,13 @@ case "$1" in ...@@ -53,13 +37,13 @@ case "$1" in
invoke-rc.d postgresql restart invoke-rc.d postgresql restart
#install base version of the framework #install base version of the framework
su - postgres -c "psql map_viewer -f $DB_SCRIPT_DIR/db_0.sql" >>__LOG_FILE__ 2>>__LOG_FILE__ su - postgres -c "psql map_viewer -f $DB_SCRIPT_DIR/db_0.sql" >>$LOG_FILE 2>>$LOG_FILE
#install patch to current version #install patch to current version
su - postgres -c "psql map_viewer -f $DB_SCRIPT_DIR/db_0_to_$CURRENT_VERSION\".sql\"" >>__LOG_FILE__ 2>>__LOG_FILE__ su - postgres -c "psql map_viewer -f $DB_SCRIPT_DIR/db_0_to_$CURRENT_VERSION\".sql\"" >>$LOG_FILE 2>>$LOG_FILE
else else
#if we update the package #if we update the package
su - postgres -c "psql map_viewer -f $DB_SCRIPT_DIR/db_$OLD_VERSION\"_to_\"$CURRENT_VERSION\".sql\"" >>__LOG_FILE__ 2>>__LOG_FILE__ su - postgres -c "psql map_viewer -f $DB_SCRIPT_DIR/db_$OLD_VERSION\"_to_\"$CURRENT_VERSION\".sql\"" >>$LOG_FILE 2>>$LOG_FILE
fi fi
#print a disclaimer #print a disclaimer
...@@ -78,7 +62,10 @@ case "$1" in ...@@ -78,7 +62,10 @@ case "$1" in
#we have to restart tomcat, because application was started on the old database and it might crash during deplyment #we have to restart tomcat, because application was started on the old database and it might crash during deplyment
#for instance in the new war file there was init script that uses some new database features, but they are not #for instance in the new war file there was init script that uses some new database features, but they are not
#availble when new war is deployed from debian package, so tomcat will catch SQL exception and stop deployment #availble when new war is deployed from debian package, so tomcat will catch SQL exception and stop deployment
invoke-rc.d tomcat7 restart invoke-rc.d $TOMCAT_PACKAGE stop || true
rm -rf /var/lib/$TOMCAT_PACKAGE/webapps/minerva
ln -s /usr/share/minerva/minerva.war /var/lib/$TOMCAT_PACKAGE/webapps/minerva.war
invoke-rc.d $TOMCAT_PACKAGE start
;; ;;
*) *)
echo "postinst called with unknown argument \`$1'" >&2 echo "postinst called with unknown argument \`$1'" >&2
......
...@@ -7,9 +7,6 @@ ...@@ -7,9 +7,6 @@
# * <old-postrm> `upgrade' <new-version> # * <old-postrm> `upgrade' <new-version>
# for details, see http://www.debian.org/doc/debian-policy/ or # for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package # the debian-policy package
log(){
echo "$@" >>__LOG_FILE__
}
log "Running postrm" $1 $2; log "Running postrm" $1 $2;
...@@ -27,13 +24,15 @@ set -e ...@@ -27,13 +24,15 @@ set -e
case "$1" in case "$1" in
upgrade) upgrade)
rm -rf /var/lib/tomcat7/webapps/minerva rm -rf /var/lib/$TOMCAT_PACKAGE/webapps/minerva
invoke-rc.d tomcat7 start || true rm -rf /var/lib/$TOMCAT_PACKAGE/webapps/minerva.war
invoke-rc.d postgresql start || true # invoke-rc.d $TOMCAT_PACKAGE start || true
# invoke-rc.d postgresql start || true
;; ;;
remove) remove)
rm -rf /var/lib/tomcat7/webapps/minerva rm -rf /var/lib/$TOMCAT_PACKAGE/webapps/minerva
invoke-rc.d tomcat7 start || true rm -rf /var/lib/$TOMCAT_PACKAGE/webapps/minerva.war
invoke-rc.d $TOMCAT_PACKAGE start || true
if [ "" = "$POSTGRES_OK" ] if [ "" = "$POSTGRES_OK" ]
then then
log "No postgresql package found."; log "No postgresql package found.";
...@@ -44,7 +43,7 @@ case "$1" in ...@@ -44,7 +43,7 @@ case "$1" in
fi fi
;; ;;
abort-install) abort-install)
invoke-rc.d tomcat7 start || true invoke-rc.d $TOMCAT_PACKAGE start || true
if [ "" = "$POSTGRES_OK" ]; if [ "" = "$POSTGRES_OK" ];
then then
......
...@@ -9,11 +9,6 @@ ...@@ -9,11 +9,6 @@
# for details, see http://www.debian.org/doc/debian-policy/ or # for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package # the debian-policy package
log(){
echo "$@" >>__LOG_FILE__
}
log "Running preinst" $1 $2; log "Running preinst" $1 $2;
# we execute it here because if some packages are missing then dpkg will return non-zero exit code # we execute it here because if some packages are missing then dpkg will return non-zero exit code
...@@ -29,11 +24,11 @@ ln -s $path $DEFAULT_JAVA_SYMLINK ...@@ -29,11 +24,11 @@ ln -s $path $DEFAULT_JAVA_SYMLINK
case "$1" in case "$1" in
install|upgrade) install|upgrade)
invoke-rc.d tomcat7 stop || true invoke-rc.d $TOMCAT_PACKAGE stop || true
invoke-rc.d postgresql stop || true invoke-rc.d postgresql stop || true
;; ;;
abort-upgrade) abort-upgrade)
invoke-rc.d tomcat7 stop || true invoke-rc.d $TOMCAT_PACKAGE stop || true
invoke-rc.d postgresql stop || true invoke-rc.d postgresql stop || true
;; ;;
*) *)
......
...@@ -8,14 +8,9 @@ set -e ...@@ -8,14 +8,9 @@ set -e
# * <new-preinst> `upgrade' <old-version> # * <new-preinst> `upgrade' <old-version>
# for details, see http://www.debian.org/doc/debian-policy/ or # for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package # the debian-policy package
log(){
echo "$@" >>__LOG_FILE__
}
log "Running preinst" $1 $2; log "Running preinst" $1 $2;
DB_SCRIPT_DIR="__DB_SCRIPT_DIR__"
# we execute it here because if some packages are missing then dpkg will return non-zero exit code # we execute it here because if some packages are missing then dpkg will return non-zero exit code
set -e set -e
...@@ -30,11 +25,11 @@ su - postgres -c "pg_dump map_viewer" | gzip > "$DUMP_FILE".gz ...@@ -30,11 +25,11 @@ su - postgres -c "pg_dump map_viewer" | gzip > "$DUMP_FILE".gz
case "$1" in case "$1" in
upgrade) upgrade)
invoke-rc.d tomcat7 stop || true invoke-rc.d $TOMCAT_PACKAGE stop || true
invoke-rc.d postgresql stop || true invoke-rc.d postgresql stop || true
;; ;;
remove) remove)
invoke-rc.d tomcat7 stop || true invoke-rc.d $TOMCAT_PACKAGE stop || true
invoke-rc.d postgresql stop || true invoke-rc.d postgresql stop || true
;; ;;
*) *)
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
"//": "rm -rf dist & rmdir /q /s dist & mkdir dist & browserify --debug --standalone minerva src/main/js/minerva.js | exorcist dist/minerva.js.map > dist/minerva.js & uglifyjs --compress --mangle --in-source-map dist/minerva.js.map --source-map-include-sources --source-map dist/minerva.min.js.map -o dist/minerva.min.js dist/minerva.js", "//": "rm -rf dist & rmdir /q /s dist & mkdir dist & browserify --debug --standalone minerva src/main/js/minerva.js | exorcist dist/minerva.js.map > dist/minerva.js & uglifyjs --compress --mangle --in-source-map dist/minerva.js.map --source-map-include-sources --source-map dist/minerva.min.js.map -o dist/minerva.min.js dist/minerva.js",
"build-deploy": "npm run build && npm run deploy", "build-deploy": "npm run build && npm run deploy",
"build": "npm run clean && npm run build:css && npm run build:js", "build": "npm run clean && npm run build:css && npm run build:js",
"clean": "rm -rf dist & rmdir /q /s dist & mkdir dist", "clean": "node scripts/clean.js",
"deploy": "copy /Y \"dist\\*.js*\" \"C:/Program Files/apache-tomcat-7.0.72/webapps/minerva/resources/js\" && copy /Y \"dist\\*.css\" \"C:/Program Files/apache-tomcat-7.0.72/webapps/minerva/resources/css\" ", "deploy": "copy /Y \"dist\\*.js*\" \"C:/Program Files/apache-tomcat-7.0.72/webapps/minerva/resources/js\" && copy /Y \"dist\\*.css\" \"C:/Program Files/apache-tomcat-7.0.72/webapps/minerva/resources/css\" ",
"lint": "jshint src/.", "lint": "jshint src/.",
"test": "istanbul cover node_modules/mocha/bin/_mocha -- --recursive src/test/js" "test": "istanbul cover node_modules/mocha/bin/_mocha -- --recursive src/test/js"
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
"browserify": "^13.1.1", "browserify": "^13.1.1",
"chai": "^3.5.0", "chai": "^3.5.0",
"clean-css-cli": "^4.1.6", "clean-css-cli": "^4.1.6",
"del": "^3.0.0",
"datatables.net": "^1.10.13", "datatables.net": "^1.10.13",
"exorcist": "^0.4.0", "exorcist": "^0.4.0",
"file-url": "^2.0.0", "file-url": "^2.0.0",
...@@ -32,6 +33,7 @@ ...@@ -32,6 +33,7 @@
"jsdom-global": "^2.1.1", "jsdom-global": "^2.1.1",
"jshint": "^2.9.4", "jshint": "^2.9.4",
"log4js-memory-appender": "1.0.5", "log4js-memory-appender": "1.0.5",
"mkdirp": "^0.5.1",
"mocha": "^3.4.1", "mocha": "^3.4.1",
"uglifyjs": "^2.4.10" "uglifyjs": "^2.4.10"
}, },
......
var del = require('del');
var mkdirp = require('mkdirp');
var exec = require('child_process').exec;
function puts(error, stdout, stderr) { console.log(stdout) }
var os = require('os');
//control OS
//then run command depengin on the OS
del(["dist/"]).then(function(){
return mkdirp("dist");
});
...@@ -7,7 +7,7 @@ var GuiConnector = require('../GuiConnector'); ...@@ -7,7 +7,7 @@ var GuiConnector = require('../GuiConnector');
var InvalidCredentialsError = require('../InvalidCredentialsError'); var InvalidCredentialsError = require('../InvalidCredentialsError');
var PanelControlElementType = require('./PanelControlElementType'); var PanelControlElementType = require('./PanelControlElementType');
var Functions = require('../functions'); var Functions = require('../Functions');
var logger = require('../logger'); var logger = require('../logger');
function LoginDialog(params) { function LoginDialog(params) {
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
var AbstractGuiElement = require('./AbstractGuiElement'); var AbstractGuiElement = require('./AbstractGuiElement');
var GuiConnector = require('../GuiConnector'); var GuiConnector = require('../GuiConnector');
var functions = require('../functions'); var functions = require('../Functions');
var logger = require('../logger'); var logger = require('../logger');
function OverviewDialog(params) { function OverviewDialog(params) {
......
...@@ -10,7 +10,7 @@ var GuiConnector = require('../../GuiConnector'); ...@@ -10,7 +10,7 @@ var GuiConnector = require('../../GuiConnector');
var IdentifiedElement = require('../../map/data/IdentifiedElement'); var IdentifiedElement = require('../../map/data/IdentifiedElement');
var Reaction = require('../../map/data/Reaction'); var Reaction = require('../../map/data/Reaction');
var Functions = require('../../functions'); var Functions = require('../../Functions');
var logger = require('../../logger'); var logger = require('../../logger');
function PublicationListDialog(params) { function PublicationListDialog(params) {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
var Promise = require("bluebird"); var Promise = require("bluebird");
var Cookies = require('js-cookie'); var Cookies = require('js-cookie');
var Helper = require('./Helper'); var Helper = require('./helper');
var GuiConnector = require('./GuiConnector-mock'); var GuiConnector = require('./GuiConnector-mock');
...@@ -40,7 +40,7 @@ before(function () { ...@@ -40,7 +40,7 @@ before(function () {
global.document.elementFromPoint = function () { global.document.elementFromPoint = function () {
}; };
global.$ = require('jQuery'); global.$ = require('jquery');
global.jQuery = $; global.jQuery = $;
global.window.$ = $; global.window.$ = $;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment