Server Settings

GNconfig.debug.json is the local runtime configuration file used when GearN Server starts through the debug workflow. It defines ports, SSL, HTTP, Socket.IO, file uploads, MongoDB, logging, DDoS limits, cluster identity, and bootstrap admin credentials.

Treat this file as environment-specific infrastructure configuration. Development can keep permissive defaults, but production must use locked-down origins, strong secrets, real database URLs, controlled upload limits, and a clear backup strategy.

GNconfig.debug.jsonHTTPSocket.IOMongoDBDDoSCluster
Config File
GearN logo
  • name identifies the current environment.
  • options contains all typed runtime setting groups.
  • Keep one config per environment instead of editing production values by hand.
Configuration Shape
{
    "name": "debug",
    "options": {
        "applicationSettings": {},
        "httpAppSettings": {},
        "socketAppSettings": {},
        "uploadFileSettings": {},
        "databaseSettings": {},
        "otherSettings": {},
        "logSettings": {},
        "ddosSettings": {},
        "clusterSettings": {}
    }
}
Read This First
  • Never ship the default admin username, password, or private key token.
  • Never expose MongoDB directly to public traffic.
  • Keep debug request logging disabled when real player data is present.
  • Use a reverse proxy, HTTPS, backups, monitoring, and deployment rollback for live servers.
