Web service setup
HTTP Service Configuration
The http section allows you to configure unencrypted HTTP services. You can define multiple HTTP services by adding more objects to the array.
"http": [
{
"port": 8080,
"basic_auth": false,
"username": null,
"password": null,
"skin": "demo_api"
}
]HTTP Options
| Option | Values | Description |
|---|---|---|
| port (required) | 1-65535 | TCP port number for the HTTP service |
| basic_auth | true, false | Enables/disables HTTP Basic Authentication |
| username (if basic auth) | null or string | Username for HTTP Basic Authentication |
| password (if basic auth) | null or string | Password for HTTP Basic Authentication |
| skin | skin folder name | Web interface theme |
HTTPS Service Configuration
The https section configures encrypted HTTPS services. Like HTTP, you can define multiple HTTPS services.
"https": [
{
"port": 8443,
"basic_auth": false,
"username": "admin",
"password": "admin",
"skin": "default_apache",
"country_name": "",
"state_or_province_name": "",
"locality_name": "",
"organization_name": "Example",
"common_name": "example.com",
"key": "trapster/data/ssl/key.pem",
"certificate": "trapster/data/ssl/certificate.pem"
}
]HTTPS Options
All HTTP options apply, plus these additional SSL/TLS-specific options.
If no SSL key/certificate is specified or the files don't exist, Trapster will automatically generate self-signed certificates. But you can also provide your own valid certificates.
| Option | Values | Description |
|---|---|---|
| country_name | null or string | Two-letter country code (e.g., "US", "GB") for SSL certificate |
| state_or_province_name | null or string | State or province for SSL certificate |
| locality_name | null or string | City or locality for SSL certificate |
| organization_name | null or string | Organization name for SSL certificate (e.g., "My Company Ltd") |
| common_name (required) | string | Domain name for SSL certificate (e.g., "example.com") |
| key (required) | string | Path to SSL private key file (PEM format) (will be generated if the file doesn't exist) |
| certificate (required) | string | Path to SSL certificate file (PEM format) (will be generated if the file doesn't exist) |
Skin or templates
The skin option allows you to specify the skin or template to use for the web service.
It is a folder name in the trapster/data/http directory.
By default, Trapster comes with a few skins:
default_apache: Default Apache web server pagedefault_nginx: Default Nginx web server pagefortigate: Fortigate login page emulationdemo_api: A simple demo API to showcase the Trapster Web Framework capabilitiesdemo_ai: A demo showcasing AI-powered dynamic responses
But you can also create your own skins. For more information, please refer to the YAML Templates documentation.
