Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.
Universe edited this page May 13, 2019 · 2 revisions

Here's a guide on how to Configure NodeCp

The Default Config File:

{
  "port": 80,
  "title": "NodeCP",
  "baseURI": "cp",
  "accountCacheInterval": 30000,
  "allowRegister": true,
  "themes": [
    "dark",
    "light"
  ],
  "versions": {
    "showNode": false,
    "showNodeCP": true
  },
  "pincodeEnabled": false,
  "installerPassword": "nodecp",
  "NEWS": {
    "rss": true,
    "rssLink": "https://rathena.org/board/forum/9-community-news.xml",
    "limit": 5,
    "showOnHomePage": true
  },
  "recaptcha": {
    "enabled": false,
    "siteKey": "",
    "secretKey": ""
  },
  "cacheAge": 0,
  "secret": "ragnarok",
  "BirthDateYearMin": 1970,
  "PAGES": [
    {
      "type": "home",
      "name": "home"
    },
    {
      "type": "news",
      "name": "news"
    },
    {
      "type": "register",
      "name": "register"
    },
    {
      "type": "login",
      "name": "login"
    },
    {
      "type": "account",
      "name": "account"
    },
    {
      "type": "installer",
      "name": "installer"
    }
  ],
  "NAVS": [
    {
      "menu": "Main Menu",
      "items": [
        {
          "name": "Home",
          "href": "/",
          "showEvenIfLoggedIn": true
        },
        {
          "name": "News",
          "href": "/news",
          "showEvenIfLoggedIn": true
        }
      ]
    },
    {
      "menu": "Account",
      "items": [
        {
          "name": "Login",
          "href": "/login"
        },
        {
          "name": "Register",
          "href": "/register"
        },
        {
          "name": "View Account",
          "href": "/account",
          "mustbeLoggedIn": true
        },
        {
          "name": "Logout",
          "href": "/logout",
          "mustbeLoggedIn": true
        }
      ]
    }
  ],
  "databases": [
    {
      "name": "cp_credits",
      "query": "CREATE TABLE cp_credits (account_id int(11), balance int(11), last_donation_date datetime, last_donation_amount float)"
    },
    {
      "name": "cp_cmsnews",
      "query": "CREATE TABLE cp_cmsnews (id int(11), title varchar(100), body text, link varchar(100), author varchar(100), created datetime, modified datetime)"
    }
  ]
}

Config.port = The port to listen to, if you set it to 8080. You would be able to access the control panel at example.com:8080

Config.title = The title used in some parts of the Front End, example is for the Navbar and Web Page Title

Config.baseURI = The location where your control panel is located at. By default it's cp, so it would be accessible at example.com/cp

Config.accountCacheInterval = The amount of time before deleting mysql data cache (in ms).

Config.allowRegister = Whether or not to allow user registrations on your control panel.

Config.themes = An array of themes, names are based off of their folder names inside the /views/themes folder

Config.version = An object that contains version settings.
Config.version.showNode = Whether or not to show your NodeJS Version on the footer.
Config.version.showNodeCP = Whether or not to show your nodecp Version on the footer.

Config.pincodeEnabled = Whether or not the pincode system should be used when login/register.

Config.installerPassword = The password for the nodecp tables installer.

Config.NEWS = Options for RSS News Display.
Config.NEWS.rss = Whether or not to display RSS Feed.
Config.NEWS.rssLink = The link to where to get the rss feed.
Config.NEWS.limit = The maximum amount of RSS Feed to display.
Config.NEWS.showOnHomePage = Whether or not to show the RSS Feed on the Home Page.

Config.recaptcha = Options for the recaptcha settings. ( v2 Only )
Config.recaptcha.enabled = Whether or not to enable recaptcha upon register and login. (May be used for other features.)
Config.recaptcha.siteKey = The site key (public key) for your recaptcha.
Config.recaptcha.secretKey = The secret key (private key) for your recaptcha.

Config.cacheAge = The amount of time (in ms) before cache gets deleted. Anything less than 0 is considered Infinite. This also affects theme display.

Config.secret = The secret for cookies.

Config.BirthDateYearMin = The minimum year for birthdates.

Config.PAGES = The options for pages.
Config.PAGES.name = The name of the page, the file name inside the pages folder.
Config.PAGES.type = The type of the page, used to find the name of the page. Used inside the public folder. Example: <%- include('../partials/page', { type: 'home' }); %>

Config.NAVS = The options for the navbar.
Config.NAVS.menu = The menu/category name that contains the items.
Config.NAVS.items = The items that would be shown in the category.
Config.NAVS.items.showEvenIfLoggedIn = Whether or not to show the item even if your are logged in.
Config.NAVS.items.mustBeLoggedin = Whether or not to show the item only if you are logged in.
Config.NAVS.items.name = The name of the item.
Config.NAVS.items.href = The location of the item.

Config.databases = The options for the custom database tables
Config.databases.name = The name of the table.
Config.database.query = The MYSQL Query to run when installing the table.

Clone this wiki locally