Skip to content
Closed
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
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,11 @@ Here is the **[FAQ](https://github.com/Pita/etherpad-lite/wiki/FAQ)**
<li>Move into the node folder <code>cd node-v0.6*</code> and build node with <code>./configure && make && make install</code></li>
</ol>
</li>
<li>Install npm <code>curl http://npmjs.org/install.sh | sh</code></li>
</ol>

**As any user (we recommend creating a separate user called etherpad-lite):**

<ol start="4">
<ol start="3">
<li>Move to a folder where you want to install Etherpad Lite. Clone the git repository <code>git clone 'git://github.com/Pita/etherpad-lite.git'</code><br>&nbsp;</li>
<li>Install the dependencies with <code>bin/installDeps.sh</code><br>&nbsp;</li>
<li>Start it with <code>bin/run.sh</code><br>&nbsp;</li>
Expand Down Expand Up @@ -115,8 +114,8 @@ You also help the project, if you only host a Etherpad Lite instance and share y
# Modules created for this project

* [ueberDB](https://github.com/Pita/ueberDB) "transforms every database into a object key value store" - manages all database access
* [doc.md](https://github.com/Pita/doc.md) "A simple JSDoc documentation tool that creates markdown for node.js modules exports" - is used to generate the docs
* [channels](https://github.com/Pita/channels) "Event channels in node.js" - ensures that ueberDB operations are atomic and in series for each key
* [async-stacktrace](https://github.com/Pita/async-stacktrace) "Improves node.js stacktraces and makes it easier to handle errors"

# License
[Apache License v2](http://www.apache.org/licenses/LICENSE-2.0.html)
2 changes: 1 addition & 1 deletion bin/buildForWindows.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

NODE_VERSION="0.6.1"
NODE_VERSION="0.6.5"

#Move to the folder where ep-lite is installed
cd `dirname $0`
Expand Down
133 changes: 133 additions & 0 deletions bin/checkPad.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
/*
This is a debug tool. It checks all revisions for data corruption
*/

if(process.argv.length != 3)
{
console.error("Use: node checkPad.js $PADID");
process.exit(1);
}
//get the padID
var padId = process.argv[2];

//initalize the database
var log4js = require("log4js");
log4js.setGlobalLogLevel("INFO");
var async = require("async");
var db = require('../node/db/DB');
var Changeset = require('../node/utils/Changeset');
var padManager;

async.series([
//intallize the database
function (callback)
{
db.init(callback);
},
//get the pad
function (callback)
{
padManager = require('../node/db/PadManager');

padManager.doesPadExists(padId, function(err, exists)
{
if(!exists)
{
console.error("Pad does not exist");
process.exit(1);
}

padManager.getPad(padId, function(err, _pad)
{
pad = _pad;
callback(err);
});
});
},
function (callback)
{
//create an array with key kevisions
//key revisions always save the full pad atext
var head = pad.getHeadRevisionNumber();
var keyRevisions = [];
for(var i=0;i<head;i+=100)
{
keyRevisions.push(i);
}

//run trough all key revisions
async.forEachSeries(keyRevisions, function(keyRev, callback)
{
//create an array of revisions we need till the next keyRevision or the End
var revisionsNeeded = [];
for(var i=keyRev;i<=keyRev+100 && i<=head; i++)
{
revisionsNeeded.push(i);
}

//this array will hold all revision changesets
var revisions = [];

//run trough all needed revisions and get them from the database
async.forEach(revisionsNeeded, function(revNum, callback)
{
db.db.get("pad:"+padId+":revs:" + revNum, function(err, revision)
{
revisions[revNum] = revision;
callback(err);
});
}, function(err)
{
if(err)
{
callback(err);
return;
}

//check if the pad has a pool
if(pad.pool === undefined )
{
console.error("Attribute pool is missing");
process.exit(1);
}

//check if there is a atext in the keyRevisions
if(revisions[keyRev] === undefined || revisions[keyRev].meta === undefined || revisions[keyRev].meta.atext === undefined)
{
console.error("No atext in key revision " + keyRev);
callback();
return;
}

var apool = pad.pool;
var atext = revisions[keyRev].meta.atext;

for(var i=keyRev+1;i<=keyRev+100 && i<=head; i++)
{
try
{
//console.log("check revision " + i);
var cs = revisions[i].changeset;
atext = Changeset.applyToAText(cs, atext, apool);
}
catch(e)
{
console.error("Bad changeset at revision " + i + " - " + e.message);
callback();
return;
}
}

callback();
});
}, callback);
}
], function (err)
{
if(err) throw err;
else
{
console.log("finished");
process.exit(0);
}
});
24 changes: 0 additions & 24 deletions bin/generateJsDoc.sh

This file was deleted.

6 changes: 3 additions & 3 deletions bin/installDeps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ hash curl > /dev/null 2>&1 || {

#Is node installed?
hash node > /dev/null 2>&1 || {
echo "Please install node.js ( http://nodesjs.org )" >&2
echo "Please install node.js ( http://nodejs.org )" >&2
exit 1
}

Expand All @@ -28,8 +28,8 @@ hash npm > /dev/null 2>&1 || {

#check npm version
NPM_VERSION=$(npm --version)
if [ ! $(echo $NPM_VERSION | cut -d "." -f 1-2) = "1.0" ]; then
echo "You're running a wrong version of npm, you're using $NPM_VERSION, we need 1.0.x" >&2
if [ ! $(echo $NPM_VERSION | cut -d "." -f 1) = "1" ]; then
echo "You're running a wrong version of npm, you're using $NPM_VERSION, we need 1.x" >&2
exit 1
fi

Expand Down
2 changes: 0 additions & 2 deletions doc/jsdoc/README.md

This file was deleted.

53 changes: 0 additions & 53 deletions doc/jsdoc/db/AuthorManager.md

This file was deleted.

20 changes: 0 additions & 20 deletions doc/jsdoc/db/DB.md

This file was deleted.

13 changes: 0 additions & 13 deletions doc/jsdoc/db/Pad.md

This file was deleted.

14 changes: 0 additions & 14 deletions doc/jsdoc/db/PadManager.md

This file was deleted.

21 changes: 0 additions & 21 deletions doc/jsdoc/db/ReadOnlyManager.md

This file was deleted.

7 changes: 0 additions & 7 deletions doc/jsdoc/easysync_tests.md

This file was deleted.

16 changes: 0 additions & 16 deletions doc/jsdoc/handler/ExportHandler.md

This file was deleted.

15 changes: 0 additions & 15 deletions doc/jsdoc/handler/ImportHandler.md

This file was deleted.

Loading