Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Morpheus Processes with Webhooks

License

NotificationsYou must be signed in to change notification settings

spoonboy-io/dozer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Morpheus Processes with Webhooks

GitHub go.mod Go versionGo Report CardGitHub Workflow StatusGitHub Workflow Status (branch)GitHub Release DateGitHub commits since latest release (by date)GitHub

About

Dozer watchesMorpheus CMP processes/events.It will notify external applications of Morpheus eventsvia HTTP request (webhook) based on YAML configuration you specify.

Releases

You can find thelatest software here.

Get Started

Dozer polls the Morpheus database so needs credentials. Themorpheus user can be used, but it is preferable tocreate an additional user with SELECT privileges on theprocess andprocess_type tables.

Amysql.env file should be created in the same directory as the application from which the database user configurationwill be read. The following example shows the environment variables used by Dozer which should be included inmysql.env:

## MySQL ConfigMYSQL_SERVER=127.0.0.1MYSQL_USER=dozerMYSQL_PASSWORD=xxxxa8aca0de5dab5fa1bxxxxx## Optional to override defaultsMYSQL_DATABASE=morpheusPOLL_INTERVAL_SECONDS=3

Webhook Configuration

Webhooks and their triggers are configured in a YAML filewebhook.yaml which should reside in the same directoryas the Dozer application. An example configuration, showing a single Webhook is shown below:

----webhook:description:Hook example with trigger that runs when status is `complete`url:https://webhook-endpoint.commethod:POSTrequestBody:|        {            "id": {{.Id}},            "updatedBy": "{{.UpdatedBy}}",            "status": "{{.Status}}"        }token:BEARER xxxxxxxxxxxxxxtriggers:status:complete

GET and POST methods are supported. If POST method Dozer will look forrequestBody.

Iftoken is supplied it will be sent in the AUTHORIZATION header.

Variables which contain information about the Morpheus process can be interpolated in therequestBody using the standard Golangtemplating format. A complete list can be foundhere.

Triggers

Currently, Webhook triggers can be specified onstatus,processType,taskName,accountId andcreatedBy. They areevaluated on processes which have finished running, not in-progress processes. Triggers are additive - all conditions mustbe satisfied for the Webhook to fire.

TriggerDescriptionYAML Example
statusRuns when the process is complete or failedstatus: failed
processTypeRuns for a specific process type (see list here)processType: localWorkflow
taskNameRuns for a given task nametaskName: Hello World
accountIdRuns for specific tenant idaccountId: 2
createdByRuns for processes created by a specific usercreatedBy: admin

Installation

Grab the tar.gz or zip archive for your OS from thereleases page.

Unpack it to the target host, and then start the server.

./dozer

Or with nohup..

nohup ./dozer &

Development Opportunities

  • Add more triggers such aszoneId,instanceName,appName,containerName
  • Retry and blacklisting for webhooks that fail
  • Other notification mechanisms such as email or messaging protocol
  • Run as a service

License

Licensed underMozilla Public License 2.0


[8]ページ先頭

©2009-2025 Movatter.jp