Compare commits
65 Commits
Author | SHA1 | Date |
---|---|---|
Mirco | c5b802543e | 3 weeks ago |
Mirco | d8f13cc9cc | 3 weeks ago |
Mirco | c4ec458c6b | 3 weeks ago |
bom | a9760ccf04 | 4 months ago |
bom | 30c0ad8ee4 | 4 months ago |
bom | ddc4bd3b22 | 4 months ago |
Mirco | d4efc9f593 | 5 months ago |
Mirco | 768df30e5d | 5 months ago |
Mirco | f96d8edc30 | 5 months ago |
Mirco | 8af9b747fd | 5 months ago |
Mirco | 7a079de3a6 | 5 months ago |
Mirco | 25a63ce0a9 | 6 months ago |
Mirco | a1896602af | 6 months ago |
Mirco | 83f0b63685 | 6 months ago |
Mirco | 6a5586d2a8 | 6 months ago |
Mirco | 7023c9d958 | 6 months ago |
Mirco | 7a4cd805ca | 6 months ago |
Mirco | f42b9d5470 | 6 months ago |
Mirco | ef0d217cee | 6 months ago |
Mirco | 86756597de | 6 months ago |
Mirco | de98e87655 | 6 months ago |
Mirco | 4272e5f598 | 6 months ago |
Clemens | 89de4ed0a5 | 7 months ago |
Clemens | ee4ae4035d | 7 months ago |
Michael Jerger | d3f5d10b3f | 7 months ago |
bom | 61d05ceedb | 7 months ago |
erik | fd2c24851b | 7 months ago |
Mirco | 79b77da808 | 7 months ago |
Mirco | 388c4363af | 7 months ago |
Mirco | 50a14f0d15 | 8 months ago |
erik | eec7bfa37c | 8 months ago |
bom | 4f6f431bc4 | 8 months ago |
bom | 13f0ce6f7f | 8 months ago |
bom | b9f73c0409 | 8 months ago |
bom | 7e472b7f74 | 8 months ago |
bom | 940bbf7c23 | 8 months ago |
Clemens | c6ac4e0bbe | 8 months ago |
Clemens | 04cfc0c6b1 | 8 months ago |
Clemens | 62214799e0 | 8 months ago |
Clemens | bf4978bded | 8 months ago |
Clemens | 5ae8a5a2f5 | 8 months ago |
gec | d7e433f3c2 | 8 months ago |
Clemens | 9e4c7c016a | 8 months ago |
Clemens | d8c3e9a3ad | 8 months ago |
Clemens | 9945f689c4 | 8 months ago |
Clemens | 03b1b49342 | 8 months ago |
Michael Jerger | 097e0b4548 | 8 months ago |
Michael Jerger | 576fdd9af7 | 8 months ago |
Michael Jerger | cd867061de | 8 months ago |
Michael Jerger | 9d280d207c | 8 months ago |
Mirco | 24896a11f7 | 8 months ago |
Mirco | 7115a80b8e | 8 months ago |
Clemens | 807c15cf92 | 8 months ago |
bom | 934eda5b35 | 8 months ago |
bom | b988501af7 | 8 months ago |
bom | ac866a2bcc | 8 months ago |
Clemens | 9ac0665ab4 | 8 months ago |
Clemens | eb27006cf2 | 8 months ago |
Clemens | cc0497d72d | 8 months ago |
Clemens | 7e6de55b36 | 8 months ago |
Clemens | 38dfbdd1a0 | 8 months ago |
Clemens | 84dcc33122 | 8 months ago |
Michael Jerger | 0b07a6bc85 | 8 months ago |
Clemens | 2bbfd0f0a6 | 8 months ago |
erik | 5d6524b9e3 | 10 months ago |
@ -1,41 +0,0 @@
|
||||
# Release process
|
||||
|
||||
## ... for testing (snapshots)
|
||||
|
||||
Make sure your clojars.org credentials are correctly set in your ~/.lein/profiles.clj file.
|
||||
|
||||
``` bash
|
||||
git add .
|
||||
git commit
|
||||
```
|
||||
|
||||
``` bash
|
||||
lein deploy # or lein deploy clojars
|
||||
```
|
||||
|
||||
## ... for stable release
|
||||
|
||||
Make sure tags are protected in gitlab:
|
||||
Repository Settings -> Protected Tags -> set \*.\*.\* as tag and save.
|
||||
|
||||
``` bash
|
||||
git checkout main # for old projects replace main with master
|
||||
git add .
|
||||
git commit
|
||||
```
|
||||
|
||||
Execute tests
|
||||
|
||||
``` bash
|
||||
shadow-cljs compile test
|
||||
node target/node-tests.js
|
||||
lein test
|
||||
```
|
||||
|
||||
Release with type (NONE, PATCH, MINOR, MAJOR):
|
||||
``` bash
|
||||
RELEASE_TYPE=[TYPE] pyb prepare_release after_publish
|
||||
|
||||
```
|
||||
|
||||
Done.
|
@ -1,7 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -Eeo pipefail
|
||||
|
||||
apt update > /dev/null
|
||||
|
||||
install -m 0700 /tmp/install-debug.sh /usr/local/bin/
|
||||
install -m 0644 /tmp/settings-config.js /defaults/settings-config.js
|
@ -0,0 +1,57 @@
|
||||
from os import environ
|
||||
from datetime import datetime
|
||||
from pybuilder.core import task, init
|
||||
from ddadevops import *
|
||||
|
||||
name = "c4k-jitsi"
|
||||
MODULE = "excalidraw-backend"
|
||||
PROJECT_ROOT_PATH = "../.."
|
||||
version = "2.1.1-dev"
|
||||
|
||||
|
||||
@init
|
||||
def initialize(project):
|
||||
image_tag = version
|
||||
if "dev" in image_tag:
|
||||
image_tag += datetime.now().strftime("%Y-%m-%d-%H-%M-%S")
|
||||
|
||||
input = {
|
||||
"name": name,
|
||||
"module": MODULE,
|
||||
"stage": "notused",
|
||||
"project_root_path": PROJECT_ROOT_PATH,
|
||||
"build_types": ["IMAGE"],
|
||||
"mixin_types": [],
|
||||
"image_naming": "NAME_AND_MODULE",
|
||||
"image_tag": f"{image_tag}",
|
||||
}
|
||||
|
||||
project.build_depends_on("ddadevops>=4.7.0")
|
||||
|
||||
build = DevopsImageBuild(project, input)
|
||||
build.initialize_build_dir()
|
||||
|
||||
|
||||
@task
|
||||
def image(project):
|
||||
build = get_devops_build(project)
|
||||
build.image()
|
||||
|
||||
|
||||
@task
|
||||
def drun(project):
|
||||
build = get_devops_build(project)
|
||||
build.drun()
|
||||
|
||||
|
||||
@task
|
||||
def test(project):
|
||||
build = get_devops_build(project)
|
||||
build.test()
|
||||
|
||||
|
||||
@task
|
||||
def publish(project):
|
||||
build = get_devops_build(project)
|
||||
build.dockerhub_login()
|
||||
build.dockerhub_publish()
|
@ -0,0 +1,13 @@
|
||||
# Taken from: https://github.com/jitsi/excalidraw-backend
|
||||
FROM node:22-bookworm-slim
|
||||
|
||||
WORKDIR /excalidraw-backend
|
||||
|
||||
COPY resources/package.json resources/package-lock.json resources/tsconfig.json resources/install.sh resources/src resources/install_functions_debian.sh ./
|
||||
|
||||
RUN ./install.sh
|
||||
|
||||
EXPOSE 80
|
||||
EXPOSE 9090
|
||||
|
||||
CMD ["npm", "start"]
|
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
set -exo pipefail
|
||||
|
||||
function main() {
|
||||
{
|
||||
upgradeSystem
|
||||
} > /dev/null
|
||||
|
||||
cleanupDocker
|
||||
}
|
||||
|
||||
source ./install_functions_debian.sh
|
||||
DEBIAN_FRONTEND=noninteractive DEBCONF_NOWARNINGS=yes main
|
||||
|
||||
npm audit fix
|
||||
npm ci --omit=dev
|
||||
npm run build
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,51 @@
|
||||
{
|
||||
"name": "excalidraw-backend",
|
||||
"version": "1.1.0",
|
||||
"main": "src/index.js",
|
||||
"description": "Excalidraw backend",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jitsi/excalidraw-backend"
|
||||
},
|
||||
"private": true,
|
||||
"engines": {
|
||||
"node": ">=18.0.0",
|
||||
"npm": ">=10.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/debug": "4.1.10",
|
||||
"@types/express": "4.17.20",
|
||||
"@types/ms": "0.7.33",
|
||||
"@types/node": "20.8.7",
|
||||
"cross-env": "^7.0.3",
|
||||
"debug": "4.3.4",
|
||||
"dotenv": "^16.0.0",
|
||||
"express": "^4.19.2",
|
||||
"socket.io": "^4.7.2",
|
||||
"prom-client": "^15.0.0",
|
||||
"ts-node-dev": "^2.0.0",
|
||||
"typescript": "5.2.2"
|
||||
},
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"lint": "eslint .",
|
||||
"lint-fix": "eslint . --fix",
|
||||
"start": "tsc && node dist/index.js",
|
||||
"start:local": "tsc && DEBUG='engine,app,socket.io:client,server' node dist/index.js",
|
||||
"start:dev": "cross-env NODE_ENV=development ts-node-dev --respawn --transpile-only src/index.ts"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jitsi/eslint-config": "^4.1.0",
|
||||
"@typescript-eslint/eslint-plugin": "6.8.0",
|
||||
"@typescript-eslint/parser": "6.8.0",
|
||||
"eslint": "^8.1.0",
|
||||
"eslint-plugin-import": "2.28.1",
|
||||
"eslint-plugin-jsdoc": "46.8.2",
|
||||
"eslint-plugin-typescript-sort-keys": "^3.1.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"bufferutil": "^4.0.6",
|
||||
"utf-8-validate": "^6.0.3"
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
module.exports = {
|
||||
extends: [
|
||||
'@jitsi/eslint-config',
|
||||
'@jitsi/eslint-config/jsdoc',
|
||||
'@jitsi/eslint-config/typescript',
|
||||
],
|
||||
};
|
@ -0,0 +1,122 @@
|
||||
// Taken from: https://github.com/jitsi/excalidraw-backend
|
||||
|
||||
import debug from 'debug';
|
||||
import dotenv from 'dotenv';
|
||||
import express from 'express';
|
||||
import { createServer } from 'node:http';
|
||||
import { Server } from 'socket.io';
|
||||
/*
|
||||
import * as prometheus from 'socket.io-prometheus-metrics';
|
||||
|
||||
do not use anymore, since 3 years no further progression, depends on debug 4.1.1,
|
||||
wich is moderate vulnerable to regular expression denial of service when untrusted user
|
||||
input is passed into the o formatter.
|
||||
|
||||
alternatively could be used prom-client
|
||||
*/
|
||||
|
||||
const serverDebug = debug('httpServer');
|
||||
const app = express();
|
||||
const port = process.env.PORT || 80; // default port to listen
|
||||
const httpServer = createServer(app);
|
||||
|
||||
dotenv.config(
|
||||
process.env.NODE_ENV === 'development'
|
||||
? { path: '.env.development' }
|
||||
: { path: '.env.production' }
|
||||
);
|
||||
|
||||
app.get('/', (req, res) => {
|
||||
res.send('Excalidraw backend is up :)');
|
||||
});
|
||||
|
||||
httpServer.listen(port, () => {
|
||||
serverDebug(`listening on port: ${port}`);
|
||||
});
|
||||
|
||||
const corsOptions = {
|
||||
origin: ['jitsi.test.meissa.de', 'jitsi.prod.meissa.de'],
|
||||
methods: ["GET", "POST"],
|
||||
credentials: true
|
||||
};
|
||||
|
||||
const io = new Server(httpServer, {
|
||||
allowEIO3: true,
|
||||
cors: corsOptions,
|
||||
maxHttpBufferSize: 1e6,
|
||||
pingTimeout: 10000
|
||||
});
|
||||
|
||||
// listens on host:9090/metrics
|
||||
/* do not use
|
||||
prometheus.metrics(io, {
|
||||
collectDefaultMetrics: true
|
||||
});
|
||||
*/
|
||||
|
||||
/* alternatively could be used:
|
||||
|
||||
const client = require('prom-client');
|
||||
const collectDefaultMetrics = client.collectDefaultMetrics;
|
||||
const Registry = client.Registry;
|
||||
const register = new Registry();
|
||||
collectDefaultMetrics({ register });
|
||||
|
||||
or more:
|
||||
https://codersociety.com/blog/articles/nodejs-application-monitoring-with-prometheus-and-grafana
|
||||
*/
|
||||
|
||||
io.on('connection', (socket) => {
|
||||
serverDebug(`connection established! ${socket.conn.request.url}`);
|
||||
io.to(`${socket.id}`).emit('init-room');
|
||||
socket.on('join-room', roomID => {
|
||||
serverDebug(`${socket.id} has joined ${roomID} for url ${socket.conn.request.url}`);
|
||||
socket.join(roomID);
|
||||
if (io.sockets.adapter.rooms.get(roomID)?.size ?? 0 <= 1) {
|
||||
io.to(`${socket.id}`).emit('first-in-room');
|
||||
} else {
|
||||
socket.broadcast.to(roomID).emit('new-user', socket.id);
|
||||
}
|
||||
io.in(roomID).emit(
|
||||
'room-user-change', Array.from(io.sockets.adapter.rooms.get(roomID) ?? [])
|
||||
);
|
||||
});
|
||||
|
||||
socket.on(
|
||||
'server-broadcast',
|
||||
(roomID: string, encryptedData: ArrayBuffer, iv: Uint8Array) => {
|
||||
socket.broadcast.to(roomID).emit('client-broadcast', encryptedData, iv);
|
||||
});
|
||||
|
||||
socket.on(
|
||||
'server-volatile-broadcast',
|
||||
(roomID: string, encryptedData: ArrayBuffer, iv: Uint8Array) => {
|
||||
socket.volatile.broadcast
|
||||
.to(roomID)
|
||||
.emit('client-broadcast', encryptedData, iv);
|
||||
});
|
||||
|
||||
socket.on('disconnecting', () => {
|
||||
const rooms = io.sockets.adapter.rooms;
|
||||
|
||||
for (const roomID of Object.keys(socket.rooms)) {
|
||||
const clients = Array.from(rooms.get(roomID) ?? []).filter(id => id !== socket.id);
|
||||
|
||||
if (roomID !== socket.id) {
|
||||
socket.to(roomID).emit('user has left', socket.id);
|
||||
}
|
||||
|
||||
if (clients.length > 0) {
|
||||
socket.broadcast.to(roomID).emit('room-user-change', clients);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
socket.on('disconnect', (reason, details) => {
|
||||
serverDebug(
|
||||
`${socket.id} was disconnected from url ${socket.conn.request.url} for the following reason: ${reason}
|
||||
${JSON.stringify(details)}`
|
||||
);
|
||||
socket.removeAllListeners();
|
||||
});
|
||||
});
|
@ -0,0 +1,17 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"target": "es5",
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"esModuleInterop": true,
|
||||
"strict": true,
|
||||
"moduleResolution": "Node",
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"outDir": "dist",
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM jitsi/web:stable-8922-1
|
||||
FROM jitsi/web:stable-9457-2
|
||||
|
||||
# Prepare Configuration
|
||||
ADD resources /tmp
|
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -exo pipefail
|
||||
|
||||
function main() {
|
||||
{
|
||||
upgradeSystem
|
||||
} > /dev/null
|
||||
|
||||
install -m 0700 /tmp/install-debug.sh /usr/local/bin/
|
||||
install -m 0644 /tmp/settings-config.js /defaults/settings-config.js
|
||||
|
||||
cleanupDocker
|
||||
}
|
||||
|
||||
source /tmp/install_functions_debian.sh
|
||||
DEBIAN_FRONTEND=noninteractive DEBCONF_NOWARNINGS=yes main
|
@ -0,0 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
service: excalidraw-backend
|
||||
name: excalidraw-backend
|
||||
spec:
|
||||
ports:
|
||||
- name: excalidraw-backend
|
||||
port: 3002
|
||||
targetPort: 80
|
||||
selector:
|
||||
app: excalidraw-backend
|
@ -0,0 +1,20 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
app: excalidraw-backend
|
||||
name: excalidraw-backend
|
||||
spec:
|
||||
strategy:
|
||||
type: Recreate
|
||||
selector:
|
||||
matchLabels:
|
||||
app: excalidraw-backend
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: excalidraw-backend
|
||||
spec:
|
||||
containers:
|
||||
- name: excalidraw-backend
|
||||
image: domaindrivenarchitecture/c4k-jitsi-excalidraw-backend
|
Loading…
Reference in New Issue