Setup
Corteza Command Line Interface (CLI)
Corteza comes with command line interface tool. With it, you can manually or automatically change applications settings, add users, roles, and run the API. You are using the same binary that can start the backend service and the API.
-
Microservice build produce
corteza-server-system
,corteza-server-messaging
andcorteza-server-compose
-
Monolith build produces
corteza-server
binary with system, messaging, compose subcommands
Using the CLI tool
At least basic Docker and Docker Compose knowledge is required for most Corteza setup and management. |
docker-compose exec <service name> help
docker exec -it <container name> help
docker run -it --rm <container name> help
docker run -it --rm [docker run options] <container name> help
Running and executing with Docker Compose should be easier and simpler because all required options and settings
for container are packed in the Docker Compose project configuration file (docker-compose.yaml )
|
Usage:
corteza-server serve-api [flags]
Flags:
-h, --help help for serve-api
Usage:
corteza-server provision [command]
Available Commands:
configuration Create permissions & resources
migrate-database Run database migration scripts
Flags:
-h, --help help for provision
Use "corteza-server provision [command] --help" for more information about a command.
Usage:
corteza-server provision configuration [flags]
Flags:
-h, --help help for configuration
Usage:
corteza-server provision migrate-database [flags]
Flags:
-h, --help help for migrate-database
Usage:
corteza-server system auth [command]
Available Commands:
auto-discovery Auto discovers new OIDC client
jwt Generates new JWT for a user
test-notifications Sends samples of all authentication notification to receipient
Flags:
-h, --help help for auth
Use "corteza-server system auth [command] --help" for more information about a command.
Usage:
corteza-server system auth auto-discovery [name] [url] [flags]
Flags:
--enable Enable this provider and external auth
-h, --help help for auto-discovery
--skip-validation Skip validation
Usage:
corteza-server system auth test-notifications [recipient] [flags]
Flags:
-h, --help help for test-notifications
Usage:
corteza-server system auth jwt [email-or-id] [flags]
Flags:
-h, --help help for jwt
Usage:
corteza-server system export [flags]
Flags:
-h, --help help for export
-p, --permissions Export system permissions
-s, --settings Export settings
Usage:
corteza-server system import [flags]
Flags:
-h, --help help for import
Usage:
corteza-server system roles [command]
Available Commands:
useradd Add user to role
Flags:
-h, --help help for roles
Use "corteza-server system roles [command] --help" for more information about a command.
Usage:
corteza-server system roles useradd [role-ID-or-name-or-handle] [user-ID-or-email] [flags]
Flags:
-h, --help help for useradd
Usage:
corteza-server system settings [command]
Available Commands:
delete Set value (raw JSON) for a specific key (or by prefix)
export Import settings as JSON to stdout or file
get Get value (raw JSON) for a specific key
import Import settings as JSON from stdin or file
list List all
set Set value (raw JSON) for a specific key
Flags:
-h, --help help for settings
Use "corteza-server system settings [command] --help" for more information about a command.
Usage:
corteza-server system settings delete [keys, ...] [flags]
Flags:
-h, --help help for delete
--prefix string Filter settings by prefix
Usage:
corteza-server system settings export [file] [flags]
Flags:
-h, --help help for export
Usage:
corteza-server system settings get [key to get, ...] [flags]
Flags:
-h, --help help for get
Usage:
corteza-server system settings import [file] [flags]
Flags:
-h, --help help for import
Usage:
corteza-server system settings list [flags]
Flags:
-h, --help help for list
--prefix string Filter settings by prefix
Usage:
corteza-server system settings set [key to set] [value] [flags]
Flags:
-h, --help help for set
Usage:
corteza-server system sink [command]
Available Commands:
signature Creates signature for sink HTTP endpoint
Flags:
-h, --help help for sink
Use "corteza-server system sink [command] --help" for more information about a command.
Usage:
corteza-server system sink signature [flags]
Flags:
--content-type string Content type (optional)
--expires string Date of expiration (YYYY-MM-DD, optional)
-h, --help help for signature
--method string HTTP method that will be used (default "GET")
--origin string Origin of the request (arbitrary string, optional)
Usage:
corteza-server system users [command]
Available Commands:
add Add new user
list List users
password Change password for user
Flags:
-h, --help help for users
Use "corteza-server system users [command] --help" for more information about a command.
Usage:
corteza-server system users add [email] [flags]
Flags:
-h, --help help for add
--no-password Create user without password
Usage:
corteza-server system users list [flags]
Flags:
-h, --help help for list
Usage:
corteza-server system users password [email] [flags]
Flags:
-h, --help help for password
Usage:
corteza-server compose export [flags]
Flags:
-h, --help help for export
--namespace string Export namespace resources (by ID or string)
-p, --permissions Export system permissions
-s, --settings Export settings
Usage:
corteza-server compose import [flags]
Flags:
-h, --help help for import
--namespace string Import into namespace (by ID or string)
Usage:
corteza-server messaging export [flags]
Flags:
-h, --help help for export
-p, --permissions Export system permissions
-s, --settings Export settings
Usage:
corteza-server messaging import [flags]
Flags:
-h, --help help for import
API Server
Provisioning
Provisioning is step after server is started and API becomes available.
It allows you to directly influence how a fresh Corteza instance is configured on first run.
This entire process can be disabled by setting env. variables PROVISION_MIGRATE_DATABASE
and PROVISION_CONFIGURATION
to false
.
Type | Default value | Description |
---|---|---|
|
||
|
|
Controls if database migration (creation of tables, changes of schema between versions) should be done before each service is started. It’s recommended to keep this setting on. Disabling it on a running server prevents migration between version udpates |
|
||
|
|
Runs various auto-setup procedures and creates resources: - creates default permission rules and roles - default channels are created - default applications are created - compose resources (namespaces, modules, charts,…) - settings auto-discovery |
Type | Default value | Description |
---|---|---|
|
||
|
||
|
|
Is OAuth2 enabled or disabled OAuth2 flow redirection URL. |
|
||
|
||
|
searches env-variables ( |
|
|
||
|
||
|
|
generated 64 char long string if missing. Is session cookie "secure" flag used (if yes, cookie can only be access over HTTPS). |
|
||
|
||
|
|
If HTTPS is used for external auth redirection url, value is set to true. |
|
||
|
||
|
Where the frontend SPA is located. Serves as base for generating other |
|
|
||
|
||
|
Where the frontend SPA is located, the password reset form. Where the frontend SPA is located, password email confirmation page. |
|
|
||
|
||
|
|
|
|
||
|
||
|
Where the frontend SPA is located. User will be redirected here on successful external authentication.
Auto discovery uses |
|
|
||
|
||
|
Email address used for sending auth emails (password reset, email confirmation) Name used for sending auth emails (password reset, email confirmation) |
|
|
||
|
||
|
Corteza Team (to-be-configured) Is internal auth enabled? Enable this to allow users to use all (enabled) internal features (sign-up, log in….) |
|
|
||
|
||
|
|
|
|
||
|
||
|
|
Is internal sign-up enabled? Enable this to allow users to register if you do not have external authentication providers. |
|
||
|
||
|
|
Is email confirmation required for internal sign-ups?
Enabled on auto-discovery if server has email capabilities ( |
|
||
|
||
|
|
Is password reset enabled for internal account?
Auto-discovery enables this if server has email capabilities ( |
Type | Default value | Description |
---|---|---|
|
||
|
Registers all given providers on start.
Provide a list of space delimited provider pairs ( The provider is auto-discovered only if it does not exist (match by name). Also, make sure that your redirect URL ( |
|
|
||
|
Sets value for This should be set to: |
Type | Default value | Description |
---|---|---|
|
||
|
Github’s app credentials: |
|
|
||
|
Facebook’s app credentials: |
|
|
||
|
Google’s app credentials: |
|
|
||
|
LinkedIn’s app credentials: |
|
|
||
|
OIDC provider settings |
Server options
Type | Default value | Description |
---|---|---|
|
||
|
|
Enable/disable Corredor integration |
|
||
|
|
Hostname and port of the Corredor gRPC server |
|
||
|
|
Log communication with Corredor |
|
||
|
|
Max delay for backoff on connection |
|
||
|
Instructions passed to Corredor on every call - where Corteza API is located. |
|
|
||
|
Instructions passed to Corredor on every call - where Corteza API is located. |
|
|
||
|
Instructions passed to Corredor on every call - where Corteza API is located. |
|
|
||
|
|
Database connection string <username>:<password>@(<host>:<port>)/<dbname>?collation=utf8mb4_general_ci |
|
||
|
|
Log SQL queries |
|
||
|
|
Max number of connection retries |
|
||
|
|
How long do we wait between retries |
|
||
|
|
For how long do we try to connect |
|
||
|
|
Network to use for gRPC |
|
||
|
|
Where do we listen for gRPC connections |
|
||
|
|
Max delay for backoff on connection |
|
||
|
|
Log gRPC communication |
|
||
|
|
IP & port for HTTP server |
|
||
|
|
Log requests |
|
||
|
|
Log responses |
|
||
|
|
Enable /version route |
|
||
|
|
Enable /debug route |
|
||
|
|
Enable (prometheus) metrics |
|
||
|
|
Name for metrics endpoint |
|
||
|
|
Username for metrics endpoint |
|
||
|
|
Password for metrics endpoint |
|
||
|
Report panic to Sentry |
|
|
||
|
|
Allow insecure (invalid, expired TSL/SSL cert) |
|
||
|
|
Default timeout for clients |
|
||
|
|
Secret used for signing JWT tokens |
|
||
|
|
Expiration time |
|
||
|
|
Output (log) interval for monitoring |
|
||
|
|
Migrate database (if needed) on server start |
|
||
|
|
Import configuration (only on empty database) on server start |
|
||
|
Set to enable Sentry client |
|
|
||
|
|
Print out debugging information |
|
||
|
|
Attach stacktraces |
|
||
|
Sample rate for event submission (0.0 - 1.0, defaults to 1.0) |
|
|
||
|
Maximum number of breadcrumbs |
|
|
||
|
Set reported Server name |
|
|
||
|
|
Set reported Release |
|
||
|
Set reported distribution |
|
|
||
|
Set reported environment |
|
|
||
|
|
|
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
|
Where do we store uploaded files |
|
||
|
||
|
||
|
|
|
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
|
Delaying API execution
With WAIT_FOR*
Delaying API execution, waiting for external (HTTP) services.
This might aid you in complex setup where another service should be running and accessible before Corteza is ready.
Type | Default value | Description |
---|---|---|
|
||
|
|
Delays API startup for the amount of time specified (10s, 2m…). This delay happens before service (WAIT_FOR_SERVICES) probing. |
|
||
|
|
Show temporary status web page. |
|
||
|
Space delimited list of hosts and/or URLs to probe.
Host format: Services are probed in parallel. |
|
|
||
|
|
Max time for each service probe. |
|
||
|
|
Timeout for each service probe. |
|
||
|
|
Interval between service probes. |
Corredor Server
Environmental variables used by Corredor and API Server when connected to and communicating with Corredor.
Type | Default value | Description |
---|---|---|
|
||
|
|
This setting is used by both, Corredor and API Server. For Corredor server: where is server listening on For API server: where can Corredor server be accessed. Used by Corredor and API server. |
|
||
|
|
This is a setting for API server, will Corredor be used for server automation? Used by Corredor and API server. |
|
||
|
|
Connection timeout (from API server to Corredor) Used by API server. |
|
||
|
Location of the compose API (example: Used by API server. |
|
|
||
|
Location of the messagign API (example: Used by API server. |
|
|
||
|
Location of the system API (example: Used by API server. |
|
|
||
|
|
This setting is used by both, Corredor and API Server. For Corredor service: where is service listening on (gRPC) For API server: where can Corredor service be accessed. Used by Corredor and API server. |
|
||
|
|
If set to true, API server will log communication with Corredor and Corredor will log incoming requests. Used by Corredor and API server. |
|
||
|
|
Defaults to Used by Corredor and API server. |
|
||
|
|
Are events logged in one-line JSON or formatted to ease development? Used by Corredor. |
|
||
|
|
Corredor will log even more information Used by Corredor. |
Email automation: processing inbound email
Corteza supports email automation and processing of incoming email messages. This can be achieved through local email service like [postfix] or 3rd party provider that forward received emails through webhooks.
-
Email is received by internal or external system
-
Email is forwarded to sink API endpoint
-
Corteza sink service extracts header and body data from received email
-
onReceive triggers are filtered for a match (trigger can be configured to match specific headers like sender or subject)
-
Automation script is called
Preparing (signing) sink URL
Signing the URL (the sign=… parameter and value) is created as a combination of all parameters and Corteza’s secret string. This signature should be kept secret as it is effectively same as password that allows access to Corteza.
docker-compose exec server system sink signature --method POST --origin postfix --content-type email
/sink?content-type=email&expires=&method=POST&origin=postfix&sign=6280d530ae74f1f9c55e4dd362c9ef2094221287
Parameter | Description |
---|---|
method |
must match the request method |
origin |
arbitrary string, can be used to describe |
content-type |
used to set the processor for the data inputed |
expires |
can be used to sign link with expiration date. |
echo "
From:
To:
Subject: hello
Message-ID: <1234@local.machine.example>
Ola Corteza!
" | curl -i --data-binary @- "https://api.your-corteza-instance.tld/system/sink?content-type=email&expires=&method=POST&origin=postfix&sign=6280d530ae74f1f9c55e4dd362c9ef2094221287'"
This command must return 200 OK
response.