add LICENSE and COPYING; fix workaround for plantuml

version-1
Marc Wäckerlin 8 years ago
parent 709099dd21
commit d7955e5d0f
  1. 10
      ax_init_standard_project.m4
  2. 8
      nodejs/database/config.json
  3. 22
      nodejs/database/index.js
  4. 10
      nodejs/etc/safechat.json
  5. 37
      nodejs/package.json.in
  6. 4
      nodejs/public/javascripts/safechat.js
  7. 18
      nodejs/safechat.js

@ -7,7 +7,7 @@
m4_define([mrw_esyscmd_s], [m4_normalize(m4_esyscmd([$1]))]) m4_define([mrw_esyscmd_s], [m4_normalize(m4_esyscmd([$1]))])
# define least version number from subversion's revision number: # define least version number from subversion's revision number:
# it is taken modulo 256 due to a bug on Apple's MacOSX # it is taken modulo 256 due to a bug on Apple's SX
m4_define(x_least, m4_ifdef([x_least_fix], [x_least_fix], m4_define(x_least, m4_ifdef([x_least_fix], [x_least_fix],
m4_ifdef([x_least_diff], m4_ifdef([x_least_diff],
mrw_esyscmd_s([ mrw_esyscmd_s([
@ -191,6 +191,11 @@ AC_DEFUN([AX_INIT_STANDARD_PROJECT], [
_AM_SUBST_NOTMAKE([README_HTML]) _AM_SUBST_NOTMAKE([README_HTML])
AX_SUBST(DESCRIPTION) AX_SUBST(DESCRIPTION)
_AM_SUBST_NOTMAKE([DESCRIPTION]) _AM_SUBST_NOTMAKE([DESCRIPTION])
LICENSE=$(echo $(head -1 COPYING))
AX_SUBST(LICENSE)
COPYING=$(<COPYING)
AX_SUBST(COPYING)
_AM_SUBST_NOTMAKE([COPYING])
AUTHOR=$(head -1 AUTHORS) AUTHOR=$(head -1 AUTHORS)
AUTHOR_NAME=$(echo $AUTHOR | sed 's, *[[<(]].*$,,') AUTHOR_NAME=$(echo $AUTHOR | sed 's, *[[<(]].*$,,')
AUTHOR_URL=$(echo $AUTHOR | sed 's,.*(\(http[[^)]]*\)).*,\1,') AUTHOR_URL=$(echo $AUTHOR | sed 's,.*(\(http[[^)]]*\)).*,\1,')
@ -593,7 +598,8 @@ doc: doxyfile @NEED_PLANTUML_TRUE@ gen-uml-images
@NEED_PLANTUML_TRUE@ done @NEED_PLANTUML_TRUE@ done
clean-documentation: clean-documentation:
-rm doxygen.errors @PDF_DOC@ @NEED_PLANTUML_TRUE@ gen-uml-images -rm doxygen.errors @PDF_DOC@ @NEED_PLANTUML_TRUE@
@NEED_PLANTUML_TRUE@ -rm -rf gen-uml-images
distclean-documentation: distclean-documentation:
-rm -r html -rm -r html
-rm @PACKAGE_NAME@.doxytag -rm @PACKAGE_NAME@.doxytag

@ -1,8 +0,0 @@
{
"host" : "localhost",
"user" : "root",
"port" : 8654,
"password" : "ert456",
"database" : "safechat",
"max_allowed_packet": 1000000000
}

@ -1,13 +1,11 @@
module.exports = function() { module.exports = function(config) {
var mysql = require('mysql'); var mysql = require('mysql');
var fs = require('fs'); var fs = require('fs');
var config = require(__dirname+'/config.json'); config.multipleStatements = true;
config.multipleStatements = true; var pool = mysql.createPool(config);
var pool = mysql.createPool(config); console.log(__dirname+'/schema.sql')
pool.query(fs.readFileSync(__dirname+'/schema.sql').toString());
pool.query(fs.readFileSync(__dirname+'/schema.sql').toString()); if (config.max_allowed_packet)
if (config.max_allowed_packet) pool.query("set global max_allowed_packet=?", [config.max_allowed_packet]);
pool.query("set global max_allowed_packet=?", [config.max_allowed_packet]); return pool;
return pool;
}; };

@ -0,0 +1,10 @@
{
"mysql": {
"host" : "localhost",
"user" : "root",
"port" : 8654,
"password" : "ert456",
"database" : "safechat",
"max_allowed_packet": 1000000000
}
}

@ -1,12 +1,29 @@
{ {
"name": "@PACKAGE_NAME@", "name": "@PACKAGE_NAME@",
"version": "@PACKAGE_VERSION@", "version": "@PACKAGE_VERSION@",
"private": true, "private": true,
"dependencies": { "dependencies": {
"express": "2.5.8", "express": "2.5.8",
"stylus": ">= 0.0.1", "stylus": ">= 0.0.1",
"ejs": ">= 0.0.1", "ejs": ">= 0.0.1",
"mysql": "~2.10.2", "mysql": "~2.10.2",
"socket.io": "~1.4.4" "socket.io": "~1.4.4"
} },
"description": "@DESCRIPTION@",
"main": "@PACKAGE_NAME@.js",
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "@AUTHOR@",
"license": "@LICENSE@",
"path": {
"prefix": "@PREFIX@",
"sysconf": "@SYSCONFDIR@",
"pkgdata": "@PKGDATADIR@",
"localstate": "@LOCALSTATEDIR@",
"log": "@LOCALSTATEDIR@/log/@PACKAGE_NAME@.log",
"config": "@SYSCONFDIR@/@PACKAGE_NAME@.json",
"nodejs": "@PKGDATADIR@/nodejs"
}
} }

@ -657,7 +657,9 @@ function sendmessage(recv, txt) {
privkey.decrypt(password); // get own private key ready privkey.decrypt(password); // get own private key ready
var message = JSON.stringify({receiver: recv, text: txt, files: filecontent}); var message = JSON.stringify({receiver: recv, text: txt, files: filecontent});
notice("2/3 encrypting message …"); notice("2/3 encrypting message …");
openpgp.signAndEncryptMessage(key.keys.concat(publicKey().keys), privkey, message) openpgp.signAndEncryptMessage(key.keys.concat(publicKey().keys),
privkey,
message)
.then(function(msg) { // message is encrypted .then(function(msg) { // message is encrypted
notice("3/3 sending message …"); notice("3/3 sending message …");
emit("message", {user: userid(), content: msg}); emit("message", {user: userid(), content: msg});

@ -5,12 +5,26 @@
var express = require('express'), var express = require('express'),
routes = require(__dirname+'/routes'); routes = require(__dirname+'/routes');
var package = require(__dirname+'/package.json');
var config = require(package.path.config);
var app = module.exports = express.createServer(); var app = module.exports = express.createServer();
var io = require('socket.io').listen(app); var io = require('socket.io').listen(app);
var sql = require(__dirname+'/database')(); var sql = require(__dirname+'/database')(config.mysql);
var sockets = require(__dirname+'/sockets')(sql); var sockets = require(__dirname+'/sockets')(sql);
// Configuration // Configuration
process.argv.forEach(function(val, index) {
if (index<2) {return}
if (index!=2 || isNaN(val)) {
console.log("**** ERROR: Unexpected Argument - allowed is only a port number");
process.exit(1);
}
config.port = parseInt(val);
});
if (typeof config.port != 'number') {
console.log("**** WARNING: no valid port given, defaults to 8888");
config.port = 8888;
}
app.configure(function(){ app.configure(function(){
app.set('views', __dirname + '/views'); app.set('views', __dirname + '/views');
@ -38,6 +52,6 @@ io.sockets.on('connection', sockets.connection);
app.get('/', routes.index); app.get('/', routes.index);
app.listen(8888, function(){ app.listen(config.port, function(){
console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env); console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env);
}); });

Loading…
Cancel
Save