Compare commits
27 commits
developmen
...
master
Author | SHA1 | Date | |
---|---|---|---|
f2e81c5150 | |||
c1757005b6 | |||
3ce0786576 | |||
4bbbe55f38 | |||
6da5346e31 | |||
9219a816d5 | |||
5d0c848321 | |||
1cf9a568f7 | |||
|
553eeb8e07 | ||
|
24fad0d046 | ||
|
df3ffb528f | ||
|
3e24f63e29 | ||
|
e3c0ddc9da | ||
|
260d077121 | ||
|
6ea3b08b99 | ||
|
6c52456aba | ||
|
9f3034915d | ||
|
46cfbdeecd | ||
|
1c39884895 | ||
|
a5815a0de8 | ||
|
9de49651a9 | ||
|
39b5326fec | ||
|
bf649046fc | ||
|
eaf1466326 | ||
|
7e3fd3cc38 | ||
|
709cc74d46 | ||
|
ce90767eba |
6 changed files with 137 additions and 272 deletions
55
.github/workflows/build.yml
vendored
Normal file
55
.github/workflows/build.yml
vendored
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
name: build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: docker
|
||||||
|
outputs:
|
||||||
|
version: ${{ steps.version.outputs.version }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Define next tag
|
||||||
|
uses: https://github.com/paulhatch/semantic-version@v5.0.2
|
||||||
|
id: version
|
||||||
|
with:
|
||||||
|
tag_prefix: ""
|
||||||
|
major_pattern: "(MAJOR)"
|
||||||
|
minor_pattern: "(MINOR)"
|
||||||
|
change_path: .
|
||||||
|
version_format: "${major}.${minor}.${patch}"
|
||||||
|
|
||||||
|
- name: Create tag
|
||||||
|
run: |
|
||||||
|
git config --global user.name "${GITHUB_ACTOR}"
|
||||||
|
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
|
||||||
|
|
||||||
|
git tag "${{ steps.version.outputs.version }}" -m "[forgejo-action-tag]"
|
||||||
|
git push origin --tags
|
||||||
|
docker:
|
||||||
|
runs-on: host
|
||||||
|
needs:
|
||||||
|
- release
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: git.h2-invent.com
|
||||||
|
username: ${{ secrets.FORGEJO_ACTION_PACKAGE_RW_USER }}
|
||||||
|
password: ${{ secrets.FORGEJO_ACTION_PACKAGE_RW_KEY }}
|
||||||
|
|
||||||
|
- name: Build and push Image
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
push: true
|
||||||
|
tags: git.h2-invent.com/meetling/matrix-bot:${{ needs.release.outputs.version }}
|
92
.github/workflows/pipeline-release.yml
vendored
92
.github/workflows/pipeline-release.yml
vendored
|
@ -1,92 +0,0 @@
|
||||||
name: Create Release
|
|
||||||
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.token }}
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
artifact:
|
|
||||||
uses: h2-invent/jitsi-admin-matrix-bot/.github/workflows/task-artifact.yml@master
|
|
||||||
|
|
||||||
create_release:
|
|
||||||
needs:
|
|
||||||
- artifact
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
|
||||||
create_release_output: ${{ steps.version.outputs.version }}
|
|
||||||
steps:
|
|
||||||
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- uses: paulhatch/semantic-version@v5.0.2
|
|
||||||
id: version
|
|
||||||
with:
|
|
||||||
tag_prefix: ""
|
|
||||||
major_pattern: "(MAJOR)"
|
|
||||||
minor_pattern: "(MINOR)"
|
|
||||||
change_path: .
|
|
||||||
version_format: "${major}.${minor}.${patch}"
|
|
||||||
|
|
||||||
- name: Write semantic Version in config file
|
|
||||||
uses: jacobtomlinson/gha-find-replace@v3
|
|
||||||
with:
|
|
||||||
find: "<version-addhere>"
|
|
||||||
replace: "${{ steps.version.outputs.version }}"
|
|
||||||
regex: false
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: artifact_${{github.run_number}}
|
|
||||||
|
|
||||||
- run: unzip -qq artifact_${{github.run_number}}.zip -d artifact
|
|
||||||
|
|
||||||
- name: Write semantic Version in config file
|
|
||||||
uses: jacobtomlinson/gha-find-replace@v3
|
|
||||||
with:
|
|
||||||
find: "<version-addhere>"
|
|
||||||
replace: "${{ steps.version.outputs.version }}"
|
|
||||||
regex: false
|
|
||||||
include: "artifact/config.mjs"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- name: Archive Release for application
|
|
||||||
uses: thedoctor0/zip-release@0.7.1
|
|
||||||
with:
|
|
||||||
type: 'zip'
|
|
||||||
filename: 'application.zip'
|
|
||||||
exclusions: '*.git* *.github*'
|
|
||||||
directory: artifact
|
|
||||||
|
|
||||||
- name: Create new Release with semantic-version tag
|
|
||||||
uses: ncipollo/release-action@v1
|
|
||||||
id: create_release
|
|
||||||
with:
|
|
||||||
draft: false
|
|
||||||
prerelease: false
|
|
||||||
name: Release ${{ steps.version.outputs.version }}
|
|
||||||
tag: ${{ steps.version.outputs.version }}
|
|
||||||
artifacts: artifact/application.zip
|
|
||||||
artifactContentType: application/zip
|
|
||||||
bodyFile: RELEASE_NOTE.md
|
|
||||||
|
|
||||||
upload_dockerhub_main:
|
|
||||||
needs:
|
|
||||||
- create_release
|
|
||||||
uses: h2-invent/jitsi-admin-matrix-bot/.github/workflows/task-upload-docker-hub.yml@master
|
|
||||||
with:
|
|
||||||
reponame: 'h2invent/jitsi-admin-matrix-bot'
|
|
||||||
dockerfile_path: './Dockerfile'
|
|
||||||
directory: '.'
|
|
||||||
version: h2invent/jitsi-admin-matrix-bot:latest,h2invent/jitsi-admin-matrix-bot:${{ needs.create_release.outputs.create_release_output }}
|
|
||||||
secrets:
|
|
||||||
dockerhub_password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
28
.github/workflows/task-artifact.yml
vendored
28
.github/workflows/task-artifact.yml
vendored
|
@ -1,28 +0,0 @@
|
||||||
name: Build Artifacts
|
|
||||||
|
|
||||||
on: workflow_call
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Install NPM Packages
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: ${{ vars.NODE_VERSION }}
|
|
||||||
|
|
||||||
- name: Install Node modules
|
|
||||||
run: npm install
|
|
||||||
|
|
||||||
|
|
||||||
- uses: montudor/action-zip@v1
|
|
||||||
with:
|
|
||||||
args: zip -qq -r artifact_${{github.run_number}}.zip .
|
|
||||||
|
|
||||||
- name: Upload articats
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: artifact_${{github.run_number}}
|
|
||||||
path: artifact_${{github.run_number}}.zip
|
|
78
.github/workflows/task-upload-docker-hub.yml
vendored
78
.github/workflows/task-upload-docker-hub.yml
vendored
|
@ -1,78 +0,0 @@
|
||||||
# This workflow uses actions that are not certified by GitHub.
|
|
||||||
# They are provided by a third-party and are governed by
|
|
||||||
# separate terms of service, privacy policy, and support
|
|
||||||
# documentation.
|
|
||||||
|
|
||||||
# GitHub recommends pinning actions to a commit SHA.
|
|
||||||
# To get a newer version, you will need to update the SHA.
|
|
||||||
# You can also reference a tag or branch, but the action may change without warning.
|
|
||||||
|
|
||||||
name: Publish Docker image
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
reponame:
|
|
||||||
description: 'the image name of the docker hub image'
|
|
||||||
default: 'h2invent/jitsi-admin-main'
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
directory:
|
|
||||||
description: 'the dir of the Dockerfile image'
|
|
||||||
default: '.'
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
dockerfile_path:
|
|
||||||
description: 'the name of the Dockerfile image'
|
|
||||||
default: './Dockerfile'
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
version:
|
|
||||||
description: 'the version/tag of the Dockerfile image'
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
|
|
||||||
secrets:
|
|
||||||
dockerhub_username:
|
|
||||||
required: true
|
|
||||||
dockerhub_password:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
push_to_registry:
|
|
||||||
name: Push Docker image to Docker Hub
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Get current Username
|
|
||||||
id: date
|
|
||||||
run: echo "${{ secrets.dockerhub_password }}"
|
|
||||||
|
|
||||||
- name: Check out the repo
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Write semantic Version in config file
|
|
||||||
uses: jacobtomlinson/gha-find-replace@v3
|
|
||||||
with:
|
|
||||||
find: "<version-addhere>"
|
|
||||||
replace: "${{ inputs.version }}"
|
|
||||||
regex: false
|
|
||||||
|
|
||||||
- name: Log in to Docker Hub
|
|
||||||
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.dockerhub_username }}
|
|
||||||
password: ${{ secrets.dockerhub_password }}
|
|
||||||
|
|
||||||
- name: Extract metadata (tags, labels) for Docker
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
|
|
||||||
with:
|
|
||||||
images: ${{ inputs.reponame }}
|
|
||||||
|
|
||||||
- name: Build and push Docker image
|
|
||||||
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
|
|
||||||
with:
|
|
||||||
context: ${{ inputs.directory }}
|
|
||||||
file: ${{ inputs.dockerfile_path }}
|
|
||||||
push: true
|
|
||||||
tags: ${{ inputs.version }}
|
|
152
README.md
152
README.md
|
@ -1,75 +1,85 @@
|
||||||
## Matrix Jitsi-admin Bot
|
# Matrix Meetling Bot
|
||||||
|
|
||||||
Dies ist ein Bot, der für die Verwaltung von Jitsi-Meetings über Matrix erstellt wurde. Der Bot ermöglicht die Steuerung und Verwaltung von Meetings über eine Matrix-Instanz.
|
Ein Bot zur Verwaltung von **Jitsi-Meetings** über eine **Matrix-Instanz**. Mit diesem Bot lassen sich Jitsi-Sitzungen direkt über Matrix steuern und verwalten - ideal für automatisierte Konferenzen und Raumverwaltung.
|
||||||
|
|
||||||
### Installation
|
|
||||||
|
|
||||||
#### Token erstellen
|
|
||||||
|
|
||||||
1. Klonen des Repositorys:
|
|
||||||
|
|
||||||
```
|
|
||||||
git clone https://de-h2-git01.h2.home/emanuel.holzmann/matrix-bot.git
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Installation der benötigten Pakete:
|
|
||||||
|
|
||||||
```
|
|
||||||
npm install
|
|
||||||
```
|
|
||||||
|
|
||||||
3. Generieren des Tokens:
|
|
||||||
|
|
||||||
Führen Sie den folgenden Befehl aus und ersetzen Sie `username`, `passwort` und `https://matrixdomain.org` durch die entsprechenden Anmeldeinformationen:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
MATRIX_USERNAME=username MATRIX_PASSWORD=passwort MATRIX_URL=https://matrixdomain.org node login.mjs
|
|
||||||
```
|
|
||||||
|
|
||||||
Der generierte Access-Token muss sicher aufbewahrt werden, da er der Schlüssel für den Docker-Container ist.
|
|
||||||
|
|
||||||
#### Container starten
|
|
||||||
|
|
||||||
1. Erneutes Checkout der Anwendung (optional, wenn bereits geklont):
|
|
||||||
|
|
||||||
```
|
|
||||||
git clone https://de-h2-git01.h2.home/emanuel.holzmann/matrix-bot.git
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Wechseln in das Verzeichnis:
|
|
||||||
|
|
||||||
```
|
|
||||||
cd matrix-bot
|
|
||||||
```
|
|
||||||
|
|
||||||
3. Bauen der Anwendung und Starten des Containers mit `docker-compose`:
|
|
||||||
|
|
||||||
Führen Sie den folgenden Befehl aus und ersetzen Sie `tokenKommtHIerHer` durch den generierten Accesstoken aus Schritt 1, `https://matrixdomain.org` und `https://jitsi-admin-url.de` müssen durch reale URLs ersetzt werden:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
MATRIX_TOKEN=tokenKommtHIerHer MATRIX_URL=https://matrixdomain.org JITSI_ADMIN_URL=https://jitsi-admin-url.de docker-compose up --build -d
|
|
||||||
```
|
|
||||||
|
|
||||||
4. Berechtigungen für das Volume festlegen:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
chown -R 1000:1000 /var/lib/docker/volumes/matrix-bot_secret_data/
|
|
||||||
```
|
|
||||||
|
|
||||||
5. Possible Arguments
|
|
||||||
|
|
||||||
````shell
|
|
||||||
MATRIX_URL=<Matrix Url>|https://matrix.org
|
|
||||||
MATRIX_TOKEN=<Matrix Token>
|
|
||||||
MATRIX_PASSWORD=<Matrix password>
|
|
||||||
JITSI_ADMIN_URL=<jitsi admin url>|https://jitsi-admin.de
|
|
||||||
MATRIX_DISPLAYNAME=<displayName of the bot>|"Raumassistent"
|
|
||||||
SHOW_WARNING_OF_MIM=<boolean show if a warning>|false
|
|
||||||
````
|
|
||||||
### Hinweise
|
|
||||||
|
|
||||||
Stellen Sie sicher, dass die Umgebungsvariablen korrekt gesetzt sind und die Zugangsdaten sicher behandelt werden. Der Bot ermöglicht die Verwaltung von Jitsi-Meetings über Matrix und kann entsprechend konfiguriert werden.
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Bitte beachten Sie, dass die Pfadangaben, Token und URLs entsprechend Ihren tatsächlichen Konfigurationen und Anforderungen angepasst werden müssen.
|
## 🚀 Funktionen
|
||||||
|
|
||||||
|
- Starten und Verwalten von Jitsi-Meetings über Matrix
|
||||||
|
- Konfigurierbare Umgebungsvariablen
|
||||||
|
- Integration über Docker möglich
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🛠️ Installation & Einrichtung
|
||||||
|
|
||||||
|
### 1. 🔑 Matrix-Zugangstoken generieren
|
||||||
|
|
||||||
|
Führe den folgenden Befehl aus, um einen Access-Token zu generieren. Ersetze `username`, `passwort` und die URL durch deine echten Zugangsdaten:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run --rm -it \
|
||||||
|
-e MATRIX_USERNAME=username \
|
||||||
|
-e MATRIX_PASSWORD=passwort \
|
||||||
|
-e MATRIX_URL=https://matrixdomain.org \
|
||||||
|
git.h2-invent.com/meetling/matrix-bot:2.2.7 \
|
||||||
|
node login.mjs
|
||||||
|
```
|
||||||
|
|
||||||
|
> 💡 **Hinweis:** Bewahre den generierten Token sicher auf - er wird zur Authentifizierung im Container verwendet.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🐳 Deployment mit Docker
|
||||||
|
|
||||||
|
### 1. 📂 Docker Compose Download
|
||||||
|
|
||||||
|
Falls noch nicht geschehen:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mkdir /opt/matrix-bot
|
||||||
|
cd /opt/matrix-bot
|
||||||
|
wget https://git.h2-invent.com/Meetling/matrix-bot/raw/branch/master/docker-compose.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. ⚙️ Container starten
|
||||||
|
|
||||||
|
Baue das Docker-Image und starte den Container. Ersetze dabei:
|
||||||
|
|
||||||
|
- `tokenKommtHierHer`: den zuvor generierten Matrix Access-Token
|
||||||
|
- `https://matrixdomain.org`: deine Matrix-Instanz
|
||||||
|
- `https://jitsi-admin-url.de`: die Jitsi-Admin-URL
|
||||||
|
|
||||||
|
```bash
|
||||||
|
MATRIX_TOKEN=tokenKommtHierHer \
|
||||||
|
MATRIX_URL=https://matrixdomain.org \
|
||||||
|
JITSI_ADMIN_URL=https://jitsi-admin-url.de \
|
||||||
|
docker-compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. 🔐 Berechtigungen setzen
|
||||||
|
|
||||||
|
Stelle sicher, dass das Docker-Volume korrekt gesetzt ist:
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ⚙️ Konfigurierbare Umgebungsvariablen
|
||||||
|
|
||||||
|
| Variable | Beschreibung | Beispielwert |
|
||||||
|
|----------------------|------------------------------------------------------------------|-----------------------------------|
|
||||||
|
| `MATRIX_URL` | URL der Matrix-Instanz | `https://matrix.org` |
|
||||||
|
| `MATRIX_TOKEN` | Der generierte Access-Token | _deinToken_ |
|
||||||
|
| `MATRIX_PASSWORD` | (Optional) Passwort des Matrix-Accounts | `geheimesPasswort` |
|
||||||
|
| `JITSI_ADMIN_URL` | URL zum Jitsi-Admin-Endpunkt | `https://jitsi-admin.de` |
|
||||||
|
| `MATRIX_DISPLAYNAME` | Anzeigename des Bots in Matrix | `"Raumassistent"` |
|
||||||
|
| `SHOW_WARNING_OF_MIM`| Gibt an, ob Warnungen angezeigt werden sollen (true/false) | `false` |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📌 Hinweise
|
||||||
|
|
||||||
|
- Stelle sicher, dass alle Zugangsdaten und Tokens **sicher gespeichert** und **nicht öffentlich geteilt** werden.
|
||||||
|
- Die in der README genannten URLs und Tokens dienen nur als **Beispiele** - bitte passe sie an deine Umgebung an.
|
||||||
|
- Der Bot bietet eine flexible Möglichkeit, Jitsi-Meetings über Matrix zu automatisieren.
|
|
@ -1,8 +1,6 @@
|
||||||
version: '3.7'
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
matrix-bot:
|
matrix-bot:
|
||||||
image: h2invent/jitsi-admin-matrix-bot:latest
|
image: git.h2-invent.com/meetling/matrix-bot:2.2.7
|
||||||
environment:
|
environment:
|
||||||
MATRIX_URL: ${MATRIX_URL}
|
MATRIX_URL: ${MATRIX_URL}
|
||||||
MATRIX_TOKEN: ${MATRIX_TOKEN}
|
MATRIX_TOKEN: ${MATRIX_TOKEN}
|
||||||
|
|
Loading…
Add table
Reference in a new issue