JWTPlus Configuration Guide

The jwtplus.yaml file is the core configuration file for JWTPlus, defining how the service operates, where it listens for connections, and how it interacts with the database. This guide explains each section of the configuration file and provides best practices for setting it up.

Configuration File Location

The jwtplus.yaml file should be stored in one of the following locations:

  • /opt/jwtplus/jwtplus.yaml
  • /etc/jwtplus/jwtplus.yaml

Understanding the jwtplus.yaml Configuration

Below is a breakdown of the default jwtplus.yaml file:

debug: false
server:
  ip: 127.0.0.1
  port: 2025
  domain: example.com
db:
  location: 0.0.0.0
  port: 3306
  username: jwtengine
  password: 123456
  dbname: jwtengine
1. Debug Mode
debug: false
  • Set to true for verbose logging, useful for debugging.
  • Keep it false in production for security and performance.
2. Server Configuration
server:
  ip: 0.0.0.0
  port: 2025
  domain: example.com
  • ip & port: Defines where JWTPlus listens for incoming requests.
  • domain: If specified, JWTPlus automatically provisions an SSL certificate using Let's Encrypt.

Important Considerations for Domain Usage

  • If domain is provided, the ip & port field should not be written.
  • The domain's DNS must be correctly pointed to the server's IP before installation to allow SSL certificate issuance.
  • If no domain is set, JWTPlus runs on the specified ip and port without SSL.
3. Database Configuration
db:
  location: 127.0.0.1
  port: 3306
  username: jwtengine
  password: 123456
  dbname: jwtengine
  • location: The database server address, typically 127.0.0.1 for local installations.
  • port: The database port, default is 3306 for MySQL/MariaDB.
  • username & password: Credentials for the JWTPlus database user.
  • dbname: The name of the JWTPlus database.

Security Tip: Avoid using weak passwords like 123456. Instead, generate a strong password and store it securely.

Final Thoughts
  • Always verify that the jwtplus.yaml file is correctly formatted in YAML syntax.
  • If using a domain, ensure that the DNS is configured before running JWTPlus.
  • Store the configuration in either /opt/jwtplus/ or /etc/jwtplus/ folder for proper service recognition.