INI-Konfigurationsdatei-Beispiele

INI-Dateiformatbeispiele für Anwendungskonfiguration und Systemeinstellungen

⚙️ Grundlegende Anwendungskonfiguration

🟢 simple

Einfache INI-Anwendungskonfigurationsdatei

# Basic Application Configuration File
# =====================================

[Application]
Name = MyApp
Version = 2.1.0
Description = Sample Application Configuration
Author = John Doe
License = MIT
Created = 2024-01-15

[Server]
Host = localhost
Port = 3000
Protocol = HTTP
MaxConnections = 100
Timeout = 30000

[Database]
Type = PostgreSQL
Host = localhost
Port = 5432
Name = myapp_db
User = app_user
Password = secure_password
SSL = true

[Logging]
Level = INFO
File = /var/log/myapp.log
Console = true
Rotation = daily
MaxSize = 10MB

[Features]
EnableLogin = true
EnableRegistration = true
EnableNotifications = false
EnableBetaFeatures = false

[Paths]
ConfigDir = /etc/myapp
LogDir = /var/log/myapp
DataDir = /var/lib/myapp
TempDir = /tmp/myapp

⚙️ Datenbankkonfiguration

🟡 intermediate

INI-Konfiguration für Datenbankverbindungsparameter

# Database Configuration File
# =============================

[PrimaryDatabase]
Type = PostgreSQL
Host = db.example.com
Port = 5432
Database = myapp_production
Username = app_user
Password = secure_database_password
SSLMode = require
ConnectTimeout = 30
CommandTimeout = 300

[PrimaryDatabase.Pool]
MinConnections = 5
MaxConnections = 20
ConnectionTimeout = 30
IdleTimeout = 300
MaxLifetime = 3600
HealthCheckInterval = 60

[ReplicaDatabase]
Type = PostgreSQL
Host = replica.example.com
Port = 5432
Database = myapp_replica
Username = replica_user
Password = replica_password
SSLMode = require
ReadOnly = true

[ReplicaDatabase.Pool]
MinConnections = 2
MaxConnections = 10
ConnectionTimeout = 15
IdleTimeout = 300
MaxLifetime = 3600

[Cache.Redis]
Host = cache.example.com
Port = 6379
Database = 0
Password = redis_password
ConnectionTimeout = 10
CommandTimeout = 5
MaxRetries = 3

[Cache.Redis.Cluster]
Enabled = false
Nodes = redis1.example.com:6379,redis2.example.com:6379,redis3.example.com:6379
Password = cluster_password

[Search.Elasticsearch]
Hosts = http://elasticsearch1.example.com:9200,http://elasticsearch2.example.com:9200
Username = elastic_user
Password = elastic_password
MaxRetries = 3
Timeout = 30000

[Search.Elasticsearch.Index]
Prefix = myapp_
SettingsFile = /etc/myapp/elasticsearch-settings.json

⚙️ Web-Server-Konfiguration

🟡 intermediate

INI-Konfiguration für Web-Server-Einstellungen

# Web Server Configuration
# ========================

[Server]
ListenAddress = 0.0.0.0
ListenPort = 80
WorkerProcesses = auto
WorkerConnections = 1024
KeepAliveTimeout = 65
MaxRequestBodySize = 10M
MaxHeaderSize = 8K

[Server.Security]
EnableHTTPS = true
HTTPSPort = 443
SSL Certificate = /etc/ssl/certs/server.crt
SSLPrivateKey = /etc/ssl/private/server.key
SSLProtocols = TLSv1.2,TLSv1.3
SSLCiphers = ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256

[Server.Logging]
AccessLog = /var/log/nginx/access.log
ErrorLog = /var/log/nginx/error.log
LogFormat = combined
LogLevel = warn
Rotate = daily
Keep = 30

[Server.Compression]
EnableGzip = true
GzipLevel = 6
MinLength = 1000
Types = text/html,text/css,text/javascript,application/javascript,application/json

[Server.RateLimiting]
Enabled = true
RequestsPerMinute = 100
BurstSize = 20
WhitelistIPs = 127.0.0.1,192.168.1.0/24

[VirtualHosts.default]
ServerName = example.com
DocumentRoot = /var/www/example.com
IndexFiles = index.html,index.htm
CustomErrorPages = 404=/errors/404.html,500=/errors/500.html

[VirtualHosts.api]
ServerName = api.example.com
ProxyPass = http://localhost:3000
ProxyTimeout = 30

[VirtualHosts.blog]
ServerName = blog.example.com
DocumentRoot = /var/www/blog
EnablePHP = true
PHPIniFile = /etc/php/7.4/fpm/php.ini

[Headers.Security]
XFrameOptions = DENY
XContentTypeOptions = nosniff
XSSProtection = "1; mode=block"
StrictTransportSecurity = max-age=31536000; includeSubDomains

[Headers.Cache]
CacheControl = public, max-age=3600
ExpiresActive = on
ExpiresDefault = "access plus 1 hour"

