# Content Feature Configuration - Production Environment
# Settings optimized for production security and performance

[features]
content_db = true

# Content Management - Production
[content]
enabled = true
content_dir = "/var/lib/rustelo/content"
cache_enabled = true
cache_ttl = 3600  # 1 hour
max_file_size = 10485760  # 10MB for production
allowed_extensions = ["md", "txt", "html", "json", "yaml"]
auto_reload = false
enable_drafts = true
strict_validation = true

# Content Storage - Production
[content.storage]
type = "database"  # "filesystem", "database", "s3"
base_path = "/var/lib/rustelo/content"
create_directories = true
backup_enabled = true
versioning_enabled = true
max_versions = 5
backup_schedule = "0 3 * * *"  # Daily at 3 AM
s3_bucket = "${CONTENT_S3_BUCKET}"
s3_region = "${AWS_REGION}"
s3_access_key = "${AWS_ACCESS_KEY_ID}"
s3_secret_key = "${AWS_SECRET_ACCESS_KEY}"

# Content Processing - Production
[content.processing]
markdown_enabled = true
syntax_highlighting = true
auto_linking = true
enable_math = true
enable_mermaid = false  # Disabled for security
enable_prism = true
process_includes = true
validate_frontmatter = true
sanitize_html = true
strip_dangerous_tags = true

# Content Validation - Strict for production
[content.validation]
strict_mode = true
validate_yaml_frontmatter = true
validate_markdown_links = true
validate_images = true
check_broken_links = true
allowed_protocols = ["https", "mailto"]
max_content_size = 1048576  # 1MB
require_alt_text = true
validate_accessibility = true

# Content Indexing - Production
[content.indexing]
enabled = true
full_text_search = true
index_content = true
index_metadata = true
rebuild_on_change = false
search_engine = "elasticsearch"  # "basic", "elasticsearch", "solr"
elasticsearch_url = "${ELASTICSEARCH_URL}"
elasticsearch_index = "rustelo_content"
batch_size = 100
index_compression = true

# Content Templates - Production
[content.templates]
enabled = true
template_dir = "/var/lib/rustelo/templates/content"
default_template = "default.hbs"
auto_detect_template = true
template_cache = true
cache_ttl = 3600  # 1 hour
precompile_templates = true

# Content API - Production
[content.api]
enabled = true
base_path = "/api/content"
enable_crud = true
enable_search = true
enable_upload = true
enable_download = true
rate_limit = 100  # requests per minute
max_query_results = 100
require_authentication = true
admin_only_operations = ["delete", "bulk_update"]

# Content Security - Strict for production
[content.security]
sanitize_html = true
allow_raw_html = false
allow_scripts = false
allow_iframes = false
csrf_protection = true
xss_protection = true
content_type_validation = true
file_type_validation = true
virus_scanning = true
quarantine_suspicious = true

# Content Metadata - Production
[content.metadata]
extract_metadata = true
auto_generate_slug = true
auto_generate_excerpt = true
excerpt_length = 150
auto_generate_toc = true
auto_generate_tags = true
ai_tag_generation = false
metadata_validation = true

# Content Workflow - Production
[content.workflow]
enabled = true
require_approval = true
auto_publish = false
draft_mode = true
revision_control = true
collaborative_editing = true
approval_workflow = "two_stage"
notify_reviewers = true
audit_trail = true

# Content Performance - Production
[content.performance]
lazy_loading = true
image_optimization = true
content_compression = true
cdn_enabled = true
cdn_url = "${CDN_URL}"
cache_static_assets = true
cache_ttl = 86400  # 24 hours
optimize_images = true
webp_conversion = true
progressive_jpeg = true

# Content Monitoring - Production
[content.monitoring]
enabled = true
track_views = true
track_downloads = true
track_search_queries = true
performance_metrics = true
error_tracking = true
alert_on_errors = true
alert_email = "${ADMIN_EMAIL}"
retention_days = 90

# Content CDN - Production
[content.cdn]
enabled = true
provider = "cloudflare"  # "cloudflare", "aws", "azure"
url = "${CDN_URL}"
api_key = "${CDN_API_KEY}"
zone_id = "${CDN_ZONE_ID}"
auto_purge = true
purge_on_update = true
cache_everything = true
browser_cache_ttl = 86400  # 24 hours
edge_cache_ttl = 604800  # 7 days

# Content Backup - Production
[content.backup]
enabled = true
schedule = "0 2 * * *"  # Daily at 2 AM
retention_days = 90
backup_location = "${BACKUP_LOCATION}"
compress_backups = true
encrypt_backups = true
encryption_key = "${BACKUP_ENCRYPTION_KEY}"
verify_backups = true
notification_email = "${ADMIN_EMAIL}"

# Content Analytics - Production
[content.analytics]
enabled = true
track_page_views = true
track_user_engagement = true
track_content_performance = true
analytics_provider = "google"  # "google", "matomo", "custom"
google_analytics_id = "${GOOGLE_ANALYTICS_ID}"
respect_do_not_track = true
anonymize_ip = true
cookie_consent = true

# Content Compliance - Production
[content.compliance]
gdpr_enabled = true
data_retention_policy = 2555  # days (7 years)
audit_log_enabled = true
audit_log_retention = 2555  # days
right_to_be_forgotten = true
data_export_enabled = true
privacy_policy_url = "${BASE_URL}/privacy"
terms_of_service_url = "${BASE_URL}/terms"
cookie_policy_url = "${BASE_URL}/cookies"

# Development Settings - Disabled for production
[content.development]
debug_mode = false
log_queries = false
log_processing = false
enable_content_preview = false
auto_save_drafts = false
show_processing_time = false
enable_hot_reload = false
