Permalink
Browse files

Master Branch Cleaning

  • Loading branch information...
1 parent db0922a commit 088623524fecc73ac2b35d7f3d5b2240d67d774c @tsjamm tsjamm committed Mar 6, 2013
Showing with 11 additions and 4,089 deletions.
  1. +0 −75 TestFiles/Backup/api_v1.js
  2. +0 −74 TestFiles/Backup/api_v2.js
  3. +0 −71 TestFiles/Backup/dbconnect_v1.js
  4. +0 −15 TestFiles/Backup/example.js
  5. +0 −42 TestFiles/Backup/mongodb.js
  6. +0 −29 TestFiles/api.js
  7. +0 −50 TestFiles/assassin/index.html
  8. +0 −90 TestFiles/assassin/index_style.css
  9. +0 −23 TestFiles/controllers/common.js
  10. +0 −66 TestFiles/controllers/dbfunctions.js
  11. +0 −53 TestFiles/controllers/dnsfunctions.js
  12. +0 −37 TestFiles/controllers/users.js
  13. +0 −38 TestFiles/dbconnect.js
  14. +0 −86 TestFiles/dbtest/index.html
  15. +0 −136 TestFiles/dbtest/testserver.js
  16. +0 −109 TestFiles/dbtest/testserver2.js
  17. +0 −40 TestFiles/example.js
  18. +0 −34 TestFiles/exampledb.js
  19. +0 −24 TestFiles/fileserver/contenttypelist.js
  20. +0 −70 TestFiles/fileserver/fileserver.js
  21. +0 −55 TestFiles/fileserver/fileserver2.js
  22. +0 −642 TestFiles/fileserver/filetypelist.txt
  23. BIN TestFiles/fileserver/fwdicons.zip
  24. +0 −59 TestFiles/fileserver/index.html
  25. +0 −179 TestFiles/fileserver/log.txt
  26. +0 −1 TestFiles/fileserver/run.sh
  27. +0 −2 TestFiles/fileserver/test.txt
  28. BIN TestFiles/fileserver/veoozloading.gif
  29. +0 −86 TestFiles/index.html
  30. +0 −10 TestFiles/index.js
  31. +0 −1,814 TestFiles/log.txt
  32. +0 −23 TestFiles/router.js
  33. +0 −56 TestFiles/testindex.htm
  34. 0 Integration/index.js → assassin.js
  35. 0 {Integration → }/controllers/controller.js
  36. 0 {Integration → }/controllers/extensions/common.js
  37. 0 {Integration → }/controllers/extensions/dbfunctions.js
  38. 0 {Integration → }/controllers/extensions/dnsfunctions.js
  39. 0 {Integration → }/controllers/extensions/users.js
  40. 0 {Integration → }/db/dbconnect.js
  41. 0 {Integration → }/fileserver/contenttypelist.js
  42. 0 {Integration → }/fileserver/fileserver.js
  43. 0 {Integration → }/fileserver/filetypelist.txt
  44. 0 {Integration → }/index.html
  45. +11 −0 package.json
  46. 0 {Integration → }/system/config.js
  47. 0 {Integration → }/system/config.txt
  48. 0 {Integration → }/system/log.txt
  49. 0 {Integration → }/system/logger.js
  50. 0 {Integration → }/system/router.js
  51. 0 {Integration → }/system/routes.txt
