The ConfigReloadPlugin schema defines the configuration for the configuration reload plugin in Rusty Beam. This plugin enables hot reloading of server configuration without restarting the server by handling PATCH requests to the configuration file.
Schema URL: https://rustybeam.net/schema/ConfigReloadPlugin
Parent Schema: https://rustybeam.net/schema/UtilityPlugin
Property | Type | Cardinality | Description |
---|---|---|---|
name | https://rustybeam.net/schema/Text | 0..1 | Plugin instance name for identification. Defaults to "config-reload" if not specified. |
<!-- Configuration reload plugin (minimal configuration) -->
<td itemprop="plugin" itemscope itemtype="https://rustybeam.net/schema/ConfigReloadPlugin">
<span itemprop="library">file://./plugins/librusty_beam_config_reload.so</span>
</td>
The ConfigReloadPlugin intercepts PATCH requests to the configuration file and provides hot reload functionality:
Method: PATCH
Path: /config/
(or path to your configuration file)
Headers: Content-Length: 0
Body: Empty
Response:
202 Accepted
- Configuration reload initiated successfully500 Internal Server Error
- Failed to send reload signalThe plugin also responds to OPTIONS requests on the configuration file to advertise PATCH support:
OPTIONS /config/
Allow: GET, PUT, DELETE, OPTIONS, PATCH, HEAD, POST
Accept-Ranges: selector
# Trigger configuration reload
curl -X PATCH -H "Content-Length: 0" http://localhost:3000/config/
# Response: "Configuration reload initiated"
// Trigger server reload from web interface
async function reloadServer() {
try {
const response = await fetch('/config/', {
method: 'PATCH',
headers: {
'Content-Length': '0'
}
});
if (response.ok) {
console.log('Server configuration reload initiated');
} else {
throw new Error(`Reload failed: ${response.status}`);
}
} catch (error) {
console.error('Error reloading server:', error);
}
}
When used with authorization plugins, ensure that configuration reload endpoints are properly protected. Only administrators should be able to trigger server reloads.
This plugin should be placed before file handler plugins in the pipeline to intercept PATCH requests before they're processed as file modifications.
Issue | Possible Cause | Solution |
---|---|---|
PATCH returns 404 | Plugin not in pipeline or wrong path | Verify plugin is configured and path matches config file |
Reload not working | SIGHUP signal not reaching process | Check process permissions and signal handling |
500 Internal Server Error | Failed to send SIGHUP signal | Check server logs and process permissions |
To debug configuration reload issues, run the server in verbose mode:
cargo run -- -v config/config.html