Skip to content
Merged
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
186 changes: 94 additions & 92 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,94 +1,96 @@
{
"name": "iofogcontroller",
"version": "1.0.24",
"description": "ioFog Controller project for Eclipse IoFog @ iofog.org \\nCopyright (c) 2018 Edgeworx, Inc.",
"main": "./src/main.js",
"author": "Saeid Baghbidi",
"contributors": [
"Kilton Hopkins <kilton@edgeworx.io>",
"Saeid Baghbidi",
"Pavel Kazlou",
"Egor Krylovich",
"Iryna Laryionava",
"Maryna Lipnitskaya",
"Dmitriy Kudasov",
"Dmitry Stolbunov",
"Darya Busel",
"Alexander Shpak",
"Kate Lukashick",
"Eugene Pankov",
"Maksim Chepelev",
"Tetiana Yatsiuk",
"Sergey Valevich"
],
"license": {
"type": "EPL-2.0",
"url": "https://www.eclipse.org/legal/epl-v20.html"
},
"bugs": {
"email": "edgemaster@iofog.org"
},
"homepage": "https://www.iofog.org",
"repository": {
"type": "git",
"url": "https://github.com/ioFog/Controller"
},
"scripts": {
"start": "NODE_ENV=production node ./src/main.js start",
"start-dev": "NODE_ENV=development node ./src/main.js start",
"build": "export NODE_ENV=production && cd src/sequelize && ../../node_modules/.bin/sequelize db:migrate && ../../node_modules/.bin/sequelize db:seed:all",
"preuninstall": "bash scripts/preuninstall.sh",
"postinstall": "bash scripts/postinstall.sh && NODE_ENV=production node ./src/main.js init",
"lint": "./node_modules/.bin/eslint \"**/*.js\"",
"automatic-release": "automatic-release",
"test": "NODE_ENV=test mocha",
"coverage": "NODE_ENV=test nyc mocha"
},
"preferGlobal": true,
"bin": {
"iofog-controller": "src/main.js"
},
"dependencies": {
"body-parser": "^1.18.3",
"command-line-args": "^5.0.2",
"command-line-usage": "^5.0.5",
"continuation-local-storage": "^3.2.1",
"cookie-parser": "^1.4.3",
"daemonize2": "^0.4.2",
"ejs": "^2.6.1",
"express": "^4.16.3",
"formidable": "^1.2.1",
"fs": "^0.0.1-security",
"ftp": "^0.3.10",
"helmet": "^3.13.0",
"jsonschema": "^1.2.4",
"morgan": "^1.9.1",
"nconf": "^0.10.0",
"nodemailer": "^4.6.8",
"nodemailer-smtp-transport": "^2.7.4",
"path": "^0.12.7",
"portscanner": "^2.2.0",
"retry-as-promised": "^3.1.0",
"sequelize": "^4.39.0",
"sequelize-cli": "^4.1.1",
"sqlite3": "^4.0.2",
"string-format": "^2.0.0",
"umzug": "^2.1.0",
"underscore": "^1.9.1",
"winston": "^3.1.0",
"xss-clean": "^0.1.1",
"qs": "^6.5.2"
},
"devDependencies": {
"automatic-release": "^1.1.1",
"bdd-lazy-var": "^2.5.0",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"chai-http": "^4.2.0",
"eslint": "^5.6.1",
"mocha": "^5.2.0",
"nyc": "^13.1.0",
"sinon": "^7.1.1",
"sinon-chai": "^3.2.0"
}
"name": "iofogcontroller",
"version": "1.0.24",
"description": "ioFog Controller project for Eclipse IoFog @ iofog.org \\nCopyright (c) 2018 Edgeworx, Inc.",
"main": "./src/main.js",
"author": "Saeid Baghbidi",
"contributors": [
"Kilton Hopkins <kilton@edgeworx.io>",
"Saeid Baghbidi",
"Pavel Kazlou",
"Egor Krylovich",
"Iryna Laryionava",
"Maryna Lipnitskaya",
"Dmitriy Kudasov",
"Dmitry Stolbunov",
"Darya Busel",
"Alexander Shpak",
"Kate Lukashick",
"Eugene Pankov",
"Maksim Chepelev",
"Tetiana Yatsiuk",
"Sergey Valevich"
],
"license": {
"type": "EPL-2.0",
"url": "https://www.eclipse.org/legal/epl-v20.html"
},
"bugs": {
"email": "edgemaster@iofog.org"
},
"homepage": "https://www.iofog.org",
"repository": {
"type": "git",
"url": "https://github.com/ioFog/Controller"
},
"scripts": {
"start": "node scripts/start.js",
"start-dev": "node scripts/start-dev.js",
"build": "node scripts/init.js",
"preuninstall": "node scripts/preuninstall.js",
"postinstall": "node scripts/postinstall.js",
"lint": "./node_modules/.bin/eslint \"**/*.js\"",
"automatic-release": "automatic-release",
"test": "node scripts/test.js",
"coverage": "node scripts/coverage.js"
},
"preferGlobal": true,
"bin": {
"iofog-controller": "src/main.js"
},
"dependencies": {
"body-parser": "^1.18.3",
"command-line-args": "^5.0.2",
"command-line-usage": "^5.0.5",
"continuation-local-storage": "^3.2.1",
"cookie-parser": "^1.4.3",
"daemonize2": "^0.4.2",
"ejs": "^2.6.1",
"express": "^4.16.3",
"formidable": "^1.2.1",
"fs": "^0.0.1-security",
"ftp": "^0.3.10",
"helmet": "^3.13.0",
"jsonschema": "^1.2.4",
"morgan": "^1.9.1",
"nconf": "^0.10.0",
"nodemailer": "^4.6.8",
"nodemailer-smtp-transport": "^2.7.4",
"path": "^0.12.7",
"portscanner": "^2.2.0",
"retry-as-promised": "^3.1.0",
"sequelize": "^4.39.0",
"sequelize-cli": "^4.1.1",
"sqlite3": "^4.0.2",
"string-format": "^2.0.0",
"umzug": "^2.1.0",
"underscore": "^1.9.1",
"winston": "^3.1.0",
"xss-clean": "^0.1.1",
"qs": "^6.5.2",
"child_process": "^1.0.2",
"os": "^0.1.1"
},
"devDependencies": {
"automatic-release": "^1.1.1",
"bdd-lazy-var": "^2.5.0",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"chai-http": "^4.2.0",
"eslint": "^5.6.1",
"mocha": "^5.2.0",
"nyc": "^13.1.0",
"sinon": "^7.1.1",
"sinon-chai": "^3.2.0"
}
}
24 changes: 24 additions & 0 deletions scripts/coverage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* *******************************************************************************
* * Copyright (c) 2018 Edgeworx, Inc.
* *
* * This program and the accompanying materials are made available under the
* * terms of the Eclipse Public License v. 2.0 which is available at
* * http://www.eclipse.org/legal/epl-2.0
* *
* * SPDX-License-Identifier: EPL-2.0
* *******************************************************************************
*
*/

