From d2ea9960bf4f84bcded7a0bce604257aeffb5504 Mon Sep 17 00:00:00 2001 From: Aaron Guise Date: Mon, 30 Jun 2025 22:08:34 +1200 Subject: [PATCH] feat: update config samples with SQLite and Viper support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add SQLite configuration options to config.json.sample - Create config.mysql.json.sample for MySQL deployments - Add security comments for sensitive configuration - Include environment variable examples and documentation - Add Viper configuration comments and usage examples 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- config.json.sample | 25 ++++++++++++++++++++----- config.mysql.json.sample | 19 +++++++++++++++++++ 2 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 config.mysql.json.sample diff --git a/config.json.sample b/config.json.sample index ad66110..bb56d6f 100644 --- a/config.json.sample +++ b/config.json.sample @@ -1,16 +1,31 @@ { + "_comment_config": "OpenAccounting Server Configuration - now supports Viper for multiple config sources", + "_comment_viper": "You can override any setting with environment variables using OA_ prefix (e.g., OA_PASSWORD, OA_MAILGUN_KEY)", + "WebUrl": "https://domain.com", - "Address": "", + "Address": "localhost", "Port": 8080, - "ApiPrefix": "", + "ApiPrefix": "/api/v1", "KeyFile": "", "CertFile": "", - "DatabaseAddress": "", + + "_comment_database": "Database configuration - choose 'sqlite' for local testing or 'mysql' for production", + "DatabaseDriver": "sqlite", + "DatabaseFile": "./data/openaccounting.db", + "DatabaseAddress": "localhost:3306", "Database": "openaccounting", "User": "openaccounting", - "Password": "openaccounting", + "Password": "", + "_comment_password": "SECURITY: Set password via OA_PASSWORD environment variable instead of this file", + + "_comment_mailgun": "Mailgun configuration for email sending", "MailgunDomain": "mg.domain.com", "MailgunKey": "", + "_comment_mailgun_key": "SECURITY: Set Mailgun key via OA_MAILGUN_KEY environment variable", "MailgunEmail": "noreply@domain.com", - "MailgunSender": "Sender" + "MailgunSender": "Sender", + + "_comment_env_examples": "Environment variable examples:", + "_example_development": "OA_DATABASE_DRIVER=sqlite OA_DATABASE_FILE=./dev.db ./server", + "_example_production": "OA_DATABASE_DRIVER=mysql OA_PASSWORD=secret OA_MAILGUN_KEY=key-123 ./server" } diff --git a/config.mysql.json.sample b/config.mysql.json.sample new file mode 100644 index 0000000..5b697e0 --- /dev/null +++ b/config.mysql.json.sample @@ -0,0 +1,19 @@ +{ + "WebUrl": "https://domain.com", + "Address": "", + "Port": 8080, + "ApiPrefix": "", + "KeyFile": "", + "CertFile": "", + "_comment_database": "MySQL configuration for production use", + "DatabaseDriver": "mysql", + "DatabaseAddress": "localhost:3306", + "Database": "openaccounting", + "User": "openaccounting", + "Password": "openaccounting", + "_comment_mailgun": "Mailgun configuration for email sending", + "MailgunDomain": "mg.domain.com", + "MailgunKey": "", + "MailgunEmail": "noreply@domain.com", + "MailgunSender": "Sender" +} \ No newline at end of file