Server Configuration Reference - The gingee.json File

The gingee.json file is the master configuration file for the entire Gingee server instance. It resides in the root of your project and controls server behavior, caching policies, logging, and security settings that apply to all applications running on the platform.

Here is a comprehensive breakdown of all available properties.

{
  "server": {
    "http": { "enabled": true, "port": 7070 },
    "https": { 
      "enabled": false, 
      "port": 7443,
      "key_file": "./settings/ssl/key.pem",
      "cert_file": "./settings/ssl/cert.pem"
    }
  },
  "web_root": "./web",
  "default_app": "glade",
  "cache": {
    "provider": "memory",
    "prefix": "gingee:",
    "redis": {
      "host": "127.0.0.1",
      "port": 6379,
      "password": null
    }
  },
  "max_body_size": "10mb",
  "content_encoding": { "enabled": true },
  "logging": {
    "level": "info",
    "rotation": {
      "period_days": 7,
      "max_size_mb": 50
    }
  },
  "box": {
    "allowed_modules": []
  },
  "privileged_apps": []
}

server

An object that configures the HTTP and HTTPS servers.

web_root

cache

max_body_size

content_encoding

logging

An object that configures the server's logger.

box (Sandbox Configuration)

default_app

privileged_apps


Enabling HTTPS for Local Development

To run and test your Gingee server with a valid SSL certificate on localhost (i.e., get the green padlock in your browser), you cannot use a simple self-signed certificate, as browsers do not trust them. The correct method is to create your own local Certificate Authority (CA) and use it to sign a certificate for localhost.

Prerequisites: You must have the openssl command-line tool installed. It is available by default on Linux and macOS. For Windows, it is included with Git Bash.

Step 1: Create Your Local Certificate Authority

First, we create a private key and a root certificate for our new local CA. Run these commands from your project root.

  1. Generate the CA's private key:
    openssl genrsa -out ./settings/ssl/localCA.key 2048
    
  2. Generate the CA's root certificate. You will be prompted for details like country and organization; you can enter any information you like.
    openssl req -x509 -new -nodes -key ./settings/ssl/localCA.key -sha256 -days 1024 -out ./settings/ssl/localCA.pem
    

Step 2: Add the CA to Your System's Trust Store

This is the critical step where you tell your operating system to trust your new local CA.

Step 3: Create and Sign the Server Certificate

Now, create the key.pem and cert.pem files that Gingee will use, and sign them with your trusted local CA.

  1. Generate the server's private key:
    openssl genrsa -out ./settings/ssl/key.pem 2048
    
  2. Create a Certificate Signing Request (CSR). Important: When prompted for the "Common Name (CN)," you must enter localhost.
    openssl req -new -key ./settings/ssl/key.pem -out ./settings/ssl/server.csr
    
  3. Sign the server certificate with your local CA:
    openssl x509 -req -in ./settings/ssl/server.csr -CA ./settings/ssl/localCA.pem -CAkey ./settings/ssl/localCA.key -CAcreateserial -out ./settings/ssl/cert.pem -days 500 -sha256
    

Step 4: Update gingee.json and Run

Enable the HTTPS server in your configuration. Since we used the default file paths, you don't need to add the key_file or cert_file properties.

{
  "server": {
    "http": { "enabled": false },
    "https": { "enabled": true, "port": 7443 }
  }
}

Now, start your server (npm start). You can navigate to https://localhost:7443 and your browser will show a secure connection with no warnings.