Files
foldsite/docs/content/Configuration.md
Tanishq Dubey c12c8b0a89
All checks were successful
Datadog Software Composition Analysis / Datadog SBOM Generation and Upload (push) Successful in 51s
Datadog Secrets Scanning / Datadog Static Analyzer (push) Successful in 56s
Release / build (push) Successful in 1m24s
Release / publish_head (push) Successful in 1m17s
Datadog Static Analysis / Datadog Static Analyzer (push) Successful in 5m41s
Revert to 8c23e9d811
2025-07-09 06:07:27 -04:00

1.8 KiB

Configuration

Configuration file

Foldsite is configured using a TOML file (default: config.toml). This file specifies paths to content, templates, and styles, as well as server settings.

Example config.toml:

[paths]
content_dir = "/home/myuser/site/content"
templates_dir = "/home/myuser/site/themes/cobalt/templates"
styles_dir = "/home/myuser/site/themes/cobalt/styles"

[server]
listen_address = "127.0.0.1"
listen_port = 8080
debug = false
access_log = true
max_threads = 4
admin_browser = false
admin_password = "your_admin_password"

Server Settings

  • listen_address: The IP address the server listens on (default: 127.0.0.1).
  • listen_port: The port the server listens on (default: 8080).
  • debug: Enables or disables debug mode (default: false). In debug mode, the server will automatically reload when code changes are detected, and more detailed error messages will be shown.
  • access_log: Enables or disables access logging (default: true). If enabled, access logs will be written to standard output.
  • max_threads: The maximum number of threads to use for handling requests (default: 4). This setting directly impacts the concurrency of the server.
  • admin_browser: Enables or disables the built-in file manager (default: false).
  • admin_password: Sets the password for the file manager. Required if admin_browser is true.

The Configuration class (/foldsite/src/config/config.py) is responsible for loading and parsing this configuration file. It also sets global variables (CONTENT_DIR, TEMPLATES_DIR, STYLES_DIR) for easy access to these directories throughout the application. Errors are raised if the config file is missing, invalid, or lacks required sections (like paths or server).