<commit_before>'use strict';

var path = require('path');
var fs = require('fs');
var _ = require('lodash');

var CONFIG_DIR = path.join(__dirname, '..');
var TAGS_BLACKLIST_PATH = path.join(CONFIG_DIR, 'tags-blacklist.txt');
var tagsBlacklist = fs.readFileSync(TAGS_BLACKLIST_PATH);
// Get the content, replace windows new-lines and split on new-lines.
tagsBlacklist = tagsBlacklist.toString().replace(/(\r\n|\n|\r)/gm,'\n').split('\n');

var cipCatalogs = require('../cip-catalogs.json');
var generatedDir = path.join(__dirname, '..', '..', 'generated');
var appDir = path.join(__dirname, '..', '..', 'app');

module.exports = {
  //root: rootPath,
  ip:   process.env.IP || '0.0.0.0',
  port: process.env.PORT || 9000,
  allowRobots: true,
  appDir: appDir,
  appName: 'KBH Billeder',
  // A list of directories to look for static files and /views
  appPaths: [
    generatedDir,
    appDir
  ],
  // Elasticsearch
  es: {
    host: process.env.ES_HOST || 'localhost:9200',
    assetsIndex: process.env.ES_ASSETS_INDEX || 'assets',
    log: 'error'
  },
  // CIP
  cip: {
    baseURL: 'http://www.neaonline.dk/CIP',
    username: process.env.CIP_USERNAME,
    password: <PASSWORD>,
    proxyMaxSockets: 10,
    // rotationCategoryName: 'Rotationsbilleder', // TODO: Disable in indexing.
    indexing: {
      additionalFields: null, // Place additional fields to be indexed here ..
      restriction: null, // '{some-guid} is 3'
      inheritMetadata: false,
      transformationsModule: path.join(__dirname, '..', '..', 'indexing', 'transformations')
    },
    catalogs: cipCatalogs,
    client: {
      endpoint: 'http://www.neaonline.dk/CIP/',
      constants: {
          catchAllAlias: "alle",
          layoutAlias: "stadsarkivet"
      },
      catalogAliases: _.invert(cipCatalogs)
    },
    sessionRenewalRate: 30*60*1000 // Once every 30 minutes
  },
  features: {
    cookieConsent: true,
    cookieName: 'kbh-billeder-ok-cookie',
    geotagging: false,
    rotationalImages: false,
    crowdtagging: false,
    clientSideSearchResultRendering: true,
    filterSidebar: true,
    watermarks: true
  },
  generatedDir: generatedDir,
  googleAnalyticsPropertyID: null,
  // googleMapsAPIKey: '',
  googleAPIKey: process.env.GOOGLE_API_KEY,
  projectOxfordAPIKey: process.env.PROJECT_OXFORD_API_KEY,
  categoryBlacklist: require('../category-blacklist.js'),
  filterOptions: require('../filter-options.json'),
  sortOptions: require('../sort-options.json'),
  assetFields: require('../asset-fields.json'),
  licenseMapping: require('../license-mapping.json'),
  searchPath: 'søg',
  tagsBlacklist: tagsBlacklist,
  themeColor: '#262626',
  thumbnailSizes: ['lille', 'mellem', 'stor', 'originalJPEG', 'original'],
  types: {
    asset: {
      layout: require('../layouts/asset.json')
    }
  },
  twitterAccount: {
    'kbh-arkiv': 'kbharkiv',
    'kbh-museum': 'kbenhavnsmuseum'
  },
  watermarks: {
    'kbh-museum': path.join(appDir, 'images', 'watermarks', 'kbh-museum.png'),
    'kbh-arkiv': path.join(appDir, 'images', 'watermarks', 'kbh-arkiv.png')
  },
   // Found using https://developers.facebook.com/tools/explorer
  facebookAppId: {
    'kbh-arkiv': 159598384220080,
    'kbh-museum': 116055131754566
  },
  cloudinaryUrl: process.env.CLOUDINARY_URL || false
};<commit_msg>Made the asset index explicit<commit_after>'use strict';

var path = require('path');
var fs = require('fs');
var _ = require('lodash');

