Automatically create Nextcloud Deck cards based on gitea issues. https://git.thijsdevries.net/dodedodo/deck-gitea-integration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Thijs de Vries da115e6a36
#6 Dockerfile added, documentation updated, port changed from 80->8080
5 years ago
app #6 Dockerfile added, documentation updated, port changed from 80->8080 5 years ago
.gitignore Parse gitea webhooks, post comments based on tag, verify tag exists. 5 years ago
LICENSE Initial commit 5 years ago
README.md #6 Dockerfile added, documentation updated, port changed from 80->8080 5 years ago

README.md

deck-gitea-integration

This NodeJS app automatically creates nextcloud Deck cards based on gitea issues.

May one day be published as a nextcloud/gitea plugin. Right now it's just for internal use. It's stable in my environment, but claims no guarantees to yours.

Overview

You'll need to set-up a gitea webhook for each repository you want to auto-add to deck. The webhook must point to the address where this node app is running.

The webhook requests that are now being sent to NodeJS will be parsed and published on Deck. In order to do so you'll need to provide

  • A Nextcloud isntallation (URL, not the api)
  • A Nextcloud username+password (or username+appPassword) that has access to your Deck board
  • A Nextcloud Deck board (numeric ID)
  • The deck stack(column) where you want your cards to appear when first created (numeric ID).
  • Gitea API url
  • Gitea API key, owned by a dedicated 'Deck' or 'Deckbot' user or something (Don't use your own username!). User must have colaboration access to the repo.

After that, a 'Deck' label will be added to your gitea repo, and a 'Gitea' label to your deck board.

When you add the 'Deck' label to an issue, the NodeJS app will automatically pick-up on it, and add the issue to deck. It will also post a notification in the issue that a Deck card has been created.

When the 'Deck' label is removed from an issue, the Deck card is destroyed. When you close an issue, the Deck card is archived.

When you remove a Deck card that's being tracked, the card will be re-added as soon as a webhook has been fired (AKA an action like commenting)

Under the hood

WIP

Deploy your own

Right now you shouldn't do it. This has only been tested by me, and only on a single set-up; mine.

If you wan't to do the alpha-testing, be my guest.

Docker

There's a docker file included. Install docker on your host, and follow the steps configure, build and run the container.

  1. Add a dedicated gitea account to your gitea. Grant collaboration access on every repository you want to integrate. Use a dedicated account because this app will comment in its name.
  2. Obtain a nextcloud app password. You may use a dedicated account or your own. Make sure the account has access to your nextcloud Deck board.
  3. git clone this repo and go to the 'app' folder git clone https://git.thijsdevries.net/dodedodo/deck-gitea-integration.git && cd deck-gitea-integration/app
  4. Edit the *ahem* 'configuration' to your liking. It's located on line 9 and 10 of index.js vi index.js
  5. After you're done editing, build the container. docker build . -t deck-gitea-integration:0.0.0-alpine
  6. Run the container !! Beware, this publishes an untested app on port 80 !! docker run -d -p 80:8080 --restart always --name deck-gitea deck-gitea-integration:0.0.0-alpine
  7. Optionally run docker logs deck-gitea -f to see the output.

After creating/modifying an issue the Deck label will be added to your gitea. A Gitea label will also automatically be created on Deck as soon as it tries to add an issue.

The app is stateless (besides the configuration of course). That means you dont need any persistent volumes, and you can restart the container all you like without damaging any sort of database.

If youre seeing errors in the docker logs, make sure all gitea/nextcloud permisions are set correctly! Secondly check if the URLs seem right. Especially look out for double slashed (//) inside urls.