When installing your own self-hosted version of the jsHarmony CMS, you may need to customize the System Config in app.config.js:

  • app.config.js should be committed to the source code repository, with shared system settings
  • app.config.local.js should not be committed to the repo, and should contain settings specific to the local instance

Learn more about the app.config.js file names and load priority in the jsHarmony Directory Structure reference.

The jsHarmony framework uses the app.config.js file to configure the database connection, mail server, and other system settings.  A full reference of jsHarmony config settings can be found in the jsHarmony Application Config reference.

In addition to the jsHarmony settings, the jsHarmony CMS has the following additional configuration options:

//CMS Configuration
var configCMS = config.modules['jsHarmonyCMS'];


  configCMS.git = {
    enabled: false,
    bin_path: '',
    ssh_command: 'ssh -o StrictHostKeyChecking=no -o IdentitiesOnly=yes -o PreferredAuthentications=publickey -o IdentityFile="%%%IDENTITYFILE%%%"',

  configCMS.sftp = {
    enabled: false,
    serverPort: 22,
    serverIp: '',
    clientIp: [''],  /* ex. '', '', ... */

    serverKey: undefined,     // path/to/key.pem
                              //   If undefined, HTTPS Key from main CMS site will be used

    serverUrl: undefined,     // SFTP Server client-facing URL, ex. sftp://example.com:22
                              //   If not set, hostname will be auto-detected from CMS site hostname

  configCMS.preview_server = {
    enabled: false,
    serverPort: 8088,
    serverIp: '',
    serverUrl: undefined,       // Preview Server client-facing URL, ex. https://example.com:8088
                                //   If not set, hostname will be auto-detected from CMS site hostname

    serverHttpsKey: undefined,  // path/to/https-key.pem
                                //   If undefined, HTTPS Key / Cert / CA from main CMS site will be used
                                //   If set to false, HTTP will be used instead of HTTPS
    serverHttpsCert: undefined, // path/to/https-cert.pem
    serverHttpsCa: undefined,   // path/to/https-ca.pem

  configCMS.media_thumbnails = {  //Media Thumbnail Configuration.  See "Site Config" documentation for syntax
    file_tile: { resize: [150, 150], format: "jpg" },
    file_preview: { resize: [300, 300], format: "jpg" },
    small: { resize: [512, 384] },
    medium: { resize: [1024, 768] },
    large: { resize: [2048, 1538] },
    //maximum: { resize: [2048, 1538] }, //(Optional maximum image size)

  configCMS.template_variables = {
    //Default template variables

  configCMS.redirect_listing_path = null;  //Default path where redirects will be exported by a site component
                                           //* Path should be relative to deployment target URL Prefix

  configCMS.deployment_target_publish_config = {
    //Default deployment target publish config

  configCMS.deploymentJobDelay = (1000 * 15);

  configCMS.debug_params = {
    no_cache_client_js: false,          //Do not cache jsHarmonyCMS.js, always reload from disk
    auto_restart_failed_publish: false, //Do not cancel failed publish - instead auto-restart
    no_publish_complete: false,         //Leave publish in 'RUNNING' (for debugging, so that it will auto-restart with auto_restart_failed_publish flag)
    sftp_log: false,                    //Log SFTP session

  configCMS.defaultEditorConfig = {   //Default GUI page editor config
    webSnippetsPath: undefined,  //Web snippets listing path - defaults to PREVIEW_SERVER/templates/websnippets/
    materialIcons: false,        //Whether to enable Material Icons in the Editor
                                 //  If enabled, Material Icons Font CSS Link must be added to the Page Template HTML

  configCMS.showLocalTemplatePaths = true;   //Display local template file system paths in Site Templates Administration

  configCMS.onRender = null; //function(target, content, callback){ return callback(new_content); }  //target = 'editor', 'publish'
  configCMS.onRouteLinkBrowser = null; //function(jsh, req, res, model, callback){ return callback(); } //callback(false) to stop further processing
  configCMS.onReplaceBranchURL = null; //function(url, branchData, getLinkContent, addUrlSuffix, options){ return url; } //return a value (not undefined) to stop processing
  configCMS.onDeploy_LoadData = null; //function(jsh, branchData, template_variables, callback){ return callback(err); }
  configCMS.onValidate_LoadData = null; //function(jsh, branchData, template_variables, callback){ return callback(err); }
  configCMS.onDeploy_GenerateRedirects = null; //function(jsh, branchData, template_variables, callback){ return callback(err, generated_redirect_files); }
                                          //    generated_redirect_files = { 'path1': 'file content1', 'path2': 'file content2' }
  configCMS.onDeploy_PostBuild = null; //function(jsh, branchData, template_variables, callback){ return callback(err); }