The Big Renaming - etherpad is now an NPM module
|
@ -23,7 +23,7 @@ node-inspector &
|
||||||
echo "If you are new to node-inspector, take a look at this video: http://youtu.be/AOnK3NVnxL8"
|
echo "If you are new to node-inspector, take a look at this video: http://youtu.be/AOnK3NVnxL8"
|
||||||
|
|
||||||
cd "node"
|
cd "node"
|
||||||
node --debug server.js
|
node --debug node_modules/pluginomatic_etherpad-lite/node/server.js $*
|
||||||
|
|
||||||
#kill node-inspector before ending
|
#kill node-inspector before ending
|
||||||
kill $!
|
kill $!
|
||||||
|
|
|
@ -21,9 +21,9 @@ if [ "$(id -u)" -eq 0 ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#prepare the enviroment
|
#prepare the enviroment
|
||||||
bin/installDeps.sh $* || exit 1
|
#bin/installDeps.sh $* || exit 1
|
||||||
|
npm link ./src
|
||||||
|
|
||||||
#Move to the node folder and start
|
#Move to the node folder and start
|
||||||
echo "start..."
|
echo "start..."
|
||||||
cd "node"
|
node node_modules/pluginomatic_etherpad-lite/node/server.js $*
|
||||||
node server.js $*
|
|
||||||
|
|
|
@ -41,10 +41,6 @@ exports.formatHooks = function () {
|
||||||
|
|
||||||
exports.update = function (cb) {
|
exports.update = function (cb) {
|
||||||
exports.getPackages(function (er, packages) {
|
exports.getPackages(function (er, packages) {
|
||||||
packages.__builtin__ = {
|
|
||||||
"path": path.resolve(npm.dir, "../..")
|
|
||||||
};
|
|
||||||
|
|
||||||
var parts = [];
|
var parts = [];
|
||||||
var plugins = {};
|
var plugins = {};
|
||||||
// Load plugin metadata pluginomatic.json
|
// Load plugin metadata pluginomatic.json
|
||||||
|
@ -66,8 +62,7 @@ exports.update = function (cb) {
|
||||||
|
|
||||||
exports.getPackages = function (cb) {
|
exports.getPackages = function (cb) {
|
||||||
// Load list of installed NPM packages, flatten it to a list, and filter out only packages with names that
|
// Load list of installed NPM packages, flatten it to a list, and filter out only packages with names that
|
||||||
// ../.. and not just .. because current dir is like ETHERPAD_ROOT/node/node_modules (!!!!)
|
var dir = path.resolve(npm.dir, '..');
|
||||||
var dir = path.resolve(npm.dir, "../..")
|
|
||||||
readInstalled(dir, function (er, data) {
|
readInstalled(dir, function (er, data) {
|
||||||
if (er) cb(er, null);
|
if (er) cb(er, null);
|
||||||
var packages = {};
|
var packages = {};
|
||||||
|
@ -107,14 +102,22 @@ exports.loadPlugin = function (packages, plugin_name, plugins, parts, cb) {
|
||||||
fs.readFile(
|
fs.readFile(
|
||||||
plugin_path,
|
plugin_path,
|
||||||
function (er, data) {
|
function (er, data) {
|
||||||
var plugin = JSON.parse(data);
|
if (er) {
|
||||||
plugin.package = packages[plugin_name];
|
console.error("Unable to load plugin definition file " + plugin_path);
|
||||||
plugins[plugin_name] = plugin;
|
return cb();
|
||||||
plugin.parts.forEach(function (part) {
|
}
|
||||||
part.plugin = plugin_name;
|
try {
|
||||||
part.full_name = plugin_name + "/" + part.name;
|
var plugin = JSON.parse(data);
|
||||||
parts[part.full_name] = part;
|
plugin.package = packages[plugin_name];
|
||||||
});
|
plugins[plugin_name] = plugin;
|
||||||
|
plugin.parts.forEach(function (part) {
|
||||||
|
part.plugin = plugin_name;
|
||||||
|
part.full_name = plugin_name + "/" + part.name;
|
||||||
|
parts[part.full_name] = part;
|
||||||
|
});
|
||||||
|
} catch (ex) {
|
||||||
|
console.error("Unable to parse plugin definition file " + plugin_path + ": " + ex.toString());
|
||||||
|
}
|
||||||
cb();
|
cb();
|
||||||
}
|
}
|
||||||
);
|
);
|
|
@ -36,7 +36,7 @@ var os = require('os');
|
||||||
var ROOT_DIR = path.normalize(__dirname + "/../" );
|
var ROOT_DIR = path.normalize(__dirname + "/../" );
|
||||||
var JS_DIR = ROOT_DIR + '../static/js/';
|
var JS_DIR = ROOT_DIR + '../static/js/';
|
||||||
var CSS_DIR = ROOT_DIR + '../static/css/';
|
var CSS_DIR = ROOT_DIR + '../static/css/';
|
||||||
var CACHE_DIR = ROOT_DIR + '../var/';
|
var CACHE_DIR = path.join(settings.root, 'var');
|
||||||
var TAR_PATH = path.join(__dirname, 'tar.json');
|
var TAR_PATH = path.join(__dirname, 'tar.json');
|
||||||
var tar = JSON.parse(fs.readFileSync(TAR_PATH, 'utf8'));
|
var tar = JSON.parse(fs.readFileSync(TAR_PATH, 'utf8'));
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ function _handle(req, res, jsFilename, jsFiles) {
|
||||||
//write the results plain in a file
|
//write the results plain in a file
|
||||||
function(callback)
|
function(callback)
|
||||||
{
|
{
|
||||||
fs.writeFile(CACHE_DIR + "minified_" + jsFilename, result, "utf8", callback);
|
fs.writeFile(CACHE_DIR + "/minified_" + jsFilename, result, "utf8", callback);
|
||||||
},
|
},
|
||||||
//write the results compressed in a file
|
//write the results compressed in a file
|
||||||
function(callback)
|
function(callback)
|
||||||
|
@ -171,7 +171,7 @@ function _handle(req, res, jsFilename, jsFiles) {
|
||||||
|
|
||||||
if(ERR(err, callback)) return;
|
if(ERR(err, callback)) return;
|
||||||
|
|
||||||
fs.writeFile(CACHE_DIR + "minified_" + jsFilename + ".gz", compressedResult, callback);
|
fs.writeFile(CACHE_DIR + "/minified_" + jsFilename + ".gz", compressedResult, callback);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
],callback);
|
],callback);
|
||||||
|
@ -189,12 +189,12 @@ function _handle(req, res, jsFilename, jsFiles) {
|
||||||
var pathStr;
|
var pathStr;
|
||||||
if(gzipSupport && os.type().indexOf("Windows") == -1)
|
if(gzipSupport && os.type().indexOf("Windows") == -1)
|
||||||
{
|
{
|
||||||
pathStr = path.normalize(CACHE_DIR + "minified_" + jsFilename + ".gz");
|
pathStr = path.normalize(CACHE_DIR + "/minified_" + jsFilename + ".gz");
|
||||||
res.header('Content-Encoding', 'gzip');
|
res.header('Content-Encoding', 'gzip');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pathStr = path.normalize(CACHE_DIR + "minified_" + jsFilename );
|
pathStr = path.normalize(CACHE_DIR + "/minified_" + jsFilename );
|
||||||
}
|
}
|
||||||
|
|
||||||
res.sendfile(pathStr, { maxAge: server.maxAge });
|
res.sendfile(pathStr, { maxAge: server.maxAge });
|
|
@ -23,6 +23,10 @@ var fs = require("fs");
|
||||||
var os = require("os");
|
var os = require("os");
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
var argv = require('./Cli').argv;
|
var argv = require('./Cli').argv;
|
||||||
|
var npm = require("npm/lib/npm.js");
|
||||||
|
|
||||||
|
/* Root path of the installation */
|
||||||
|
exports.root = path.normalize(path.join(npm.dir, ".."));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The IP ep-lite should listen to
|
* The IP ep-lite should listen to
|
||||||
|
@ -40,7 +44,7 @@ exports.dbType = "dirty";
|
||||||
/**
|
/**
|
||||||
* This setting is passed with dbType to ueberDB to set up the database
|
* This setting is passed with dbType to ueberDB to set up the database
|
||||||
*/
|
*/
|
||||||
exports.dbSettings = { "filename" : "../var/dirty.db" };
|
exports.dbSettings = { "filename" : path.join(exports.root, "var/dirty.db") };
|
||||||
/**
|
/**
|
||||||
* The default Text of a new pad
|
* The default Text of a new pad
|
||||||
*/
|
*/
|
||||||
|
@ -91,10 +95,12 @@ exports.abiwordAvailable = function()
|
||||||
|
|
||||||
// Discover where the settings file lives
|
// Discover where the settings file lives
|
||||||
var settingsFilename = argv.settings || "settings.json";
|
var settingsFilename = argv.settings || "settings.json";
|
||||||
var settingsPath = settingsFilename.charAt(0) == '/' ? '' : path.normalize(__dirname + "/../../");
|
if (settingsFilename.charAt(0) != '/') {
|
||||||
|
settingsFilename = path.normalize(path.join(root, settingsFilename));
|
||||||
|
}
|
||||||
|
|
||||||
//read the settings sync
|
//read the settings sync
|
||||||
var settingsStr = fs.readFileSync(settingsPath + settingsFilename).toString();
|
var settingsStr = fs.readFileSync(settingsFilename).toString();
|
||||||
|
|
||||||
//remove all comments
|
//remove all comments
|
||||||
settingsStr = settingsStr.replace(/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/gm,"").replace(/#.*/g,"").replace(/\/\/.*/g,"");
|
settingsStr = settingsStr.replace(/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/gm,"").replace(/#.*/g,"").replace(/\/\/.*/g,"");
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name" : "etherpad-lite",
|
"name" : "pluginomatic_etherpad-lite",
|
||||||
"description" : "A Etherpad based on node.js",
|
"description" : "A Etherpad based on node.js",
|
||||||
"homepage" : "https://github.com/Pita/etherpad-lite",
|
"homepage" : "https://github.com/Pita/etherpad-lite",
|
||||||
"keywords" : ["etherpad", "realtime", "collaborative", "editor"],
|
"keywords" : ["etherpad", "realtime", "collaborative", "editor"],
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 697 B After Width: | Height: | Size: 697 B |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 4 KiB After Width: | Height: | Size: 4 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 1,009 B After Width: | Height: | Size: 1,009 B |
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 494 B After Width: | Height: | Size: 494 B |
Before Width: | Height: | Size: 658 B After Width: | Height: | Size: 658 B |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 123 B After Width: | Height: | Size: 123 B |
Before Width: | Height: | Size: 131 B After Width: | Height: | Size: 131 B |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 182 B After Width: | Height: | Size: 182 B |
Before Width: | Height: | Size: 686 B After Width: | Height: | Size: 686 B |
Before Width: | Height: | Size: 517 B After Width: | Height: | Size: 517 B |