Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,31 @@ Dev containers have networking limitations depending on the host OS and Docker s
"name": "Matterbridge Plugin Dev Container",
// Use the pre-built image with Node+TypeScript
"image": "mcr.microsoft.com/vscode/devcontainers/typescript-node:latest",
// Inherit timezone from the host environment (set TZ on the host, e.g. Europe/Paris)
"containerEnv": {
"TZ": "${localEnv:TZ}"
},
// Mount the local matterbridge and node_modules workspace folder to the container's workspace volumes to improve performance
"mounts": [
"source=${localWorkspaceFolderBasename}-node_modules,target=${containerWorkspaceFolder}/node_modules,type=volume",
"source=${localWorkspaceFolderBasename}-cache,target=${containerWorkspaceFolder}/.cache,type=volume",
"source=${localWorkspaceFolderBasename}-plugins,target=/home/node/Matterbridge,type=volume",
"source=${localWorkspaceFolderBasename}-storage,target=/home/node/.matterbridge,type=volume",
"source=${localWorkspaceFolderBasename}-cert,target=/home/node/.mattercert,type=volume",
"source=matterbridge,target=/matterbridge,type=volume"
],
// Create the matterbridge Docker network if it doesn't exist (runs on the HOST before the container starts).
"initializeCommand": "docker network inspect matterbridge || docker network create matterbridge",
// On startup, update npm, install and link the dev of matterbridge and install and build the plugin
"postCreateCommand": "bash .devcontainer/postCreateCommand.sh",
"runArgs": [
// Give the Docker container the same name as the repository (must be unique on host)
"--name",
"${localWorkspaceFolderBasename}",
// Remove network host mode if on Docker Desktop for Windows or macOS
"--network=host"
// Use network host mode if on Docker Engine on Linux or WSL 2 to allow full local network access and mDNS support
// "--network=host"
// Use a shared bridge network to allow to access other containers with their names (dns resolution). With the default bridge, dns resolution does not work (only ip:port).
"--network=matterbridge"
],
"customizations": {
"vscode": {
Expand All @@ -58,14 +67,18 @@ Dev containers have networking limitations depending on the host OS and Docker s
// Settings for the VS Code environment
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"terminal.integrated.scrollback": 10000,
"editor.tabSize": 2,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"eslint.format.enable": true,
"eslint.useFlatConfig": true
"eslint.useFlatConfig": true,
"diffEditor.ignoreTrimWhitespace": false,
"git.autofetch": true,
"files.eol": "\n",
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion .devcontainer/install-matterbridge-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ sudo rm -rf matterbridge/* matterbridge/.[!.]* matterbridge/..?*
# Shallow clone for speed (history not needed inside dev container). Remove --depth if full history required.
git clone --depth 1 --single-branch --no-tags -b dev https://github.com/Luligu/matterbridge.git matterbridge
cd matterbridge
SHA7=$(git rev-parse --short=7 HEAD) && BASE_VERSION=$(node -p "require('./package.json').version.split('-')[0]") && npm pkg set version="${BASE_VERSION}-git-${SHA7}"
npm ci --no-fund --no-audit
npm run build
npm install . --global --no-fund --no-audit
rm -rf .git .github .vscode docker systemd docs public screenshot
rm -rf .cache .devcontainer .git .github .vscode docker docs reflector screenshots scripts systemd
echo "Matterbridge has been installed from the dev branch."
3 changes: 2 additions & 1 deletion .devcontainer/install-matterbridge-main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ sudo rm -rf matterbridge/* matterbridge/.[!.]* matterbridge/..?*
# Shallow clone for speed (history not needed inside dev container). Remove --depth if full history required.
git clone --depth 1 --single-branch --no-tags https://github.com/Luligu/matterbridge.git matterbridge
cd matterbridge
SHA7=$(git rev-parse --short=7 HEAD) && BASE_VERSION=$(node -p "require('./package.json').version.split('-')[0]") && npm pkg set version="${BASE_VERSION}-git-${SHA7}"
npm ci --no-fund --no-audit
npm run build
npm install . --global --no-fund --no-audit
rm -rf .git .github .vscode docker systemd docs public screenshot
rm -rf .cache .devcontainer .git .github .vscode docker docs reflector screenshots scripts systemd
echo "Matterbridge has been installed from the main branch."
20 changes: 18 additions & 2 deletions .devcontainer/postCreateCommand.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,28 @@

set -euo pipefail

echo "Welcome to Matterbridge Plugin Dev Container"
DISTRO=$(awk -F= '/^PRETTY_NAME=/{gsub(/"/, "", $2); print $2}' /etc/os-release)
CODENAME=$(awk -F= '/^VERSION_CODENAME=/{print $2}' /etc/os-release)
echo "Distro: $DISTRO ($CODENAME)"
echo "User: $(whoami)"
echo "Hostname: $(hostname)"
echo "Architecture: $(uname -m)"
echo "Kernel Version: $(uname -r)"
echo "Uptime: $(uptime -p || echo 'unavailable')"
echo "Date: $(date)"
echo "Node.js version: $(node -v)"
echo "Npm version: $(npm -v)"
echo ""

echo "1 - Installing updates and scripts..."
sudo npm install -g npm npm-check-updates shx cross-env
npm install --global --no-fund --no-audit npm npm-check-updates shx cross-env

echo "2 - Building Matterbridge..."
sudo chmod +x .devcontainer/install-matterbridge-*.sh
# Use this for the main branch: .devcontainer/install-matterbridge-main.sh
# Use this for the main branch:
# .devcontainer/install-matterbridge-main.sh
# Use this for the dev branch:
.devcontainer/install-matterbridge-dev.sh

echo "3 - Creating directories..."
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
pull_request:
paths-ignore:
- '**/*.md' # any .md anywhere
workflow_dispatch:

jobs:
build:
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Set up Node
- name: Setup Node.js 24.x
uses: actions/setup-node@v4
with:
node-version: '22.x'
registry-url: 'https://registry.npmjs.org'
node-version: '24.x'
cache: npm

- name: Clone matterbridge repo
run: git clone --depth 1 --single-branch --no-tags https://github.com/Luligu/matterbridge.git ../matterbridge
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ on:
push:
branches: [main]
paths-ignore:
- 'screenshots/**' # any file under screenshots/
- 'scripts/**' # any file under scripts/
- '**/*.md' # any .md anywhere
pull_request:
branches: [main]
paths-ignore:
- 'screenshots/**' # any file under screenshots/
- 'scripts/**' # any file under scripts/
- '**/*.md' # any .md anywhere
workflow_dispatch:

Expand All @@ -25,4 +29,10 @@ jobs:
- uses: github/codeql-action/init@v4
with:
languages: javascript
config: |
paths-ignore:
- 'scripts/**'
- '**/*.spec.ts'
- '**/*.test.ts'
- '**/__test__/*.ts'
- uses: github/codeql-action/analyze@v4
124 changes: 0 additions & 124 deletions .github/workflows/publish-daily-dev-from-dev.yml

This file was deleted.

Loading