⚙️ Spiel-Einstellungen

🟡 intermediate

Spiel-Anwendungseinstellungen und Konfiguration

# Game Configuration File
# =======================

[Game]
Title = Epic Adventure
Version = 1.5.2
Resolution = 1920x1080
Fullscreen = true
VSync = true
FrameRate = 60
Language = en-US

[Display]
Brightness = 1.0
Contrast = 1.0
Gamma = 1.0
AntiAliasing = FXAA
TextureQuality = High
ShadowQuality = Medium
ParticleEffects = High
PostProcessing = true
MotionBlur = true

[Audio]
MasterVolume = 0.8
MusicVolume = 0.7
SFXVolume = 0.9
VoiceVolume = 0.8
AudioDevice = Default
MuteWhenInactive = false
SubtitleLanguage = en-US

[Controls]
MouseSensitivity = 1.5
InvertMouseY = false
ControllerEnabled = true
VibrationEnabled = true
AutoAim = false

[Gameplay]
Difficulty = Normal
AutoSave = true
SaveInterval = 300
TutorialEnabled = true
HelpTextEnabled = true
ObjectiveMarkers = true
CompassEnabled = true

[Graphics]
RenderScale = 1.0
AnisotropicFiltering = 16x
AmbientOcclusion = HBAO
DynamicShadows = true
ScreenSpaceReflections = true
Tessellation = true
WeatherEffects = true
DayNightCycle = true

[Network]
MultiplayerEnabled = true
MaxPlayers = 8
ServerName =
Port = 27015
ServerPassword =
LANDiscovery = true
NATTraversal = true

[HUD]
ShowFPS = false
ShowPing = true
ShowHealth = true
ShowMinimap = true
ShowCompass = true
ShowQuests = true
ShowInventory = true
Crosshair = default

[Input]
MovementForward = W
MovementBackward = S
MovementLeft = A
MovementRight = D
Jump = Space
Crouch = C
Sprint = LShift
Interact = E
Inventory = I
Map = M
Pause = ESC

[Accessibility]
ColorBlindMode = None
SubtitlesSize = Medium
SubtitleBackground = true
AimAssist = false
AutoSprint = false
ReducedMotion = false
HighContrast = false

[Audio.Music]
Playlist = Default
Shuffle = false
Repeat = true
DynamicMusic = true
CombatMusicEnabled = true
AmbientSoundsEnabled = true

[Character]
Name = Player
CharacterClass = Warrior
StartingLevel = 1
ExperienceMultiplier = 1.0
SkillProgressionSpeed = 1.0
DifficultyScaling = true

[Save]
AutoSaveSlots = 3
QuickSaveKey = F5
QuickLoadKey = F9
SaveFileLocation = AppData
CompressionEnabled = true
CloudSync = true

[Mods]
Enabled = false
ModDirectory = mods
AutoLoadMods = true
VerifyModIntegrity = true
ModVersion = compatible

[Debug]
DeveloperConsole = false
GodMode = false
UnlimitedAmmo = false
ShowCollision = false
WireframeMode = false
FrameTimeGraph = false

⚙️ Windows-Anwendungskonfiguration

🔴 complex

Typische Windows-Anwendungskonfigurationsdatei

# Windows Application Configuration
# =================================

[Application]
Name = MyApp
Version = 2.1.0
Company = Example Corp
Copyright = © 2024 Example Corp
Description = Sample Windows Application
Executable = MyApp.exe
InstallPath = C:\Program Files\MyApp

[Paths]
DataPath = C:\ProgramData\MyApp
ConfigPath = C:\Users\%USERNAME%\AppData\Roaming\MyApp
LogPath = C:\Users\%USERNAME%\AppData\Local\MyApp\Logs
TempPath = %TEMP%\MyApp

[Database]
Type = SQLite
DatabaseFile = C:\ProgramData\MyApp\database.sqlite
BackupPath = C:\ProgramData\MyApp\Backups
AutoBackup = true
BackupInterval = 24
MaxBackups = 7

[Services]
AutoStart = true
StartMinimized = false
ShowTrayIcon = true
MinimizeToTray = true
StartWithWindows = false

[Updates]
AutoCheck = true
CheckInterval = 24
AutoDownload = false
AutoInstall = false
UpdateURL = https://updates.example.com/myapp/
Channel = stable

[Logging]
Level = INFO
MaxFileSize = 5MB
MaxFiles = 10
EnableDebug = false
LogToFile = true
LogToConsole = false

[Network]
ProxyEnabled = false
ProxyServer =
ProxyPort = 8080
ProxyUsername =
ProxyPassword =
Timeout = 30000

[Security]
EncryptData = true
EncryptionKey =
RequireAuthentication = false
SessionTimeout = 3600
MaxLoginAttempts = 3

[UI]
Theme = default
Language = en-US
FontSize = 10
FontName = Segoe UI
WindowWidth = 1024
WindowHeight = 768
RememberPosition = true
Maximized = false

