PasswordLab Configuration File
Overview
The PasswordLab configuration system uses a JSON-based configuration file (passwordlab.json
) that defines all essential settings for the application. This document provides comprehensive details about each configuration section, its purpose, and how to properly configure them.
Configuration File Location
The location of the passwordlab.json
configuration file depends on how the application was installed:
Non-Root User Installation
When installed by a non-root user, the configuration file is located beside the software binary:
/path/to/passwordlab/binary/passwordlab.json
Root User Installation
When installed by root user, the configuration file is located in the system configuration directory:
/etc/passwordlab/passwordlab.json
Determining Installation Type
The application automatically detects the appropriate configuration path based on:
- Current user privileges
- Installation method used
- File system permissions
Configuration Structure
The configuration is organized into six main sections:
- Database Configuration
- Email Configuration
- Internal Settings
- License Configuration
- Login Configuration
- Server Configuration
Database Configuration
The db
section configures the database connection settings.
Structure
{
"db": {
"driver": "string",
"location": "string",
"dbname": "string",
"username": "string",
"password": "string",
"port": "string"
}
}
Parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
driver |
string | Yes | Database driver type (currently supports MySQL) | "mysql" |
location |
string | Yes | Database server hostname or IP address | "127.0.0.1" , "localhost" , "db.example.com" |
dbname |
string | Yes | Name of the database to connect to | "passwordlab_prod" , "demo" |
username |
string | Yes | Database username for authentication | "root" , "passwordlab_user" |
password |
string | Yes | Database password for authentication | "secure_password123" |
port |
string | Yes | Database server port number | "3306" (MySQL default) |
Example Configuration
{
"db": {
"driver": "mysql",
"location": "127.0.0.1",
"dbname": "passwordlab_production",
"username": "passwordlab_user",
"password": "your_secure_password",
"port": "3306"
}
}
Email Configuration
The email
section configures SMTP settings for sending emails (notifications, password resets, etc.).
Structure
{
"email": {
"host": "string",
"port": "string",
"username": "string",
"password": "string",
"from": "string",
"encryption": "string"
}
}
Parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
host |
string | Yes | SMTP server hostname | "smtp.gmail.com" , "smtppro.zoho.in" |
port |
string | Yes | SMTP server port number | "587" (STARTTLS), "465" (SSL/TLS) |
username |
string | Yes | SMTP authentication username (usually email) | "hello@passwordlab.io" |
password |
string | Yes | SMTP authentication password or app password | "app_specific_password" |
from |
string | Yes | Default "From" email address for outgoing emails | "noreply@passwordlab.io" |
encryption |
string | Yes | Encryption method for SMTP connection | "ssl/tls" , "starttls" , "none" |
Internal Settings
The internal
section contains system-generated settings used for application integrity and licensing.
Structure
{
"internal": {
"checksum": "string",
"machineid": "string",
"stamp": "string"
}
}
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
checksum |
string | Yes | System-generated checksum for configuration integrity |
machineid |
string | Yes | Unique machine identifier for licensing and security |
stamp |
string | Yes | Unix timestamp of configuration creation/modification |
Important Notes
- DO NOT manually modify these values
- These are automatically generated during installation
- Used for license validation and system integrity checks
- Modification may cause application malfunction or license violations
License Configuration
The license
section contains licensing information for the PasswordLab application.
Structure
{
"license": {
"id": "string",
"certificate": "string"
}
}
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
id |
string | Yes | Unique license identifier |
certificate |
string | Yes | Encrypted license certificate data |
Important Notes
- License information is provided during application purchase/activation
- DO NOT share or modify license information
- Contact support if license-related issues occur
- Required for application functionality
Login Configuration
The login
section configures user authentication and session management.
Structure
{
"login": {
"timeout": 60
}
}
Parameters
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
timeout |
integer | No | 60 | Session timeout in minutes before automatic logout |
Security Considerations
- Shorter timeouts increase security but may impact user experience
- Consider your organization's security requirements
- Balance security with usability for your users
Server Configuration
The server
section configures the web server settings.
Structure
{
"server": {
"domain": "string",
"port": 3000,
"debug": false
}
}
Parameters
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
domain |
string | No | - | Server domain name (for production deployments) |
port |
integer | No | 3000 | Port number for the web server |
debug |
boolean | No | false | Enable/disable debug mode |
Important Notes
- Always set
debug: false
in production environments - Ensure the port is not already in use by another service
- Domain configuration is typically used with reverse proxies
Troubleshooting
Common Issues
Application Won't Start
- Verify all required configuration sections are present
- Check that configuration file exists in the correct location:
/etc/passwordlab/passwordlab.json
for root installationspasswordlab.json
beside the binary for non-root installations
- Check database connectivity and credentials
- Ensure the specified port is available
- Validate JSON syntax in configuration file
Email Not Working
- Test SMTP credentials independently
- Verify firewall/network access to email server
- Check encryption settings match email provider requirements
- Ensure "from" address is authorized for the SMTP account
License Issues
- Contact support for license-related problems
- Do not modify license or internal sections manually
- Ensure machine ID hasn't changed due to hardware modifications
Database Connection Errors
- Verify database server is running and accessible
- Test credentials using database client tools
- Check network connectivity and firewall rules
- Ensure database exists and user has required permissions
Remember to keep your configuration secure and backed up, and never share sensitive credentials or license information.