<commit_before>(function () {
  "use strict";

  var _ = require('underscore');

// TODO create random secrets for cryptKey and jwtSecret
  var config = require('./keepass-node-config');
  config = _.extend({
                      databaseDir: __dirname + '/local/',
                      publicResourcesDir: __dirname + '/public/',

                      cryptKey: 'TODO__shhhhhhared-cryptKey',
                      jwtSecret: 'TODO__shhhhhhared-secret',
                      jwtUserProperty: 'jwt'
                    }, config);

  var keepassLib = require('./lib');

  var express = require('express');
  var app = express();

  app.use(require("compression")());

  if (config.basicAuth && config.basicAuth.enabled) {
    app.use(express.basicAuth(function (user, pass, callback) {
      var isValid = (user === basicAuth.username && pass === basicAuth.password);
      callback(null /* error */, isValid);
    }));
  }

  if (config.googleDrive && config.googleDrive.enabled) {
    var googleDrive = keepassLib.GoogleDrive('/update', config.googleDrive);
    app.use('/update', googleDrive);
  }

  app.use(keepassLib.Backend(config));

  if (config.https && config.https.enabled) {
    var https = require('https');
    https.createServer(config.https.options, app).listen(config.port);<commit_msg>generate random encryption keys/secrets<commit_after>(function () {
  "use strict";

  var _ = require('underscore');
  var crypto = require('crypto');

  var cryptKey = crypto.randomBytes(256).toString('hex');
  var jwtSecret = crypto.randomBytes(256).toString('hex');

  var config = require('./keepass-node-config');
  config = _.extend({
                      databaseDir: __dirname + '/local/',
                      publicResourcesDir: __dirname + '/public/',

                      cryptKey: cryptKey,
                      jwtSecret: jwtSecret,
                      jwtUserProperty: 'jwt'
                    }, config);

  var keepassLib = require('./lib');

  var express = require('express');
  var app = express();

  app.use(require("compression")());

  if (config.basicAuth && config.basicAuth.enabled) {
    app.use(express.basicAuth(function (user, pass, callback) {
      var isValid = (user === basicAuth.username && pass === <PASSWORD>Auth.password);
      callback(null /* error */, isValid);
    }));
  }

  if (config.googleDrive && config.googleDrive.enabled) {
    var googleDrive = keepassLib.GoogleDrive('/update', config.googleDrive);
    app.use('/update', googleDrive);
  }

  app.use(keepassLib.Backend(config));

  if (config.https && config.https.enabled) {
    var https = require('https');
    https.createServer(config.https.options, app).listen(config.port);
{'fraction_non_alphanumeric': 0.1513133555308916, 'fraction_numerical': 0.0022197558268590455, 'mean_word_length': 2.760778859527121, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '4567671', 'n_tokens_mistral': 800, 'n_tokens_neox': 749, 'n_words': 153}