Settings¶
Global configuration for fscm behavior.
Accessing Settings¶
Available Settings¶
dry_run¶
Simulate operations without making changes.
| Type | Default |
|---|---|
| bool | False |
When enabled: - Files are not written - Commands are not executed - Packages are not installed - Changes are still tracked in CHANGELIST
sudo_password¶
Password for sudo operations.
| Type | Default |
|---|---|
| str | None |
Security
Avoid hardcoding passwords. Use environment variables:
stream_output¶
Show command output in real-time.
| Type | Default |
|---|---|
| bool | True |
backup_dir¶
Directory for file backups.
| Type | Default |
|---|---|
| Path | ~/.fscm/backups |
backup_threshold¶
Maximum file size to backup (bytes).
| Type | Default |
|---|---|
| int | 1048576 (1MB) |
Set to None to disable backups:
prefix¶
Path prefix for all file operations.
| Type | Default |
|---|---|
| Path | None |
When set, all relative paths are resolved against this prefix.
container_cmd¶
Docker or podman command.
| Type | Default |
|---|---|
| str | "docker" |
system¶
Override detected system type.
| Type | Default |
|---|---|
| UnixSystem | Auto-detected |
Example: Production Configuration¶
import os
import fscm
from pathlib import Path
# Disable dry-run for actual deployment
fscm.settings.dry_run = False
# Use environment variable for sudo password
fscm.settings.sudo_password = os.environ.get("SUDO_PASSWORD")
# Configure backups
fscm.settings.backup_dir = Path("/var/backups/fscm")
fscm.settings.backup_threshold = 10 * 1024 * 1024 # 10MB max
# Show output
fscm.settings.stream_output = True