[Performance]
MaxMemoryUsage = 512MB
MaxCPUUsage = 80
EnableMultithreading = true
ThreadCount = 4
CacheSize = 100MB

[Features]
FeatureA = true
FeatureB = false
FeatureC = true
BetaFeatures = false
ExperimentalFeatures = false

[Notifications]
Enabled = true
ShowBalloonTips = true
SoundEnabled = true
Duration = 5000
Position = bottom-right

[Integration]
ShellIntegration = true
ContextMenu = true
DefaultProgram = false
FileAssociations = .myapp,.mydoc
URLProtocol = myapp

[Advanced]
DebugMode = false
VerboseLogging = false
ForceSingleInstance = true
EnableCrashReporting = true
EnableTelemetry = true

[Registry]
InstallPath = HKEY_LOCAL_MACHINE\SOFTWARE\MyApp\InstallPath
Version = HKEY_LOCAL_MACHINE\SOFTWARE\MyApp\Version
UserSettings = HKEY_CURRENT_USER\SOFTWARE\MyApp\Settings

⚙️ Dienst/Daemon-Konfiguration

🔴 complex

Systemdienst- und Daemon-Konfiguration

# Service/Daemon Configuration
# =============================

[Service]
Name = myapp-service
DisplayName = MyApp Background Service
Description = Background service for MyApp application
Type = daemon
User = myapp
Group = myapp
WorkingDirectory = /opt/myapp
Executable = /usr/bin/myapp-service
PIDFile = /var/run/myapp-service.pid

[Service.Startup]
AutoStart = true
StartOnBoot = true
Restart = always
RestartDelay = 10
StartTimeout = 60
StopTimeout = 30
WatchdogSec = 30

[Service.Limits]
CPUQuota = 80%
MemoryLimit = 1G
FileSizeLimit = 100M
NOFile = 65536
NProc = 4096
NiceLevel = 0
IOReadBandwidthMax = 50M
IOWriteBandwidthMax = 50M

[Service.Environment]
Environment = production
LogLevel = INFO
ConfigFile = /etc/myapp/config.ini
LogFile = /var/log/myapp/service.log
TempDir = /tmp/myapp

[Service.Security]
NoNewPrivileges = true
ProtectSystem = strict
ProtectHome = true
PrivateTmp = true
ProtectKernelTunables = true
ProtectKernelModules = true
ProtectControlGroups = true
RestrictAddressFamilies = AF_UNIX AF_INET AF_INET6

[Logging]
Level = INFO
Format = json
Output = file
File = /var/log/myapp/service.log
MaxSize = 100M
MaxFiles = 10
Rotate = daily
Compress = true

[Monitoring]
HealthCheck = true
HealthCheckInterval = 30
HealthCheckTimeout = 10
HealthCheckEndpoint = /health
MetricsEnabled = true
MetricsPort = 9090
MetricsEndpoint = /metrics

[Network]
Port = 8080
BindAddress = 0.0.0.0
Protocol = HTTP
SSLEnabled = false
SSLCertFile =
SSLKeyFile =
MaxConnections = 1000
KeepAlive = true
Timeout = 30000

[Database]
Type = PostgreSQL
Host = localhost
Port = 5432
Name = myapp_service
User = service_user
Password = secure_service_password
MaxConnections = 10
ConnectionTimeout = 30

[Cache]
Type = Redis
Host = localhost
Port = 6379
Database = 0
Password =
MaxConnections = 5
DefaultTTL = 3600

[Workers]
Enabled = true
Count = 4
Queue = myapp_tasks
MaxRetries = 3
RetryDelay = 60
Timeout = 300
BatchSize = 10

[Backup]
Enabled = true
Schedule = 0 2 * * *
RetentionDays = 30
BackupPath = /var/backups/myapp
Compression = true
Encryption = true

[Updates]
AutoUpdate = false
CheckInterval = 86400
UpdateChannel = stable
UpdateURL = https://updates.example.com/
BackupBeforeUpdate = true

[Dependencies]
After = network.target
Wants = network-online.target
Requires = postgresql.service
After = postgresql.service

[ResourceUsage]
MemoryUsageThreshold = 80
CPUUsageThreshold = 70
DiskUsageThreshold = 85
AlertThresholds = critical

[Security.Audit]
AuditLog = true
AuditFile = /var/log/myapp/audit.log
LogAuthentication = true
LogAuthorization = true
LogDataAccess = true
LogConfigChanges = true

[Performance]
ThreadPoolSize = 10
QueueSize = 1000
BufferSize = 8192
CacheSize = 256M
MaxConcurrentRequests = 100

[Failover]
Enabled = false
PrimaryHost = primary.example.com
BackupHost = backup.example.com
FailoverTimeout = 30
HeartbeatInterval = 10
MaxFailures = 3

[Development]
DebugMode = false
ProfilingEnabled = false
HeapDumpEnabled = false
StackTracesEnabled = false
VerboseLogging = false