View
@@ -1,75 +0,0 @@
-var url = require('url');
-var dns = require('dns');
-
-function delegate(request,response)
-{
- var pathname = url.parse(request.url).pathname;
- console.log(pathname);
-
- switch(pathname)
- {
- case '/findip':
- findip(request,response);
- return;
- default:
- defaultEcho(request,response);
- }
-}
-
-function errorEcho(request,response)
-{
- response.writeHead(200,{'content-type':'text/plain'});
-
- var result = 'HTTP - '+request.httpVersion+'\nMethod - '+request.method+'\nURL - '+request.url+'\nHeader - '+request.header;
-
- var extra = 'Error - Method does not exist';
-
- response.write(result);
-
- response.end();
-}
-
-function defaultEcho(request,response)
-{
- response.writeHead(200,{'content-type':'text/plain'});
-
- var result = 'HTTP - '+request.httpVersion+'\nMethod - '+request.method+'\nURL - '+request.url+'\nHeader - '+request.header;
-
- response.write(result);
-
- response.end();
-}
-
-function findip(request,response)
-{
- var param1 = url.parse(request.url).query.split('=')[1];
-
- console.log('query = '+param1);
-
- dns.lookup(param1,function(err,ip){
-
- var result = 'HTTP - '+request.httpVersion+'\nMethod - '+request.method+'\nURL - '+request.url+'\nHeader - '+request.header;
-
- if(err)
- {
- result += '\n'+'Encountered Error - '+err;
- }
- else
- {
- result += '\n'+param1+' resolved to '+ip;
- }
-
- console.log(result);
-
- response.writeHead(200,{'content-type':'text/plain'});
-
- response.write(result);
-
- response.end();
-
- });
-
-}
-
-exports.delegate = delegate
-
View
@@ -1,74 +0,0 @@
-var url = require('url');
-var dns = require('dns');
-
-function delegate(request,response)
-{
- //different methods of the api
- this.errorEcho = function(request,response)
- {
- response.writeHead(200,{'content-type':'text/plain'});
- var result = 'HTTP - '+request.httpVersion+'\nMethod - '+request.method+'\nURL - '+request.url+'\nHeader - '+request.header;
- var extra = 'Error - Method does not exist';
- response.write(result+'\n'+extra);
- response.end();
-
- return;
- };
-
- this.defaultEcho = function(request,response)
- {
- response.writeHead(200,{'content-type':'text/plain'});
- var result = 'HTTP - '+request.httpVersion+'\nMethod - '+request.method+'\nURL - '+request.url+'\nHeader - '+request.header;
- response.write(result);
- response.end();
-
- return;
- };
-
- this.findip = function(request,response)
- {
- var param1 = url.parse(request.url).query.split('=')[1];
- console.log('query = '+param1);
-
- dns.lookup(param1,function(err,ip){
-
- var result = 'HTTP - '+request.httpVersion+'\nMethod - '+request.method+'\nURL - '+request.url+'\nHeader - '+request.header;
-
- if(err)
- {
- result += '\n'+'Encountered Error - '+err;
- }
- else
- {
- result += '\n'+param1+' resolved to '+ip;
- }
-
- console.log(result);
- response.writeHead(200,{'content-type':'text/plain'});
- response.write(result);
- response.end();
-
- });
-
- return;
- };
-
- //actual calling part
- var pathname = url.parse(request.url).pathname;
- console.log(pathname);
- console.log(this);
- var word = pathname.split('/')[1];
-
- if(typeof(this[word]) === 'function')
- {
- this[word](request,response);
- }
- else
- {
- this.errorEcho(request,response);
- }
-
-}
-
-exports.delegate = delegate
-
@@ -1,71 +0,0 @@
-var mongodb = require('mongodb');
-var MongoClient = mongodb.MongoClient;
-var Server = mongodb.Server
-var db_global = '';
-var collection = '';
-
-// Define options. Note poolSize.
-var serverOptions = {
- 'auto_reconnect': true,
- 'poolSize': 10
-};
-
-// Now create the server, passing our options.
-//var serv = new mongodb.Server('localhost', 27017, serverOptions);
-
-// At this point, there is no connection made to the server.
-
-// Create a handle to the Mongo database called 'myDB'.
-//var dbManager = new mongodb.Db('myDB', serv , {w:1});
-
-// NOW we initialize ALL 10 connections:
-//dbManager.open(function (error, db) {
- // Do something with the connection.
- // db_global = db;
- // collection = db.collection('nodethings');
-
- // Make sure to call db.close() when ALL connections need to be shut down.
- //db.close();
-//});
-
-var customMC = new MongoClient(new Server('localhost', 27017, serverOptions),{w:1});
-
-/*
-customMC.open(function(err, mongoClient) {
-
- db_global = mongoClient.db("myDB");
- collection = mongoClient.db("myDB").collection('nodethings');
- collection.find({name:'test'}).toArray(function(err,data){console.log(data)});
- //mongoClient.close();
-
-});
-*/
-
-function dbWrapper(method)
-{
- customMC.open(function(err, mongoclient){
-
- var db = mongoclient.db("myDB");
- collection = db.collection('nodethings');
-
- method();
-
- mongoclient.close();
-
- });
-}
-
-function getConnection()
-{
- return db_global;
-}
-
-function getCollection()
-{
- return collection;
-}
-
-exports.getConnection = getConnection;
-exports.getCollection = getCollection;
-exports.dbWrapper = dbWrapper;
-
@@ -1,15 +0,0 @@
-var http = require('http');
-
-var server = http.createServer();
-
-function handleRequest(req, res) {
- res.writeHead(200, { 'content-type': 'text/plain'});
- res.write('Hello World!');
- res.end();
-}
-
-server.on('request', handleRequest);
-
-server.listen(8080);
-
-console.log('Server running at http://127.0.0.1:8080/');
@@ -1,42 +0,0 @@
-var mongo = require('mongodb');
-var MongoClient = mongo.MongoClient;
-
-MongoClient.connect('mongodb://localhost:27017/test',
-
- function(err,db)
- {
- if(err)
- console.log(err);
- else
- console.log('Connected Successfully!');
-
- db.createCollection('testthings',{w:1},
- function(err,collection)
- {
- if(err)
- console.log(err);
- else
- console.log('Successfully created testthings collection');
- }
- );
-
- var collection = db.collection('testthings');
-
- var list = [];
-
- for(var i=1;i<=20;i++)
- {
- list.push({name:'node',type:'js',using:'mongodb',num:i});
- }
-
- collection.insert(list,{w:1},
- function(err,result)
- {
- if(err) console.log(err);
- else console.log(result);
- }
- );
-
- console.log(collection.find());
- }
-);
View
@@ -1,29 +0,0 @@
-var url = require('url');
-
-var controllers = [];
-controllers['dnsfunctions'] = require('./controllers/dnsfunctions');
-controllers['dbfunctions'] = require('./controllers/dbfunctions');
-controllers['common'] = require('./controllers/common');
-controllers['users'] = require('./controllers/users');
-
-function delegate(request,response)
-{
- //actual calling part
- var pathname = url.parse(request.url).pathname;
- console.log(pathname);
- console.log(this);
- var word = pathname.split('/')[1];
-
- if(typeof(controllers[word]) !== 'undefined')
- {
- controllers[word].forwardRequest(request,response);
- }
- else
- {
- controllers.common.errorEcho(request,response);
- }
-
-}
-
-exports.delegate = delegate
-
@@ -1,50 +0,0 @@
-<html>
-<head>
-<link rel="stylesheet" href="index_style.css" type="text/css" />
-</head>
-<body>
-
-<div id="bodyWrapper">
-
-<div id="headerWrapper">
-<div id="headerContent">
-AssassinJS
-</div>
-</div>
-<div id="contentWrapper">
-
-<div id="contentLeft">
-<div id="loginPanel">
-Login to Admin Panel:
-<form action="" method="GET">
-Username: <input type="text" name="username" id="loginUserNameBox" />
-Password: <input type="password" name="password" id="loginPasswordBox" />
-<button type="submit">Login</button>
-</form>
-</div>
-</div>
-<div id="contentRight">
-<div id="descriptionPanel">
-<p>Welcome to AssassinJS - An Access Control Framework written in Node.js. Assassin works almost like a real world assassin, only it assassinates unwanted incoming requests to your server. So don't worry, this assassin has your back :)</p>
-
-<p>AssassinJS can be used for more than just for assassinating requests. It can provide a security check on incoming requests based on filters that you specify. You can also format the data to be sent as responses with customised filters.</p>
-
-<p>A generic framework that provides a safe and friendly server environment. It has the functionality to be able to expose an api for developers to develop apps that consume your api. It has the potential to act as a firewall, or even as a proxy. And it can provide analytics to who is accessing what from your server.</p>
-
-<p>AssassinJS. The Secret Server Agent. At your service.</p>
-
-<p>(psst... Nothing is true, Everything is Permitted)</p>
-</div>
-</div>
-
-</div>
-<div id="footerWrapper">
-<div id="footerContent">
-(c)2013 Adithya Chebiyyam and Sai Teja Jammalamadaka
-</div>
-</div>
-
-</div>
-
-</body>
-</html>
Oops, something went wrong.

0 comments on commit 0886235

Please sign in to comment.