1
0
mirror of https://github.com/pinpox/gitea-matrix-bot synced 2024-11-22 10:21:58 +01:00
A bot to post gitea events to a matrix channel
Go to file
Pablo Ovelleiro Corral b48f6fa55c
trigger tavis
2019-04-19 11:17:27 +02:00
.gitignore gitignore binary 2019-04-18 20:40:06 +02:00
.travis.yml Update .travis.yml 2019-04-18 20:37:30 +02:00
config.ini.example initial commit 2019-04-13 12:31:28 +02:00
gitea-scrot.png added readme config info 2019-04-13 22:17:51 +02:00
giteabot.go Revert "split subscribe commands" 2019-04-18 20:45:16 +02:00
listener_test.go added test stubs 2019-04-13 22:50:41 +02:00
listener.go separated general bot from gitea 2019-04-14 22:38:13 +02:00
main.go add syncing 2019-04-18 21:27:49 +02:00
postdata.go cleaned up postdata struct 2019-04-13 20:21:58 +02:00
README.md Update README.md 2019-04-14 22:54:26 +02:00

Build Status GoDoc Go Report Card codecov

gitea-matrix-bot (WORK IN PROGRESS, ALPHA!)

A bot to listen for gitea webhooks and post to a matrix channel

Usage

Configuration

Copy config.ini.example to config.ini or creat a file called config.ini with the following options:

[http]
# The path the listener will expect the post data
http_uri = "/post"

# The port the listener will listen on
http_port = "9000"

[matrix]
# The matrix server to connect to
matrix_host = "http://matrix.org"

# User credentions of the bot for posting to the room
matrix_pass = "supersecretpass"
matrix_user = "my-awesome-bot"

Then start the bot. It will listen on the configured URI for incoming gitea hooks.

Create gitea hook

Create a new webhook in gitea. You an add a webhook to a single repository or add a default webhook that will apply to all you repos (recommended)

  • Choose the Webhook type Gitea for you Webhook
  • Configure which events you want to send. You can also select All Events
  • Set the Target URL to your host + the value you configured in the config.ini file. (e.g. http://myserver:9000/post)
  • Make sure that port is reachable/forwarded if you are behind a router and check your firewall
  • Set POST Content Type to applicatino/json
  • Add a secret (passphrase, password)

It will probably look like this: gitea scrot