Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(issue137): support ZEEBE_REST_ADDRESS and ZEEBE_GRPC_ADDRESS envi… #159

Merged
merged 1 commit into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ Put the following credentials in the environment:
```bash
# Self-Managed
export ZEEBE_SECURE_CONNECTION=false
export ZEEBE_ADDRESS='localhost:26500'
export ZEEBE_GRPC_ADDRESS='localhost:26500'
export ZEEBE_REST_ADDRESS='localhost:8080/v1/'
export ZEEBE_CLIENT_ID='zeebe'
export ZEEBE_CLIENT_SECRET='zecret'
export ZEEBE_AUTHORIZATION_SERVER_URL='http://localhost:18080/auth/realms/camunda-platform/protocol/openid-connect/token'
Expand Down Expand Up @@ -74,7 +75,8 @@ To run the multi-tenancy tests, use the following environment variables:
```bash
# Self-Managed
export ZEEBE_SECURE_CONNECTION=false
export ZEEBE_ADDRESS='localhost:26500'
export ZEEBE_GRPC_ADDRESS='localhost:26500'
export ZEEBE_REST_ADDRESS='localhost:8080/v1/'
export ZEEBE_CLIENT_ID='zeebe'
export ZEEBE_CLIENT_SECRET='zecret'
export ZEEBE_AUTHORIZATION_SERVER_URL='http://localhost:18080/auth/realms/camunda-platform/protocol/openid-connect/token'
Expand Down
6 changes: 4 additions & 2 deletions QUICKSTART.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ The environment variables that you need to set are the following (replace with y

```bash
# Self-Managed
export ZEEBE_ADDRESS='localhost:26500'
export ZEEBE_GRPC_ADDRESS='localhost:26500'
export ZEEBE_REST_ADDRESS='localhost:8080/v1/'
export ZEEBE_CLIENT_ID='zeebe'
export ZEEBE_CLIENT_SECRET='zecret'
export CAMUNDA_OAUTH_URL='http://localhost:18080/auth/realms/camunda-platform/protocol/openid-connect/token'
Expand All @@ -64,7 +65,8 @@ export CAMUNDA_SECURE_CONNECTION=false
### Camunda SaaS configuration

```bash
export ZEEBE_ADDRESS='5c34c0a7-...-125615f7a9b9.syd-1.zeebe.camunda.io:443'
export ZEEBE_GRPC_ADDRESS='5c34c0a7-...-125615f7a9b9.syd-1.zeebe.camunda.io:443'
export ZEEBE_REST_ADDRESS='https://syd-1.zeebe.camunda.io/5c34c0a7-7f29-4424-8414-125615f7a9b9'
export ZEEBE_CLIENT_ID='yvvURO...'
export ZEEBE_CLIENT_SECRET='iJJu-SHg...'
export CAMUNDA_TASKLIST_BASE_URL='https://syd-1.tasklist.camunda.io/5c34c0a7-...-125615f7a9b9'
Expand Down
27 changes: 15 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ With this environment variable set, the SDK will inject a `NullAuthProvider` tha
To get a token for use with the application APIs, provide the following configuration fields at a minimum, either via the `Camunda8` constructor or in environment variables:

```bash
ZEEBE_ADDRESS
ZEEBE_GRPC_ADDRESS
ZEEBE_CLIENT_ID
ZEEBE_CLIENT_SECRET
CAMUNDA_OAUTH_URL
Expand Down Expand Up @@ -118,7 +118,8 @@ This is the complete environment configuration needed to run against the Dockeri

```bash
# Self-Managed
export ZEEBE_ADDRESS='localhost:26500'
export ZEEBE_GRPC_ADDRESS='localhost:26500'
export ZEEBE_REST_ADDRESS='localhost:8080/v1/'
export ZEEBE_CLIENT_ID='zeebe'
export ZEEBE_CLIENT_SECRET='zecret'
export CAMUNDA_OAUTH_URL='http://localhost:18080/auth/realms/camunda-platform/protocol/openid-connect/token'
Expand Down Expand Up @@ -147,15 +148,16 @@ Here is an example of doing this via the constructor, rather than via the enviro
import { Camunda8 } from '@camunda8/sdk'

const c8 = new Camunda8({
ZEEBE_ADDRESS: 'localhost:26500'
ZEEBE_CLIENT_ID: 'zeebe'
ZEEBE_CLIENT_SECRET: 'zecret'
CAMUNDA_OAUTH_URL: 'http://localhost:18080/auth/realms/camunda-platform/protocol/openid-connect/token'
CAMUNDA_TASKLIST_BASE_URL: 'http://localhost:8082'
CAMUNDA_OPERATE_BASE_URL: 'http://localhost:8081'
CAMUNDA_OPTIMIZE_BASE_URL: 'http://localhost:8083'
CAMUNDA_MODELER_BASE_URL: 'http://localhost:8070/api'
CAMUNDA_TENANT_ID: '' // We can override values in the env by passing an empty string value
ZEEBE_GRPC_ADDRESS: 'localhost:26500',
ZEEBE_REST_ADDRESS: 'localhost:8080/v1/',
ZEEBE_CLIENT_ID: 'zeebe',
ZEEBE_CLIENT_SECRET: 'zecret',
CAMUNDA_OAUTH_URL: 'http://localhost:18080/auth/realms/camunda-platform/protocol/openid-connect/token',
CAMUNDA_TASKLIST_BASE_URL: 'http://localhost:8082',
CAMUNDA_OPERATE_BASE_URL: 'http://localhost:8081',
CAMUNDA_OPTIMIZE_BASE_URL: 'http://localhost:8083',
CAMUNDA_MODELER_BASE_URL: 'http://localhost:8070/api',
CAMUNDA_TENANT_ID: '', // We can override values in the env by passing an empty string value
CAMUNDA_SECURE_CONNECTION: false
})
```
Expand All @@ -165,7 +167,8 @@ const c8 = new Camunda8({
Here is a complete configuration example for connection to Camunda SaaS:

```bash
export ZEEBE_ADDRESS='5c34c0a7-7f29-4424-8414-125615f7a9b9.syd-1.zeebe.camunda.io:443'
export ZEEBE_GRPC_ADDRESS='5c34c0a7-7f29-4424-8414-125615f7a9b9.syd-1.zeebe.camunda.io:443'
export ZEEBE_REST_ADDRESS='https://yd-1.zeebe.camunda.io/5c34c0a7-7f29-4424-8414-125615f7a9b9'
export ZEEBE_CLIENT_ID='yvvURO9TmBnP3zx4Xd8Ho6apgeiZTjn6'
export ZEEBE_CLIENT_SECRET='iJJu-SHgUtuJTTAMnMLdcb8WGF8s2mHfXhXutEwe8eSbLXn98vUpoxtuLk5uG0en'
# export CAMUNDA_CREDENTIALS_SCOPES='Zeebe,Tasklist,Operate,Optimize' # What APIs these client creds are authorised for
Expand Down
3 changes: 2 additions & 1 deletion smoke-test/smoke-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ console.log('Running smoke test...')

const camunda = new Camunda8({
CAMUNDA_OAUTH_DISABLED: true,
ZEEBE_ADDRESS: 'localhost:26500',
ZEEBE_ADDRESS: 'localhost:26500', // to be deprecated
ZEEBE_GRPC_ADDRESS: 'localhost:26500',
ZEEBE_CLIENT_ID: 'zeebeClientId',
ZEEBE_CLIENT_SECRET: 'zeebeClientSecret',
CAMUNDA_CONSOLE_BASE_URL: 'http://localhost:8080',
Expand Down
13 changes: 13 additions & 0 deletions src/lib/Configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ const getMainEnv = () =>
optional: true,
default: 1000,
},
/** The address for the Zeebe GRPC. */
ZEEBE_GRPC_ADDRESS: {
type: 'string',
optional: true,
},
/** The address for the Zeebe REST API. Defaults to localhost:8080 */
ZEEBE_REST_ADDRESS: {
type: 'string',
optional: true,
default: 'http://localhost:8080',
},
/** The address for the Zeebe Gateway. Defaults to localhost:26500 */
ZEEBE_ADDRESS: {
type: 'string',
Expand Down Expand Up @@ -364,6 +375,8 @@ export const CamundaEnvironmentVariableDictionary =
'CAMUNDA_TOKEN_SCOPE',
'CAMUNDA_ZEEBE_OAUTH_AUDIENCE',
'GRPC_KEEPALIVE_TIME_MS',
'ZEEBE_REST_ADDRESS',
'ZEEBE_GRPC_ADDRESS',
'ZEEBE_ADDRESS',
'ZEEBE_CLIENT_ID',
'ZEEBE_CLIENT_SECRET',
Expand Down
4 changes: 2 additions & 2 deletions src/zeebe/zb/ZeebeGrpcClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ export class ZeebeGrpcClient extends TypedEmitter<
this.tenantId = this.options.tenantId

this.gatewayAddress = RequireConfiguration(
config.ZEEBE_ADDRESS,
'ZEEBE_ADDRESS'
config.ZEEBE_ADDRESS || config.ZEEBE_GRPC_ADDRESS,
'ZEEBE_GRPC_ADDRESS'
)

debug('Gateway address: ', this.gatewayAddress)
Expand Down
Loading