const execSync = require('child_process').execSync;

const options = {
env: {
'NODE_ENV': 'test',
"PATH": process.env.PATH
},
stdio: [process.stdin, process.stdout, process.stderr]
};

execSync('nyc mocha', options);
24 changes: 24 additions & 0 deletions scripts/init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* *******************************************************************************
* * Copyright (c) 2018 Edgeworx, Inc.
* *
* * This program and the accompanying materials are made available under the
* * terms of the Eclipse Public License v. 2.0 which is available at
* * http://www.eclipse.org/legal/epl-2.0
* *
* * SPDX-License-Identifier: EPL-2.0
* *******************************************************************************
*
*/

const execSync = require('child_process').execSync;

const options = {
env: {
'NODE_ENV': 'production',
"PATH": process.env.PATH
},
stdio: [process.stdin, process.stdout, process.stderr]
};

execSync('node ./src/main.js init', options);
47 changes: 47 additions & 0 deletions scripts/postinstall.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* *******************************************************************************
* * Copyright (c) 2018 Edgeworx, Inc.
* *
* * This program and the accompanying materials are made available under the
* * terms of the Eclipse Public License v. 2.0 which is available at
* * http://www.eclipse.org/legal/epl-2.0
* *
* * SPDX-License-Identifier: EPL-2.0
* *******************************************************************************
*
*/


const os = require('os');
const execSync = require('child_process').execSync;
const fs = require('fs');

const rootDir = `${__dirname}/../`;
let installation_variables_file_name = 'iofogcontroller_install_variables';
let installation_variables_file;
let tempDir;

if (os.type() === 'Linux') {
tempDir = '/tmp/';
} else if (os.type() === 'Darwin') {
tempDir = '/tmp/';
} else if (os.type() === 'Windows_NT') {
tempDir = `${process.env.APPDATA}/`;
} else {
throw new Error("Unsupported OS found: " + os.type());
}

installation_variables_file = tempDir + installation_variables_file_name;


const devDbBackup = `${tempDir}dev_database.sqlite`;
if (fs.existsSync(devDbBackup)) {
fs.renameSync(devDbBackup, `${rootDir}/src/sequelize/dev_database.sqlite`)
}

const prodDbBackup = `${tempDir}prod_database.sqlite`;
if (fs.existsSync(prodDbBackup)) {
fs.renameSync(prodDbBackup, `${rootDir}/src/sequelize/prod_database.sqlite`)
}

//TODO: add version migrations
2 changes: 2 additions & 0 deletions scripts/postinstall.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

##TODO: remove after js scripts finished

vercomp () {
if [[ $1 == $2 ]]
then
Expand Down
18 changes: 0 additions & 18 deletions scripts/preinstall.sh

This file was deleted.

47 changes: 47 additions & 0 deletions scripts/preuninstall.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* *******************************************************************************
* * Copyright (c) 2018 Edgeworx, Inc.
* *
* * This program and the accompanying materials are made available under the
* * terms of the Eclipse Public License v. 2.0 which is available at
* * http://www.eclipse.org/legal/epl-2.0
* *
* * SPDX-License-Identifier: EPL-2.0
* *******************************************************************************
*
*/

const os = require('os');
const execSync = require('child_process').execSync;
const fs = require('fs');
const version = require('../package').version;

const rootDir = `${__dirname}/../`;
let installation_variables_file_name = 'iofogcontroller_install_variables';
let installation_variables_file;
let tempDir;

if (os.type() === 'Linux') {
tempDir = '/tmp/';
} else if (os.type() === 'Darwin') {
tempDir = '/tmp/';
} else if (os.type() === 'Windows_NT') {
tempDir = `${process.env.APPDATA}/`;
} else {
throw new Error("Unsupported OS found: " + os.type());
}

installation_variables_file = tempDir + installation_variables_file_name;

fs.writeFileSync(installation_variables_file, `prev_ver: ${version}`);

const devDb = `${rootDir}/src/sequelize/dev_database.sqlite`;
if (fs.existsSync(devDb)) {
fs.renameSync(devDb, `${tempDir}dev_database.sqlite`)
}

const prodDb = `${rootDir}/src/sequelize/prod_database.sqlite`;
if (fs.existsSync(prodDb)) {
fs.renameSync(prodDb, `${tempDir}prod_database.sqlite`)
}

18 changes: 0 additions & 18 deletions scripts/preuninstall.sh

This file was deleted.

Loading