No description
Find a file
2024-03-27 00:00:54 +01:00
src mattermost fixes, better config file, start on gitea integration 2024-03-27 00:00:54 +01:00
.gitignore mattermost fixes, better config file, start on gitea integration 2024-03-27 00:00:54 +01:00
.tool-versions mattermost fixes, better config file, start on gitea integration 2024-03-27 00:00:54 +01:00
config.example.toml mattermost fixes, better config file, start on gitea integration 2024-03-27 00:00:54 +01:00
Makefile update readme with latest state and workings 2024-03-26 21:52:18 +01:00
README.md update readme with latest state and workings 2024-03-26 21:52:18 +01:00
requirements.txt mattermost fixes, better config file, start on gitea integration 2024-03-27 00:00:54 +01:00

A python webserver that automatically hooks into a mattermost instance, listens for any mentions of codiMD files, downloads them locally and then commits them to a git repo based on a specific metadata block in the codimd file.

TODO

  • Hook into mattermost to automatically react to new files
  • Change gitlab integration to gitea

Done

  • Webserver that starts a sync when an endpoint is called
  • Automatic detection of codimd file links in mattermost message
  • Download of codimd files
  • Creation of a gitlab pull request for any new files
  • Creation of new commits for any new changes to the files. Hereby updating the existing pull request or creating a new one.

How to run (currently)

# Start local webserver
make webserver

# Curl the webserver to trigger the sync
make sync

CodiMD

You need to put the following block somewhere in you CodiMD file.

:::spoiler Gitlab sync
- sync-to: path/in/the/drive
:::

Setup

Install the glab tool using a package manager of your choice.

Set environment variable in your shell profile:

export GITLAB_HOST=https://git.zeus.gent
export GITLAB_TOKEN_NAME=the-token-name-in-gitlab
export GITLAB_TOKEN=********

export CMD_SERVER_URL=https://codimd.zeus.gent
export CMD_EMAIL=codimd.zeus.gent@mcbloch.dev
export CMD_PASSWORD=*******

Used tech

References