-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.config.toml
More file actions
227 lines (193 loc) · 5.45 KB
/
Copy pathapp.config.toml
File metadata and controls
227 lines (193 loc) · 5.45 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
# ePub Reader Library - Master Configuration File
# This is the main configuration file that references all other configuration files
[meta]
name = "ePub Reader Library"
version = "0.1.0"
config_version = "1.0"
last_updated = "2024-01-01T00:00:00Z"
[config_files]
# References to other configuration files
# All paths are relative to the application root directory
# Main application configuration
main_config = "config.toml"
# Environment-specific configurations
development_env = ".env.development"
production_env = ".env.production"
testing_env = ".env.testing"
# Service-specific configurations
ollama_config = "ollama.config.toml"
reader_config = "reader.config.json"
logging_config = "logging.config.toml"
# Runtime configurations (created at runtime)
user_preferences = "user.config.toml"
cache_config = "cache.config.toml"
[environment]
# Current environment: development, production, testing
current = "development"
# Auto-detect environment based on build type
auto_detect = true
# Environment detection priority
detection_order = ["ENVIRONMENT", "RUST_ENV", "NODE_ENV"]
[config_loading]
# Configuration loading behavior
# Load order (later configs override earlier ones)
load_order = [
"config.toml",
"ollama.config.toml",
"logging.config.toml",
".env.{environment}",
"user.config.toml"
]
# Fail if required config files are missing
fail_on_missing_required = true
# Required configuration files
required_files = ["config.toml"]
# Optional configuration files
optional_files = [
"ollama.config.toml",
"reader.config.json",
"logging.config.toml",
"user.config.toml"
]
[validation]
# Configuration validation settings
enabled = true
# Validate on startup
validate_on_startup = true
# Validate on config reload
validate_on_reload = true
# Strict validation (fail on unknown keys)
strict_mode = false
[hot_reload]
# Hot reload configuration changes
enabled = true
# Watch for file changes
watch_files = true
# Reload interval in seconds
check_interval = 5
# Files to watch for changes
watched_files = [
"config.toml",
"ollama.config.toml",
"logging.config.toml",
"user.config.toml"
]
[backup]
# Configuration backup settings
enabled = true
# Backup before applying changes
backup_before_changes = true
# Backup directory
backup_directory = "config_backups"
# Maximum number of backups to keep
max_backups = 10
[defaults]
# Default values for missing configurations
# These are used when config files are missing or incomplete
[defaults.app]
name = "ePub Reader Library"
version = "0.1.0"
window_width = 1200
window_height = 800
[defaults.database]
name = "library.db"
max_connections = 10
[defaults.ollama]
host = "localhost"
port = 11434
default_model = "llama3.1:8b"
timeout = 120
[defaults.ui]
theme = "dark"
language = "en"
books_per_row = 4
[defaults.logging]
level = "info"
log_to_file = true
log_to_console = true
[overrides]
# Configuration overrides for specific scenarios
# These take precedence over all other configurations
[overrides.development]
# Development overrides
logging.level = "debug"
logging.log_to_console = true
app.debug_mode = true
[overrides.production]
# Production overrides
logging.level = "warn"
logging.log_to_console = false
security.validate_epub_files = true
[overrides.testing]
# Testing overrides
database.name = "test_library.db"
storage.base_dir = ".epubreader_test"
translation.mock_translation = true
[schema]
# Configuration schema validation
# Define expected structure and types for validation
[schema.app]
name = { type = "string", required = true }
version = { type = "string", required = true }
window_width = { type = "integer", min = 800, max = 3840 }
window_height = { type = "integer", min = 600, max = 2160 }
[schema.database]
name = { type = "string", required = true }
max_connections = { type = "integer", min = 1, max = 100 }
[schema.ollama]
host = { type = "string", required = true }
port = { type = "integer", min = 1, max = 65535 }
timeout = { type = "integer", min = 10, max = 600 }
[migration]
# Configuration migration settings
enabled = true
# Migration scripts directory
scripts_directory = "config_migrations"
# Current schema version
current_version = "1.0"
# Auto-migrate on version mismatch
auto_migrate = true
[security]
# Configuration security settings
# Encrypt sensitive configuration values
encrypt_sensitive = false
# Sensitive keys that should be encrypted
sensitive_keys = [
"api_keys",
"passwords",
"tokens"
]
# Configuration file permissions
file_permissions = "600"
[monitoring]
# Configuration monitoring
enabled = true
# Monitor configuration changes
log_changes = true
# Alert on configuration errors
alert_on_errors = true
# Performance impact monitoring
monitor_performance = true
[documentation]
# Configuration documentation
# Generate documentation from configuration
generate_docs = false
# Documentation output format
docs_format = "markdown"
# Documentation output file
docs_output = "CONFIG.md"
[examples]
# Example configurations for different use cases
# These can be copied to create new configurations
[examples.minimal]
description = "Minimal configuration for basic usage"
files = ["config.minimal.toml"]
[examples.full_featured]
description = "Full-featured configuration with all options"
files = ["config.full.toml", "ollama.full.toml"]
[examples.performance_optimized]
description = "Configuration optimized for performance"
files = ["config.performance.toml"]
[examples.security_hardened]
description = "Security-hardened configuration"
files = ["config.security.toml"]