<commit_before>// requires
var express = require('express');
app = express();
var server = require('http').createServer(app),
  io = require('socket.io').listen(server),
  path = require('path'),
  fs = require('fs'),
  path = require('path'),
  ejs = require('ejs-locals'),
  childprocs = require('./lib/childprocs'),
  os = require('os');
// ideino config
//ST find ip addresses
var interfaces = os.networkInterfaces();
var addresses = [];
for (k in interfaces) {
    for (k2 in interfaces[k]) {
        var address = interfaces[k][k2];
        if (address.family == 'IPv4' && !address.internal) {
            addresses.push(address.address)
        }
    }
}
if(addresses.length == 0){
	addresses.push("localhost");
}
//ST find ip addresses


var ideinoConfig = {};
if (fs.existsSync('./ideino.json')) {
  ideinoConfig = require('./ideino.json');
}
// set up default prj dir - used in the absence of a 'path' query string
if (!ideinoConfig.projectsDir) ideinoConfig.projectsDir = path.join(__dirname, 'ideino/projects/user');
if (!ideinoConfig.templatesDir) ideinoConfig.templatesDir = path.join(__dirname, 'ideino/templates')
//ST: changing loopback or localhost to real ip address
if (!ideinoConfig.framesUrl1) ideinoConfig.framesUrl1 = "http://"+addresses[0]+":3000";
if (!ideinoConfig.framesUrl2) ideinoConfig.framesUrl2 = "http://"+addresses[0]+":8080/debug?port=5858";
//ST: changing loopback or localhost to real ip address

app.set('ideinoConfig', ideinoConfig);
// initialize locals
app.locals({
  metaTitle: 'Ideino',
  templates: fs.readFileSync('./public/html/templates.html')
});
// register .html extension
app.engine('html', ejs);
// configure
var port = process.env.PORT || 2424;
var sessionStore = new express.session.MemoryStore({
  reapInterval: 60000 * 10
});
app.configure(function() {
  app.use(express.favicon( path.join(__dirname,'/public/favicon.ico'))); 
  app.set('port', port);
  app.set('views', path.join(__dirname, 'views'));
  app.set('view engine', 'html');
  app.use(express.cookieParser());
  app.use(express.session({
    store: sessionStore,
    secret: '5up3453c43t',
    key: 'sid'
  }));
  app.use(express.bodyParser());
  app.use(express.methodOverride());
  app.use(express.favicon());
  app.use(express.compress());
  if (ideinoConfig.users) {
    app.use(express.basicAuth(function(user, pass, callback) {<commit_msg>change template file path from relative to absolute<commit_after>// requires
var express = require('express');
app = express();
var server = require('http').createServer(app),
  io = require('socket.io').listen(server),
  path = require('path'),
  fs = require('fs'),
  path = require('path'),
  ejs = require('ejs-locals'),
  childprocs = require('./lib/childprocs'),
  os = require('os');
// ideino config
//ST find ip addresses
var interfaces = os.networkInterfaces();
var addresses = [];
for (k in interfaces) {
    for (k2 in interfaces[k]) {
        var address = interfaces[k][k2];
        if (address.family == 'IPv4' && !address.internal) {
            addresses.push(address.address)
        }
    }
}
if(addresses.length == 0){
	addresses.push("localhost");
}
//ST find ip addresses


var ideinoConfig = {};
if (fs.existsSync('./ideino.json')) {
  ideinoConfig = require('./ideino.json');
}
// set up default prj dir - used in the absence of a 'path' query string
if (!ideinoConfig.projectsDir) ideinoConfig.projectsDir = path.join(__dirname, 'ideino/projects/user');
if (!ideinoConfig.templatesDir) ideinoConfig.templatesDir = path.join(__dirname, 'ideino/templates')
//ST: changing loopback or localhost to real ip address
if (!ideinoConfig.framesUrl1) ideinoConfig.framesUrl1 = "http://"+addresses[0]+":3000";
if (!ideinoConfig.framesUrl2) ideinoConfig.framesUrl2 = "http://"+addresses[0]+":8080/debug?port=5858";
//ST: changing loopback or localhost to real ip address

app.set('ideinoConfig', ideinoConfig);
// initialize locals
app.locals({
  metaTitle: 'Ideino',
  templates: fs.readFileSync(path.join(__dirname,'./public/html/templates.html'))
});
// register .html extension
app.engine('html', ejs);
// configure
var port = process.env.PORT || 2424;
var sessionStore = new express.session.MemoryStore({
  reapInterval: 60000 * 10
});
app.configure(function() {
  app.use(express.favicon( path.join(__dirname,'/public/favicon.ico'))); 
  app.set('port', port);
  app.set('views', path.join(__dirname, 'views'));
  app.set('view engine', 'html');
  app.use(express.cookieParser());
  app.use(express.session({
    store: sessionStore,
    secret: '5up3453c43t',
    key: 'sid'
  }));
  app.use(express.bodyParser());
  app.use(express.methodOverride());
  app.use(express.favicon());
  app.use(express.compress());
  if (ideinoConfig.users) {
    app.use(express.basicAuth(function(user, pass, callback) {
{'fraction_non_alphanumeric': 0.17380405264257365, 'fraction_numerical': 0.016711928138709004, 'mean_word_length': 4.548088064889919, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3963534', 'n_tokens_mistral': 1585, 'n_tokens_neox': 1522, 'n_words': 343}