<commit_before>var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var i18n = require('i18n-express');
var compression = require('compression');
var minifyTemplate = require('express-beautify').minify;
var minifyCSS = require('express-minify');

var passport = require('passport');
var flash = require('connect-flash');
var helmet = require('helmet');
var session = require('express-session');

var MongoDBStore = require('connect-mongodb-session')(session);
var LocalStrategy = require('passport-local').Strategy;

var index = require('./routes/index');
var files = require('./routes/files-api');
var users = require('./routes/users-api');

var app = express();

// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');

if (app.get('env') === 'development') {
  app.use(logger('dev'));
} else {
  app.use(compression());
  app.use(minifyTemplate());
  app.use(minifyCSS());
}

app.use(express.static(path.join(__dirname, 'public')));

app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());

app.use(i18n({
  translationsPath: path.join(__dirname, 'i18n'),
  cookieLangName: 'language',
  paramLangName: 'lang',
  siteLangs: ['en','fr']
}));

app.use(helmet());
app.use(flash());
app.use(session({
    secret: 'just learn faster',
    name: 'flydocument-encrypted-session',
    proxy: false,
    resave: true,
    saveUninitialized: true,
    store: new MongoDBStore({
      uri: 'mongodb://localhost:27017/flydocument',
      collection: 'sessions'
    })
}));

app.use(passport.initialize());<commit_msg>Change secret for session cookie<commit_after>var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var i18n = require('i18n-express');
var compression = require('compression');
var minifyTemplate = require('express-beautify').minify;
var minifyCSS = require('express-minify');

var passport = require('passport');
var flash = require('connect-flash');
var helmet = require('helmet');
var session = require('express-session');

var MongoDBStore = require('connect-mongodb-session')(session);
var LocalStrategy = require('passport-local').Strategy;

var index = require('./routes/index');
var files = require('./routes/files-api');
var users = require('./routes/users-api');

var app = express();

// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');

if (app.get('env') === 'development') {
  app.use(logger('dev'));
} else {
  app.use(compression());
  app.use(minifyTemplate());
  app.use(minifyCSS());
}

app.use(express.static(path.join(__dirname, 'public')));

app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());

app.use(i18n({
  translationsPath: path.join(__dirname, 'i18n'),
  cookieLangName: 'language',
  paramLangName: 'lang',
  siteLangs: ['en','fr']
}));

app.use(helmet());
app.use(flash());
app.use(session({
    secret: 'send encrypted document',
    name: 'flydocument-encrypted-session',
    proxy: false,
    resave: true,
    saveUninitialized: true,
    store: new MongoDBStore({
      uri: 'mongodb://localhost:27017/flydocument-encrypted',
      collection: 'sessions'
    })
}));

app.use(passport.initialize());
{'fraction_non_alphanumeric': 0.19298245614035087, 'fraction_numerical': 0.007017543859649123, 'mean_word_length': 5.713768115942029, 'pattern_counts': {'":': 0, '<': 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': '2899820', 'n_tokens_mistral': 1201, 'n_tokens_neox': 1177, 'n_words': 243}