Configuration Commands#
Manage and validate GeoServer CLI configuration files.
Initialize Configuration#
Create a new configuration file template.
1
2
3
4
5
| # Create default config
./geoserver-cli config init
# Create custom config
./geoserver-cli config init --config configs/prod.config.toml
|
This creates a TOML file with all available settings and helpful comments.
Show Configuration#
Display the resolved configuration (after merging defaults, file, env vars, and flags).
1
| ./geoserver-cli config show
|
Output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
| Active config: configs/default.config.toml
[geoserver]
base_url = "http://localhost:8080/geoserver/rest"
username = "admin"
password = "***" (from config file)
timeout = "30s"
[postgis]
host = "localhost"
port = 5432
database = "gis"
user = "postgres"
password = "***" (from config file)
schema = "public"
sslmode = "disable"
Environment variable overrides:
GEOSRVCLI_ENDPOINT - override base_url
GEOSRVCLI_USERNAME - override username
GEOSRVCLI_PASSWORD - override password
...
|
Validate Configuration#
Check configuration file for errors and security issues.
1
| ./geoserver-cli config validate
|
Checks:
- Required fields are present
- File permissions are secure (passwords not world-readable)
- TOML syntax is valid
- Values are in expected format
Example Output:
1
2
| ✓ Configuration file is valid
✓ File permissions are secure (0600)
|
Error Output:
1
2
3
| ✗ Configuration file has issues:
- Missing required field: geoserver.base_url
- File permissions too permissive (0644), should be 0600
|
Examples#
Setup New Environment#
1
2
3
4
5
6
7
8
9
10
11
| # 1. Initialize config
./geoserver-cli config init --config configs/staging.config.toml
# 2. Edit with your settings
vim configs/staging.config.toml
# 3. Validate
./geoserver-cli config validate --config staging
# 4. Test
./geoserver-cli config show --config staging
|
Debug Configuration Issues#
1
2
3
4
5
| # Show resolved config to see what's actually being used
./geoserver-cli config show
# Validate to check for errors
./geoserver-cli config validate
|
Secure Configuration#
1
2
3
4
5
| # Ensure config file has secure permissions
chmod 600 configs/prod.config.toml
# Validate to confirm
./geoserver-cli config validate --config prod
|