docs: Update 2 files
All checks were successful
Build-Test-Publish / build (linux/amd64) (push) Successful in 24s
Build-Test-Publish / build (linux/arm64) (push) Successful in 56s

This commit is contained in:
j
2026-01-03 00:04:10 +13:00
parent 0f76caa0c8
commit 8bff8a739f
2 changed files with 88 additions and 0 deletions

View File

@@ -306,6 +306,60 @@ _check_required_env_vars "CONTAINER_NAME"
docker logs "$CONTAINER_NAME" "$@"
```
### check-config.sh
Validates the service configuration without restarting or modifying the service. **OPTIONAL** - if not provided, `dropshell check-config` reports that the template doesn't support this command.
This is useful for:
- Validating configuration changes before applying them
- Checking syntax errors in config files
- Verifying that required dependencies are available
```bash
#!/bin/bash
source "${AGENT_PATH}/common.sh"
_check_required_env_vars "CONTAINER_NAME"
# Example: Validate nginx configuration
docker exec "$CONTAINER_NAME" nginx -t || _die "Configuration validation failed"
echo "Configuration is valid"
```
### reload-config.sh
Hot-reloads the service configuration without restarting the container. **OPTIONAL** - if not provided, `dropshell reload-config` reports that the template doesn't support this command.
This is useful for services that support graceful configuration reloading:
- Web servers (nginx, Caddy, Apache)
- Reverse proxies and load balancers
- Database connection pools
**Note:** Before reload-config.sh runs, Dropshell automatically syncs the latest configuration files to the remote server.
```bash
#!/bin/bash
source "${AGENT_PATH}/common.sh"
_check_required_env_vars "CONTAINER_NAME"
# Example: Reload nginx configuration
docker exec "$CONTAINER_NAME" nginx -s reload || _die "Failed to reload configuration"
echo "Configuration reloaded successfully"
```
**Example for Caddy:**
```bash
#!/bin/bash
source "${AGENT_PATH}/common.sh"
_check_required_env_vars "CONTAINER_NAME"
# Caddy supports hot-reload via API
docker exec "$CONTAINER_NAME" caddy reload --config /etc/caddy/Caddyfile || _die "Failed to reload Caddy"
echo "Caddy configuration reloaded"
```
### backup.sh
Backs up persistent data for a service. **OPTIONAL** - if not provided, `dropshell backup` reports "nothing to backup".