diff --git a/assets/www/configuration.html b/assets/www/configuration.html new file mode 100644 index 0000000..f777411 --- /dev/null +++ b/assets/www/configuration.html @@ -0,0 +1,173 @@ + + +
+ + +
+ This page documents PyRobusta configuration options,
+ configuration deployment using mpremote,
+ and runtime access to configuration values through the
+ configuration API.
+
+ Configuration overrides can be provided through pyrobusta.env, using standard .env syntax.
+ pyrobusta.env must be stored in the server root. Inline comments are supported using #.
+
Perform a soft reset and upload pyrobusta.env using mpremote.
| Name | +Description | +Default | +
|---|---|---|
wifi_ssid |
+ Name of the Wi-Fi network. When empty, Wi-Fi is not initialized by the built-in wifi.py module. |
+ None | +
wifi_password |
+ Password of the Wi-Fi network. When empty, Wi-Fi is not initialized by the built-in wifi.py module. |
+ None | +
http_port |
+ Port number for HTTP. | +80 | +
https_port |
+ Port number for HTTPS. | +443 | +
http_multipart |
+ Enables or disables multipart request and response processing. Enabling multipart support increases memory usage. | +False | +
http_mem_cap |
+ + Fraction of available heap memory reserved for stream buffers. Valid range: (0, 1]. + | +0.1 | +
http_served_paths |
+ + Space-separated list of filesystem paths that may be served over HTTP. + | +/www /lib/pyrobusta |
+
http_files_api |
+
+ Enables or disables the file management API endpoint (/files), allowing upload, download, and listing of files.
+ |
+ False | +
socket_max_con |
+ Maximum number of simultaneous socket connections. | +2 | +
tls |
+
+ Enables or disables TLS. When enabled, cert.der and key.der must be installed at the server root.
+ |
+ False | +
log_level |
+ Logging level. Can be one of: warning, info, debug. |
+ info | +
+ Configuration values can be accessed through the
+ pyrobusta.utils.config module.
+ Values are loaded from pyrobusta.env during server initialization.
+ Configuration values can be retrieved using
+ get_config() together with one of the
+ predefined CONF_* constants.
+
+ After initialization, configuration values are retrieved from an internal cache. + The cached values are normalized to their expected runtime types to avoid repeated + parsing of environment strings. +
+ +
+ Configuration values are treated as immutable during runtime.
+ Changes are applied only when the configuration cache is reloaded.
+ The configuration cache can be reloaded by calling
+ read_config(), which re-reads pyrobusta.env
+ and rebuilds the internal normalized cache.
+
This API provides file management capabilities, allowing clients to upload,
+ retrieve, and manage files through various HTTP methods.
+ http_files_api must be set to True in
+ pyrobusta.env to enable this API.
+
| Method | +Path | +Description | +
|---|---|---|
GET |
+ /files/{path} |
+ Lists or retrieves metadata about files. | +
PUT |
+ /files/{file path} |
+ Uploads or overwrites a file at the specified path. | +
POST |
+ /files |
+ Uploads multiple files in multipart/form-data. | +
DELETE |
+ /files/{file path} |
+ Deletes a file at the specified path. | +
Endpoint: GET /files/{path}
+ This method allows general file system interaction, enabling operations + such as listing directory contents, retrieving metadata, and downloading + files. +
+ +GET/files/{path}200 OKEndpoint: PUT /files/{file path}
+ This method uploads a file or overwrites an existing file at a specific
+ path. The upload path is restricted to
+ /www/user_data.
+
PUT/files/{file path}201 Createdtransfer-encoding: chunked is supported.
+ Endpoint: POST /files
+ This method handles general file uploads, designed for uploading multiple
+ files with per-file chunking supported. Only
+ multipart/form-data is accepted.
+
+ Uploads are restricted to /www/user_data. The
+ Content-Disposition header only needs to specify the file
+ name; the upload directory is prepended automatically.
+
+ http_multipart must be set to True in the
+ configuration to use this method.
+
POST/files201 CreatedEndpoint: DELETE /files/{file path}
+ This method deletes a file at a specific path. The path is restricted to
+ /www/user_data.
+
DELETE/files/{file path}204 No Content