var CONFIG_DIR = path.join(__dirname, '..');
var TAGS_BLACKLIST_PATH = path.join(CONFIG_DIR, 'tags-blacklist.txt');
var tagsBlacklist = fs.readFileSync(TAGS_BLACKLIST_PATH);
// Get the content, replace windows new-lines and split on new-lines.
tagsBlacklist = tagsBlacklist.toString().replace(/(\r\n|\n|\r)/gm,'\n').split('\n');

var cipCatalogs = require('../cip-catalogs.json');
var generatedDir = path.join(__dirname, '..', '..', 'generated');
var appDir = path.join(__dirname, '..', '..', 'app');

module.exports = {
  //root: rootPath,
  ip:   process.env.IP || '0.0.0.0',
  port: process.env.PORT || 9000,
  allowRobots: true,
  appDir: appDir,
  appName: 'KBH Billeder',
  // A list of directories to look for static files and /views
  appPaths: [
    generatedDir,
    appDir
  ],
  // Elasticsearch
  es: {
    host: process.env.ES_HOST || 'localhost:9200',
    assetsIndex: process.env.ES_ASSETS_INDEX || 'assets',
    log: 'error'
  },
  // CIP
  cip: {
    baseURL: 'http://www.neaonline.dk/CIP',
    username: process.env.CIP_USERNAME,
    password: <PASSWORD>,
    proxyMaxSockets: 10,
    // rotationCategoryName: 'Rotationsbilleder', // TODO: Disable in indexing.
    indexing: {
      additionalFields: null, // Place additional fields to be indexed here ..
      restriction: null, // '{some-guid} is 3'
      inheritMetadata: false,
      transformationsModule: path.join(__dirname, '..', '..', 'indexing', 'transformations')
    },
    catalogs: cipCatalogs,
    client: {
      endpoint: 'http://www.neaonline.dk/CIP/',
      constants: {
          catchAllAlias: "alle",
          layoutAlias: "stadsarkivet"
      },
      catalogAliases: _.invert(cipCatalogs)
    },
    sessionRenewalRate: 30*60*1000 // Once every 30 minutes
  },
  features: {
    cookieConsent: true,
    cookieName: 'kbh-billeder-ok-cookie',
    geotagging: false,
    rotationalImages: false,
    crowdtagging: false,
    clientSideSearchResultRendering: true,
    filterSidebar: true,
    watermarks: true
  },
  generatedDir: generatedDir,
  googleAnalyticsPropertyID: null,
  // googleMapsAPIKey: '',
  googleAPIKey: process.env.GOOGLE_API_KEY,
  projectOxfordAPIKey: process.env.PROJECT_OXFORD_API_KEY,
  categoryBlacklist: require('../category-blacklist.js'),
  filterOptions: require('../filter-options.json'),
  sortOptions: require('../sort-options.json'),
  assetFields: require('../asset-fields.json'),
  licenseMapping: require('../license-mapping.json'),
  searchPath: 'søg',
  tagsBlacklist: tagsBlacklist,
  themeColor: '#262626',
  thumbnailSizes: ['lille', 'mellem', 'stor', 'originalJPEG', 'original'],
  types: {
    asset: {
      layout: require('../layouts/asset.json'),
      index: 'kbh-billeder-assets'
    }
  },
  twitterAccount: {
    'kbh-arkiv': 'kbharkiv',
    'kbh-museum': 'kbenhavnsmuseum'
  },
  watermarks: {
    'kbh-museum': path.join(appDir, 'images', 'watermarks', 'kbh-museum.png'),
    'kbh-arkiv': path.join(appDir, 'images', 'watermarks', 'kbh-arkiv.png')
  },
   // Found using https://developers.facebook.com/tools/explorer
  facebookAppId: {
    'kbh-arkiv': 159598384220080,
    'kbh-museum': 116055131754566
  },
  cloudinaryUrl: process.env.CLOUDINARY_URL || false
};
{'fraction_non_alphanumeric': 0.16335740072202165, 'fraction_numerical': 0.018351383874849577, 'mean_word_length': 3.5509924709103355, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 2, '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': '66268', 'n_tokens_mistral': 2386, 'n_tokens_neox': 2296, 'n_words': 440}