-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.example.yaml
More file actions
executable file
·152 lines (132 loc) · 5.59 KB
/
config.example.yaml
File metadata and controls
executable file
·152 lines (132 loc) · 5.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# ==============================================================================
# Waterlogger Configuration File
# ==============================================================================
# This is an example configuration file. Copy this to config.yaml and customize.
# See BUILD_REQUIREMENTS.md and README.md for detailed setup instructions.
# ==============================================================================
# ------------------------------------------------------------------------------
# Server Configuration
# ------------------------------------------------------------------------------
server:
# Port for the web server (default: 2342)
# Access the application at http://localhost:2342
port: 2342
# Host address to bind to
# - "localhost" or "127.0.0.1" = local access only
# - "0.0.0.0" = accessible from other machines on network
host: "localhost"
# ------------------------------------------------------------------------------
# Database Configuration
# ------------------------------------------------------------------------------
database:
# Database type: "sqlite" or "mariadb"
#
# SQLite (default):
# - Simple, zero-configuration
# - Single file database
# - Requires CGO (C compiler) to build
# - Perfect for single-user or small deployments
#
# MariaDB:
# - Better for multi-user environments
# - Requires separate MariaDB server installation
# - Better performance for large datasets
# - Supports concurrent access better than SQLite
type: "sqlite"
# SQLite Configuration (used when type = "sqlite")
sqlite:
# Path to the SQLite database file
# - Relative path: stored in application directory
# - Absolute path: /var/lib/waterlogger/waterlogger.db
# - Will be created automatically on first run
path: "waterlogger.db"
# MariaDB Configuration (used when type = "mariadb")
#
# To use MariaDB instead of SQLite:
# 1. Install MariaDB server:
# - Ubuntu/Debian: sudo apt install mariadb-server
# - Windows: Download from https://mariadb.org/download/
# - macOS: brew install mariadb
#
# 2. Create database and user:
# mysql -u root -p
# CREATE DATABASE waterlogger;
# CREATE USER 'waterlogger'@'localhost' IDENTIFIED BY 'your-secure-password';
# GRANT ALL PRIVILEGES ON waterlogger.* TO 'waterlogger'@'localhost';
# FLUSH PRIVILEGES;
#
# 3. Update settings below and change type to "mariadb"
#
# 4. Migrate existing SQLite data (optional):
# ./waterlogger -migrate-to-mariadb
mariadb:
# MariaDB server hostname
# - "localhost" or "127.0.0.1" for local server
# - IP address or hostname for remote server
host: "localhost"
# MariaDB server port (default: 3306)
port: 3306
# Database username
username: "waterlogger"
# Database password
# WARNING: Keep this file secure! Set appropriate file permissions:
# Linux/macOS: chmod 600 config.yaml
# Windows: Right-click → Properties → Security → Edit permissions
password: "password"
# Database name (must be created beforehand)
database: "waterlogger"
# ------------------------------------------------------------------------------
# Application Settings
# ------------------------------------------------------------------------------
app:
# Application name (displayed in UI)
name: "Waterlogger"
# Application version (automatically updated by build process)
version: "1.5.1"
# Secret key for session encryption and security tokens
# IMPORTANT: Change this to a long, random string!
# Generate a secure key with:
# - Linux/macOS: openssl rand -base64 32
# - Windows PowerShell: -join (1..32|%{[byte](Get-Random -Max 256)}|ForEach-Object{$_.ToString('x2')})
# Keep this secret and never commit to version control!
secret_key: "change-this-to-a-secure-random-string"
# ------------------------------------------------------------------------------
# Logging Configuration
# ------------------------------------------------------------------------------
logging:
# Log level: debug, info, warn, error, fatal
# - debug: Very verbose, includes all operations (development)
# - info: General information, successful operations (recommended)
# - warn: Warning messages, non-critical issues
# - error: Error messages, failed operations
# - fatal: Critical errors that cause shutdown
level: "info"
# Log format: json or console
# - json: Structured JSON format, good for log aggregation tools
# - console: Human-readable format with colors (good for development)
format: "console"
# Log output destination: stdout, file, both
# - stdout: Print to console/terminal only
# - file: Write to log file only
# - both: Print to console AND write to file (recommended)
output: "both"
# Log file path (used when output is "file" or "both")
# - Relative path: logs/waterlogger.log (in application directory)
# - Absolute path: /var/log/waterlogger/waterlogger.log
# - Directory will be created automatically if it doesn't exist
file_path: "logs/waterlogger.log"
# Maximum size of log file in megabytes before rotation
# When reached, current log is renamed and a new one is started
max_size: 100
# Maximum number of old log files to keep
# Older files are automatically deleted
# Set to 0 to keep all old logs
max_backups: 3
# Maximum number of days to keep old log files
# Files older than this are deleted regardless of max_backups
# Set to 0 to keep based on max_backups only
max_age: 28
# Compress old log files with gzip
# Saves disk space for archived logs
# true = compress, false = keep as plain text
compress: true