Settings Groups
GroupControlsOpen Details
ApplicationSettingsport, socketPort, useSsl, keyFilePath, certFilePath, ...View ApplicationSettings
HttpAppSettingsenable, allowOrigin, credentials, allowMethods, allowHeaders, ...View HttpAppSettings
SocketAppSettingsenable, useEmitter, allowOrigin, credentials, allowMethods, ...View SocketAppSettings
UploadFileSettingsenable, uploadPath, maxSizeUpload, mimeTypeAcceptsView UploadFileSettings
DatabaseSettingsconnectionString, databaseName, logConnectionString, logDatabaseName, optionsView DatabaseSettings
OtherSettingsheaderIP, idTypeCase, ipApiUrl, cloudScriptExecuteTimeoutInMsView OtherSettings
LogSettingslogToConsoleEnable, logToFileEnable, logPathView LogSettings
DdosSettingssocketMaxRequestPerSecondPerIp, socketMaxRequestPerSecondPerPeer, socketMaxPendingRequest, socketMaxRequestSize, httpMaxRequestPerSecondPerIp, ...View DdosSettings
ClusterSettingsinstanceId, isPrimary, privateKeyToken, allNodesView ClusterSettings
ApplicationSettings
FieldTypePurpose
portnumberMain HTTP API port. Debug default: 2202.
socketPortnumberDedicated Socket.IO port. Debug default: 2901.
useSslbooleanEnables HTTPS and secure socket transport when key and certificate files are configured.
keyFilePathstringPath to the SSL private key file. Leave empty when useSsl is false.
certFilePathstringPath to the SSL certificate file. Leave empty when useSsl is false.
expiredTokenInMsnumberAuthentication token lifetime in milliseconds. Debug default: 172800000.
privateKeyTokenstringSecret key used to sign and verify auth tokens. Change this before production.
initRootUsernamestringUsername for the first root admin account created during initial database bootstrap.
initRootPasswordstringPassword for the first root admin account. Never keep the debug value in production.
restoreRootPasswordstringEmergency fallback password for dashboard admin login and password change flows. Keep it blank unless you intentionally need recovery access.
HttpAppSettings
FieldTypePurpose
enablebooleanEnables or disables the HTTP API server.
allowOriginstringCORS origin value. Use a strict origin list strategy at the reverse proxy or application boundary for production.
credentialsbooleanAllows credential headers in cross-origin requests.
allowMethodsMethodType[]HTTP methods accepted by the API. Debug default allows GET and POST.
allowHeadersstring[]Allowed request headers such as Auth-Token, Secret-Key, Game-Id, and Content-Type.
enableSendAndReceiveDebugbooleanLogs request and response payloads for debugging. Disable this in production unless you have a controlled incident workflow.
enablePostViaMsgPackbooleanEnables MessagePack payload handling for HTTP operations.
enablePostViaJsonbooleanEnables JSON payload handling for HTTP operations.
trustProxybooleanTells Express to trust proxy headers. Enable only when GearN is behind a trusted proxy or load balancer.
SocketAppSettings
FieldTypePurpose
enablebooleanEnables or disables the Socket.IO server.
useEmitterbooleanUses the MongoDB Socket.IO emitter for cross-node socket fan-out.
allowOriginstringCORS origin value for socket handshakes.
credentialsbooleanAllows credential headers during socket handshake.
allowMethodsMethodType[]Allowed HTTP methods for socket handshakes. Debug default is GET.
allowHeadersstring[]Allowed headers for socket handshake requests.
enableSendAndReceiveDebugbooleanLogs socket payloads for debugging. Disable in production unless explicitly needed.
enablePostViaMsgPackbooleanEnables MessagePack payload handling over socket operations.
enablePostViaJsonbooleanEnables JSON payload handling over socket operations.
pingIntervalnumberSocket.IO ping interval in milliseconds. Debug default: 50000.
pingTimeoutnumberSocket.IO ping timeout in milliseconds. Debug default: 5000.
UploadFileSettings
FieldTypePurpose
enablebooleanEnables or disables file upload routes.
uploadPathstringLocal folder where uploaded files are stored. Debug default: ./file-upload.
maxSizeUploadnumberMaximum upload size in bytes. Debug default is 52428800, which is 50 MB.
mimeTypeAcceptsstring[]Accepted MIME types. Debug default accepts image/png only.
DatabaseSettings
FieldTypePurpose
connectionStringstringMongoDB connection string for main GearN data.
databaseNamestringMain MongoDB database name.
logConnectionStringstring | nullOptional MongoDB connection string for log data. When empty, logs use the main database connection.
logDatabaseNamestringDatabase name used by the separate log database connection.
optionsMongoClientOptionsExtra MongoDB client options such as pool sizes, retry behavior, and timeout values.
OtherSettings
FieldTypePurpose
headerIPstringRequest header used to resolve the real client IP. Debug default: X-Real-IP.
idTypeCase0 | 1 | 2Generated ID casing mode. 0 allows mixed case, 1 forces uppercase, and 2 forces lowercase.
ipApiUrlstringExternal endpoint used to resolve IP location details. Debug default: https://ipdetail.gearn.net/json.
cloudScriptExecuteTimeoutInMsnumberCloudScript execution timeout in milliseconds. Debug config uses 15000.
LogSettings
FieldTypePurpose
logToConsoleEnablebooleanWrites server logs to the console.
logToFileEnablebooleanWrites server logs to a file.
logPathstringPath to the server log file. Debug default: ./log/debug/Server.log.
DdosSettings
FieldTypePurpose
socketMaxRequestPerSecondPerIpnumberMaximum socket requests per second from the same IP.
socketMaxRequestPerSecondPerPeernumberMaximum socket requests per second from the same socket connection.
socketMaxPendingRequestnumberMaximum pending socket requests before new requests are rejected or throttled.
socketMaxRequestSizenumberMaximum socket request payload size in bytes.
httpMaxRequestPerSecondPerIpnumberMaximum HTTP requests per second from the same IP.
httpMaxRequestPerSecondPerPeernumberMaximum HTTP requests per second from the same peer.
httpMaxPendingRequestnumberMaximum pending HTTP requests.
httpMaxRequestSizenumberMaximum HTTP request payload size in bytes.
maxUploadPendingRequestnumberMaximum pending upload requests.
maxDownloadPendingRequestnumberMaximum pending download requests.
ipWhiteListstring[]IP addresses exempt from DDoS throttling. Keep this list small and explicit.
ClusterSettings
FieldTypePurpose
instanceIdstringUnique identifier for this GearN node.
isPrimarybooleanMarks whether this node is the primary node for cluster-sensitive workflows.
privateKeyTokenstringSecret token for internal node-to-node trust. Use a different value from debug config.
allNodes{ instanceId: string; fullUrl: string }[]List of all GearN nodes with the HTTP URL each node can use to reach the others.
Environment Guidance
  • dev: local ports, local MongoDB, permissive origins, debug logs allowed.
  • staging: production-like ports, real auth providers, realistic DDoS limits, separate database.
  • live: locked secrets, strict origins, controlled upload types, backups, monitoring, and minimal debug output.
Recommended Production Changes
  • Replace privateKeyDefault, admin, and password.
  • Set real MongoDB credentials and use a database user with only required privileges.
  • Disable request payload debug logging unless troubleshooting a controlled issue.
  • Use strict upload MIME types and sizes based on actual game content requirements.
  • Review DDoS limits with real traffic patterns before opening the service publicly.