mb-run 1.0.1-dev-20260830-e734420 → 1.0.1-dev-20260907-e8d2ac5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/upgrade.js +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/vendor/.devcontainer/README.md +20 -0
- package/vendor/.devcontainer/bun/devcontainer.json +17 -4
- package/vendor/.devcontainer/bun/post-create.sh +20 -9
- package/vendor/.devcontainer/bun/post-start.sh +4 -7
- package/vendor/.devcontainer/node/devcontainer.json +17 -4
- package/vendor/.devcontainer/node/post-create.sh +20 -9
- package/vendor/.devcontainer/node/post-start.sh +4 -7
- package/vendor/.devcontainer-plugin/README.md +21 -0
- package/vendor/.devcontainer-plugin/bun/devcontainer.json +17 -4
- package/vendor/.devcontainer-plugin/bun/install-matterbridge.sh +12 -10
- package/vendor/.devcontainer-plugin/bun/post-create.sh +27 -21
- package/vendor/.devcontainer-plugin/bun/post-start.sh +7 -7
- package/vendor/.devcontainer-plugin/node/devcontainer.json +17 -4
- package/vendor/.devcontainer-plugin/node/install-matterbridge.sh +12 -10
- package/vendor/.devcontainer-plugin/node/post-create.sh +29 -23
- package/vendor/.devcontainer-plugin/node/post-start.sh +9 -9
- package/vendor/.github/workflows/codecov.yml +2 -2
- package/vendor/.github/workflows/codeql.yml +2 -2
- package/vendor/.github-plugin/workflows/codecov.yml +2 -2
- package/vendor/.github-plugin/workflows/codeql.yml +2 -2
- package/vendor/.devcontainer/bun/initialize.sh +0 -21
- package/vendor/.devcontainer/node/initialize.sh +0 -21
- package/vendor/.devcontainer-plugin/bun/initialize.sh +0 -21
- package/vendor/.devcontainer-plugin/node/initialize.sh +0 -21
package/dist/upgrade.js
CHANGED
|
@@ -475,7 +475,7 @@ export async function runPackageJsonUpgrade(opts, pkgPath, pkgJson, isMonorepo =
|
|
|
475
475
|
'version:patch': automator?.version === true ? 'npm version patch --no-git-tag-version' : undefined,
|
|
476
476
|
'version:minor': automator?.version === true ? 'npm version minor --no-git-tag-version' : undefined,
|
|
477
477
|
'version:major': automator?.version === true ? 'npm version major --no-git-tag-version' : undefined,
|
|
478
|
-
'git:status': automator?.git === true ? 'git status && git branch -vv && git stash list && git fsck --full --no-reflogs' : undefined,
|
|
478
|
+
'git:status': automator?.git === true ? 'git status && git branch -vv && git stash list && git fsck --full --no-reflogs --no-dangling && git worktree list' : undefined,
|
|
479
479
|
'git:remote': automator?.git === true ? 'git remote -v && git remote show origin' : undefined,
|
|
480
480
|
'git:prune': automator?.git === true ? 'git fetch --prune --prune-tags' : undefined,
|
|
481
481
|
'git:hardreset:main': automator?.git === true ? 'git fetch origin && git checkout main && git reset --hard origin/main' : undefined,
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mb-run",
|
|
3
|
-
"version": "1.0.1-dev-
|
|
3
|
+
"version": "1.0.1-dev-20260907-e8d2ac5",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "mb-run",
|
|
9
|
-
"version": "1.0.1-dev-
|
|
9
|
+
"version": "1.0.1-dev-20260907-e8d2ac5",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"cross-spawn": "7.0.6",
|
package/package.json
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Dev Containers v.2.1.0
|
|
2
|
+
|
|
3
|
+
Node and Bun configurations for ordinary repositories, including libraries and utilities, aligned with Matterbridge’s Docker VMM setup. Open **Dev Containers: Reopen in Container** and select a runtime.
|
|
4
|
+
|
|
5
|
+
## Startup and storage
|
|
6
|
+
|
|
7
|
+
- The host bootstrap uses only Docker: network inspection/creation and an unconditional image pull run in parallel. No host Bash, Node or Bun installation is needed. All shell scripts run inside the container.
|
|
8
|
+
- Repository source remains bind-mounted. Runtime-specific named volumes hold node_modules; a shared repository volume holds .cache.
|
|
9
|
+
- Both runtimes share the vscode-extensions volume, plus package caches, Bash history and agent state. The images seed home volume ownership with UID/GID 1000; workspace volume ownership is checked during creation.
|
|
10
|
+
- Creation prepares workspace dependency/cache directories and shared home directories, repairing ownership only when the owner differs.
|
|
11
|
+
- Creation also installs dependencies, builds the project and checks for outdated packages. Each start installs dependencies and builds the project again, preserving the existing lifecycle. Ownership repair runs during creation and only for paths with a different owner.
|
|
12
|
+
- Ordinary repositories do not install/link Matterbridge, require a frontend, or publish its UI port.
|
|
13
|
+
|
|
14
|
+
## Docker VMM host setup
|
|
15
|
+
|
|
16
|
+
Use Virtual file shares (VirtioFS) for the repository parent directory. Avoid Synchronized file shares: the Matterbridge 2.1.0 reference documents Git memory-mapping failures with those shares.
|
|
17
|
+
|
|
18
|
+
On Windows with Docker VMM, set "dev.containers.forwardWSLServices": false in VS Code **user** settings to avoid unnecessary WSL probes. This application-level setting cannot be supplied by the container configuration.
|
|
19
|
+
|
|
20
|
+
After updating these files or the shared image, run **Dev Containers: Rebuild Container**. Pulling an image does not replace an existing container. Stop the previous runtime before switching: both variants share writable volumes.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// .devcontainer/bun/devcontainer.json v.2.
|
|
1
|
+
// .devcontainer/bun/devcontainer.json v.2.1.0
|
|
2
2
|
|
|
3
3
|
// This file defines the bun development container configuration for a Matterbridge project.
|
|
4
4
|
|
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
// Package specific volumes for bun node_modules, .cache to improve performance
|
|
21
21
|
"source=${localWorkspaceFolderBasename}-bun-node_modules,target=${containerWorkspaceFolder}/node_modules,type=volume",
|
|
22
22
|
"source=${localWorkspaceFolderBasename}-cache,target=${containerWorkspaceFolder}/.cache,type=volume",
|
|
23
|
+
// Shared by Node and Bun: both images seed extensions with UID/GID 1000.
|
|
24
|
+
"source=vscode-extensions,target=/home/bun/.vscode-server/extensions,type=volume",
|
|
23
25
|
// Dev container shared volumes for matterbridge, npm cache, bun cache, bash history, claude, codex and agents to improve performance
|
|
24
26
|
"source=npm-cache,target=/home/bun/.npm,type=volume",
|
|
25
27
|
"source=bun-cache,target=/home/bun/.bun/install/cache,type=volume",
|
|
@@ -28,9 +30,20 @@
|
|
|
28
30
|
"source=codex,target=/home/bun/.codex,type=volume",
|
|
29
31
|
"source=agents,target=/home/bun/.agents,type=volume"
|
|
30
32
|
],
|
|
31
|
-
// Set up the Docker environment (runs on the host before the container starts)
|
|
32
|
-
|
|
33
|
-
//
|
|
33
|
+
// Set up the Docker environment (runs on the host before the container starts).
|
|
34
|
+
// Object form: entries run in parallel, each through the host shell (cmd.exe on Windows, /bin/sh elsewhere).
|
|
35
|
+
// Deliberately uses only docker, so the host needs no node, bun or bash: the container is the only toolchain.
|
|
36
|
+
// "||" is one of the few constructs both cmd.exe and /bin/sh share; docker network create is not idempotent,
|
|
37
|
+
// hence the inspect first. On a host that has never created the network, the inspect logs a harmless
|
|
38
|
+
// "network matterbridge not found" to stderr before it is created (there is no portable null device).
|
|
39
|
+
// The pull is unconditional: it costs ~0.9s, runs in parallel with the network check, and guarantees the
|
|
40
|
+
// image itself is never silently stale. Note that pulling refreshes the image, not an existing container:
|
|
41
|
+
// a container keeps the image it was created from until you run "Dev Containers: Rebuild Container".
|
|
42
|
+
"initializeCommand": {
|
|
43
|
+
"network": "docker network inspect matterbridge --format ok || docker network create --ipv6 matterbridge",
|
|
44
|
+
"pull": "docker pull luligu/matterbridge:bun-dev-container"
|
|
45
|
+
},
|
|
46
|
+
// On create, prepare directories, install dependencies, build the project and check outdated packages
|
|
34
47
|
"postCreateCommand": "bash .devcontainer/bun/post-create.sh",
|
|
35
48
|
// On start, install and build the project (runs inside the container)
|
|
36
49
|
"postStartCommand": "bash .devcontainer/bun/post-start.sh",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
|
-
# .devcontainer/bun/post-create.sh v.2.
|
|
3
|
+
# .devcontainer/bun/post-create.sh v.2.1.0
|
|
4
4
|
|
|
5
5
|
# This script runs after the Dev Container is created to set up the dev container environment.
|
|
6
6
|
|
|
@@ -20,21 +20,32 @@ echo "Bun version: $(bun -v)"
|
|
|
20
20
|
echo "Bun global cache: ${HOME}/.bun/install/cache"
|
|
21
21
|
echo ""
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
# Ensure required directories exist and are owned by the current user
|
|
24
|
+
workspace_paths=("$PWD/node_modules" "$PWD/.cache")
|
|
25
|
+
home_paths=("$HOME/.claude" "$HOME/.codex" "$HOME/.agents" "$HOME/.bash-cache" "$HOME/.npm" "$HOME/.bun" "$HOME/.bun/install/cache" "$HOME/.vscode-server/extensions")
|
|
25
26
|
|
|
26
|
-
echo "
|
|
27
|
-
sudo
|
|
27
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "1.post-create - Creating directories..."
|
|
28
|
+
sudo mkdir -p "${workspace_paths[@]}" "${home_paths[@]}" # Create directories if they don't exist
|
|
28
29
|
|
|
29
|
-
echo "
|
|
30
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "2.post-create - Setting permissions..."
|
|
31
|
+
# Only chown paths that are not already owned by the current user. The image pre-creates the
|
|
32
|
+
# home paths, so fresh volumes are seeded correctly and this is a no-op; the workspace volumes
|
|
33
|
+
# still need it on first create, but they are empty then, so the recursion is instant.
|
|
34
|
+
for path in . "${workspace_paths[@]}" "${home_paths[@]}"; do
|
|
35
|
+
if [ "$(stat -c %u "$path")" != "$(id -u)" ]; then
|
|
36
|
+
sudo chown -R "$(id -u):$(id -g)" "$path" # Transfer ownership to the current user
|
|
37
|
+
fi
|
|
38
|
+
done
|
|
39
|
+
|
|
40
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "3.post-create - Installing the project dependencies..."
|
|
30
41
|
[ -f package-lock.json ] && mv package-lock.json package-lock.json.bak || true
|
|
31
42
|
bun install
|
|
32
43
|
[ -f package-lock.json.bak ] && mv package-lock.json.bak package-lock.json || true
|
|
33
44
|
|
|
34
|
-
echo "4.post-create - Building the project..."
|
|
45
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "4.post-create - Building the project..."
|
|
35
46
|
bun run build
|
|
36
47
|
|
|
37
|
-
echo "5.post-create - Checking for outdated packages..."
|
|
48
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "5.post-create - Checking for outdated packages..."
|
|
38
49
|
bun outdated || true
|
|
39
50
|
|
|
40
|
-
echo "6.post-create - Post create setup completed!"
|
|
51
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "6.post-create - Post create setup completed!"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
|
-
# .devcontainer/bun/post-start.sh v.2.
|
|
3
|
+
# .devcontainer/bun/post-start.sh v.2.1.0
|
|
4
4
|
|
|
5
5
|
# This script runs after the Dev Container is started to set up the dev container environment.
|
|
6
6
|
|
|
@@ -20,15 +20,12 @@ echo "Bun version: $(bun -v)"
|
|
|
20
20
|
echo "Bun global cache: ${HOME}/.bun/install/cache"
|
|
21
21
|
echo ""
|
|
22
22
|
|
|
23
|
-
echo "1.post-start - Installing the project dependencies..."
|
|
23
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "1.post-start - Installing the project dependencies..."
|
|
24
24
|
[ -f package-lock.json ] && mv package-lock.json package-lock.json.bak || true
|
|
25
25
|
bun install
|
|
26
26
|
[ -f package-lock.json.bak ] && mv package-lock.json.bak package-lock.json || true
|
|
27
27
|
|
|
28
|
-
echo "2.post-start -
|
|
29
|
-
sudo chown -R bun:bun ./node_modules
|
|
30
|
-
|
|
31
|
-
echo "3.post-start - Building the project..."
|
|
28
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "2.post-start - Building the project..."
|
|
32
29
|
bun run build
|
|
33
30
|
|
|
34
|
-
echo "
|
|
31
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "3.post-start - Post start setup completed!"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// .devcontainer/node/devcontainer.json v.2.
|
|
1
|
+
// .devcontainer/node/devcontainer.json v.2.1.0
|
|
2
2
|
|
|
3
3
|
// This file defines the node development container configuration for a Matterbridge project.
|
|
4
4
|
|
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
// Package specific volumes for node node_modules, .cache to improve performance
|
|
21
21
|
"source=${localWorkspaceFolderBasename}-node-node_modules,target=${containerWorkspaceFolder}/node_modules,type=volume",
|
|
22
22
|
"source=${localWorkspaceFolderBasename}-cache,target=${containerWorkspaceFolder}/.cache,type=volume",
|
|
23
|
+
// Shared by Node and Bun: both images seed extensions with UID/GID 1000.
|
|
24
|
+
"source=vscode-extensions,target=/home/node/.vscode-server/extensions,type=volume",
|
|
23
25
|
// Dev container shared volumes for matterbridge, npm cache, bun cache, bash history, claude, codex and agents to improve performance
|
|
24
26
|
"source=npm-cache,target=/home/node/.npm,type=volume",
|
|
25
27
|
"source=bun-cache,target=/home/node/.bun/install/cache,type=volume",
|
|
@@ -28,9 +30,20 @@
|
|
|
28
30
|
"source=codex,target=/home/node/.codex,type=volume",
|
|
29
31
|
"source=agents,target=/home/node/.agents,type=volume"
|
|
30
32
|
],
|
|
31
|
-
// Set up the Docker environment (runs on the host before the container starts)
|
|
32
|
-
|
|
33
|
-
//
|
|
33
|
+
// Set up the Docker environment (runs on the host before the container starts).
|
|
34
|
+
// Object form: entries run in parallel, each through the host shell (cmd.exe on Windows, /bin/sh elsewhere).
|
|
35
|
+
// Deliberately uses only docker, so the host needs no node, bun or bash: the container is the only toolchain.
|
|
36
|
+
// "||" is one of the few constructs both cmd.exe and /bin/sh share; docker network create is not idempotent,
|
|
37
|
+
// hence the inspect first. On a host that has never created the network, the inspect logs a harmless
|
|
38
|
+
// "network matterbridge not found" to stderr before it is created (there is no portable null device).
|
|
39
|
+
// The pull is unconditional: it costs ~0.9s, runs in parallel with the network check, and guarantees the
|
|
40
|
+
// image itself is never silently stale. Note that pulling refreshes the image, not an existing container:
|
|
41
|
+
// a container keeps the image it was created from until you run "Dev Containers: Rebuild Container".
|
|
42
|
+
"initializeCommand": {
|
|
43
|
+
"network": "docker network inspect matterbridge --format ok || docker network create --ipv6 matterbridge",
|
|
44
|
+
"pull": "docker pull luligu/matterbridge:node-dev-container"
|
|
45
|
+
},
|
|
46
|
+
// On create, prepare directories, install dependencies, build the project and check outdated packages
|
|
34
47
|
"postCreateCommand": "bash .devcontainer/node/post-create.sh",
|
|
35
48
|
// On start, install and build the project (runs inside the container)
|
|
36
49
|
"postStartCommand": "bash .devcontainer/node/post-start.sh",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
|
-
# .devcontainer/node/post-create.sh v.2.
|
|
3
|
+
# .devcontainer/node/post-create.sh v.2.1.0
|
|
4
4
|
|
|
5
5
|
# This script runs after the Dev Container is created to set up the dev container environment.
|
|
6
6
|
|
|
@@ -21,19 +21,30 @@ echo "Npm version: $(npm -v)"
|
|
|
21
21
|
echo "Npm cache: $(npm config get cache)"
|
|
22
22
|
echo ""
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
# Ensure required directories exist and are owned by the current user
|
|
25
|
+
workspace_paths=("$PWD/node_modules" "$PWD/.cache")
|
|
26
|
+
home_paths=("$HOME/.claude" "$HOME/.codex" "$HOME/.agents" "$HOME/.bash-cache" "$HOME/.npm" "$HOME/.bun" "$HOME/.bun/install/cache" "$HOME/.vscode-server/extensions")
|
|
26
27
|
|
|
27
|
-
echo "
|
|
28
|
-
sudo
|
|
28
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "1.post-create - Creating directories..."
|
|
29
|
+
sudo mkdir -p "${workspace_paths[@]}" "${home_paths[@]}" # Create directories if they don't exist
|
|
29
30
|
|
|
30
|
-
echo "
|
|
31
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "2.post-create - Setting permissions..."
|
|
32
|
+
# Only chown paths that are not already owned by the current user. The image pre-creates the
|
|
33
|
+
# home paths, so fresh volumes are seeded correctly and this is a no-op; the workspace volumes
|
|
34
|
+
# still need it on first create, but they are empty then, so the recursion is instant.
|
|
35
|
+
for path in . "${workspace_paths[@]}" "${home_paths[@]}"; do
|
|
36
|
+
if [ "$(stat -c %u "$path")" != "$(id -u)" ]; then
|
|
37
|
+
sudo chown -R "$(id -u):$(id -g)" "$path" # Transfer ownership to the current user
|
|
38
|
+
fi
|
|
39
|
+
done
|
|
40
|
+
|
|
41
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "3.post-create - Installing the project dependencies..."
|
|
31
42
|
npm install --no-fund --no-audit
|
|
32
43
|
|
|
33
|
-
echo "4.post-create - Building the project..."
|
|
44
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "4.post-create - Building the project..."
|
|
34
45
|
npm run build
|
|
35
46
|
|
|
36
|
-
echo "5.post-create - Checking for outdated packages..."
|
|
47
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "5.post-create - Checking for outdated packages..."
|
|
37
48
|
npm outdated || true
|
|
38
49
|
|
|
39
|
-
echo "6.post-create - Post create setup completed!"
|
|
50
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "6.post-create - Post create setup completed!"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
|
-
# .devcontainer/node/post-start.sh v.2.
|
|
3
|
+
# .devcontainer/node/post-start.sh v.2.1.0
|
|
4
4
|
|
|
5
5
|
# This script runs after the Dev Container is started to set up the dev container environment.
|
|
6
6
|
|
|
@@ -21,13 +21,10 @@ echo "Npm version: $(npm -v)"
|
|
|
21
21
|
echo "Npm cache: $(npm config get cache)"
|
|
22
22
|
echo ""
|
|
23
23
|
|
|
24
|
-
echo "1.post-start - Installing the project dependencies..."
|
|
24
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "1.post-start - Installing the project dependencies..."
|
|
25
25
|
npm install --no-fund --no-audit
|
|
26
26
|
|
|
27
|
-
echo "2.post-start -
|
|
28
|
-
sudo chown -R node:node ./node_modules
|
|
29
|
-
|
|
30
|
-
echo "3.post-start - Building the project..."
|
|
27
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "2.post-start - Building the project..."
|
|
31
28
|
npm run build
|
|
32
29
|
|
|
33
|
-
echo "
|
|
30
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "3.post-start - Post start setup completed!"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Dev Containers v.2.1.0
|
|
2
|
+
|
|
3
|
+
Node and Bun configurations for Matterbridge plugins, aligned with Matterbridge’s Docker VMM setup. Open **Dev Containers: Reopen in Container** and select a runtime.
|
|
4
|
+
|
|
5
|
+
## Startup and storage
|
|
6
|
+
|
|
7
|
+
- The host bootstrap uses only Docker: network inspection/creation and an unconditional image pull run in parallel. No host Bash, Node or Bun installation is needed. All shell scripts run inside the container.
|
|
8
|
+
- Repository source remains bind-mounted. Runtime-specific named volumes hold node_modules; a shared repository volume holds .cache.
|
|
9
|
+
- Both runtimes share the vscode-extensions volume, plus package caches, Bash history and agent state. The images seed home volume ownership with UID/GID 1000; workspace volume ownership is checked during creation.
|
|
10
|
+
- Creation prepares ownership and installs/builds Matterbridge from the dev branch into the shared runtime-specific /matterbridge volume, then links it globally. Change the branch in post-create.sh to use main.
|
|
11
|
+
- Creation also installs plugin dependencies, links Matterbridge, builds the plugin and its optional apps/frontend, registers the plugin with Matterbridge, and checks for outdated packages.
|
|
12
|
+
- Each start installs plugin dependencies, links Matterbridge, and builds the plugin and its optional apps/frontend.
|
|
13
|
+
- Frontend dependencies and Matterbridge runtime state also use named volumes. Port 8283 exposes the Matterbridge frontend over IPv4 and IPv6.
|
|
14
|
+
|
|
15
|
+
## Docker VMM host setup
|
|
16
|
+
|
|
17
|
+
Use Virtual file shares (VirtioFS) for the repository parent directory. Avoid Synchronized file shares: the Matterbridge 2.1.0 reference documents Git memory-mapping failures with those shares.
|
|
18
|
+
|
|
19
|
+
On Windows with Docker VMM, set "dev.containers.forwardWSLServices": false in VS Code **user** settings to avoid unnecessary WSL probes. This application-level setting cannot be supplied by the container configuration.
|
|
20
|
+
|
|
21
|
+
After updating these files or the shared image, run **Dev Containers: Rebuild Container**. Pulling an image does not replace an existing container. Stop the previous runtime before switching: both variants share writable volumes and publish port 8283.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// .devcontainer/bun/devcontainer.json v.2.
|
|
1
|
+
// .devcontainer/bun/devcontainer.json v.2.1.0
|
|
2
2
|
|
|
3
3
|
// This file defines the bun development container configuration for a Matterbridge Plugin.
|
|
4
4
|
|
|
@@ -51,6 +51,8 @@ Dev containers have networking limitations depending on the host OS and Docker s
|
|
|
51
51
|
"source=${localWorkspaceFolderBasename}-plugins,target=/home/bun/Matterbridge,type=volume",
|
|
52
52
|
"source=${localWorkspaceFolderBasename}-storage,target=/home/bun/.matterbridge,type=volume",
|
|
53
53
|
"source=${localWorkspaceFolderBasename}-cert,target=/home/bun/.mattercert,type=volume",
|
|
54
|
+
// Shared by Node and Bun: both images seed extensions with UID/GID 1000.
|
|
55
|
+
"source=vscode-extensions,target=/home/bun/.vscode-server/extensions,type=volume",
|
|
54
56
|
// Dev container shared volumes for matterbridge, npm cache, bun cache, bash history, claude, codex and agents to improve performance
|
|
55
57
|
"source=matterbridge-bun-plugin-dev-container,target=/matterbridge,type=volume",
|
|
56
58
|
"source=npm-cache,target=/home/bun/.npm,type=volume",
|
|
@@ -60,9 +62,20 @@ Dev containers have networking limitations depending on the host OS and Docker s
|
|
|
60
62
|
"source=codex,target=/home/bun/.codex,type=volume",
|
|
61
63
|
"source=agents,target=/home/bun/.agents,type=volume"
|
|
62
64
|
],
|
|
63
|
-
// Set up the Docker environment (runs on the host before the container starts)
|
|
64
|
-
|
|
65
|
-
//
|
|
65
|
+
// Set up the Docker environment (runs on the host before the container starts).
|
|
66
|
+
// Object form: entries run in parallel, each through the host shell (cmd.exe on Windows, /bin/sh elsewhere).
|
|
67
|
+
// Deliberately uses only docker, so the host needs no node, bun or bash: the container is the only toolchain.
|
|
68
|
+
// "||" is one of the few constructs both cmd.exe and /bin/sh share; docker network create is not idempotent,
|
|
69
|
+
// hence the inspect first. On a host that has never created the network, the inspect logs a harmless
|
|
70
|
+
// "network matterbridge not found" to stderr before it is created (there is no portable null device).
|
|
71
|
+
// The pull is unconditional: it costs ~0.9s, runs in parallel with the network check, and guarantees the
|
|
72
|
+
// image itself is never silently stale. Note that pulling refreshes the image, not an existing container:
|
|
73
|
+
// a container keeps the image it was created from until you run "Dev Containers: Rebuild Container".
|
|
74
|
+
"initializeCommand": {
|
|
75
|
+
"network": "docker network inspect matterbridge --format ok || docker network create --ipv6 matterbridge",
|
|
76
|
+
"pull": "docker pull luligu/matterbridge:bun-dev-container"
|
|
77
|
+
},
|
|
78
|
+
// On create, prepare directories, install Matterbridge, and install, link, build and register the plugin
|
|
66
79
|
"postCreateCommand": "bash .devcontainer/bun/post-create.sh",
|
|
67
80
|
// On start, install and build the plugin (runs inside the container)
|
|
68
81
|
"postStartCommand": "bash .devcontainer/bun/post-start.sh",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
|
-
# .devcontainer/bun/install-matterbridge.sh v.2.
|
|
3
|
+
# .devcontainer/bun/install-matterbridge.sh v.2.1.0
|
|
4
4
|
|
|
5
5
|
# This script globally installs Matterbridge from the given branch (main or dev).
|
|
6
6
|
# To be used only inside the Dev Container with the mounted matterbridge volume.
|
|
@@ -9,33 +9,35 @@ set -euo pipefail
|
|
|
9
9
|
|
|
10
10
|
BRANCH="${1:?Usage: install-matterbridge.sh <main|dev>}"
|
|
11
11
|
|
|
12
|
-
echo "1.install-matterbridge - Installing Matterbridge from the $BRANCH branch..."
|
|
12
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "1.install-matterbridge - Installing Matterbridge from the $BRANCH branch..."
|
|
13
13
|
cd /
|
|
14
14
|
if [ ! -d "/workspaces" ]; then
|
|
15
15
|
echo "Directory /workspaces does not exist. Exiting."
|
|
16
16
|
exit 1
|
|
17
17
|
fi
|
|
18
18
|
|
|
19
|
-
echo "2.install-matterbridge - Preparing Matterbridge directory..."
|
|
20
|
-
|
|
19
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "2.install-matterbridge - Preparing Matterbridge directory..."
|
|
20
|
+
if [ "$(stat -c %u matterbridge)" != "$(id -u)" ]; then
|
|
21
|
+
sudo chown -R "$(id -u):$(id -g)" matterbridge
|
|
22
|
+
fi
|
|
21
23
|
sudo chmod g+s matterbridge
|
|
22
24
|
sudo rm -rf matterbridge/* matterbridge/.[!.]* matterbridge/..?*
|
|
23
25
|
|
|
24
|
-
echo "3.install-matterbridge - Cloning Matterbridge from the $BRANCH branch..."
|
|
26
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "3.install-matterbridge - Cloning Matterbridge from the $BRANCH branch..."
|
|
25
27
|
# Shallow clone for speed (history not needed inside dev container). Remove --depth if full history required.
|
|
26
28
|
git clone --depth 1 --single-branch --no-tags -b "$BRANCH" https://github.com/Luligu/matterbridge.git matterbridge
|
|
27
29
|
cd matterbridge
|
|
28
30
|
|
|
29
|
-
echo "4.install-matterbridge - Setting Matterbridge version..."
|
|
31
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "4.install-matterbridge - Setting Matterbridge version..."
|
|
30
32
|
bun scripts/version.mjs git
|
|
31
33
|
|
|
32
|
-
echo "5.install-matterbridge - Installing Matterbridge dependencies and building..."
|
|
34
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "5.install-matterbridge - Installing Matterbridge dependencies and building..."
|
|
33
35
|
rm -f package-lock.json && bun install && bun run build
|
|
34
36
|
|
|
35
|
-
echo "6.install-matterbridge - Installing Matterbridge frontend dependencies and building..."
|
|
37
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "6.install-matterbridge - Installing Matterbridge frontend dependencies and building..."
|
|
36
38
|
cd apps/frontend && rm -f package-lock.json && bun install && bun run build && cd ../..
|
|
37
39
|
|
|
38
|
-
echo "7.install-matterbridge - Installing Matterbridge globally..."
|
|
40
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "7.install-matterbridge - Installing Matterbridge globally..."
|
|
39
41
|
# sudo is required because BUN_INSTALL_BIN=/usr/local/bin is root-owned.
|
|
40
42
|
# -E preserves HOME so the link registry is written under the bun user's
|
|
41
43
|
# home instead of root's, keeping it visible to the non-sudo "bun link"
|
|
@@ -44,4 +46,4 @@ sudo -E bun link
|
|
|
44
46
|
sudo chown -R bun:bun /home/bun/.bun
|
|
45
47
|
sudo rm -rf .agents .cache .claude .codex .devcontainer .git .github .vscode docker docs reflector screenshots scripts systemd
|
|
46
48
|
|
|
47
|
-
echo "8.install-matterbridge - Matterbridge has been installed from the $BRANCH branch."
|
|
49
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "8.install-matterbridge - Matterbridge has been installed from the $BRANCH branch."
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
|
-
# .devcontainer/bun/post-create.sh v.2.
|
|
3
|
+
# .devcontainer/bun/post-create.sh v.2.1.0
|
|
4
4
|
|
|
5
5
|
# This script runs after the Dev Container is created to set up the dev container environment.
|
|
6
6
|
|
|
@@ -20,39 +20,45 @@ echo "Bun version: $(bun -v)"
|
|
|
20
20
|
echo "Bun global cache: ${HOME}/.bun/install/cache"
|
|
21
21
|
echo ""
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
# Ensure required directories exist and are owned by the current user
|
|
24
|
+
workspace_paths=("$PWD/node_modules" "$PWD/apps/frontend/node_modules" "$PWD/.cache")
|
|
25
|
+
home_paths=("$HOME/Matterbridge" "$HOME/.matterbridge" "$HOME/.mattercert" "$HOME/.claude" "$HOME/.codex" "$HOME/.agents" "$HOME/.bash-cache" "$HOME/.npm" "$HOME/.bun" "$HOME/.bun/install/cache" "$HOME/.vscode-server/extensions")
|
|
26
26
|
|
|
27
|
-
echo "
|
|
28
|
-
sudo
|
|
29
|
-
sudo chown -R bun:bun /home/bun/.claude /home/bun/.codex /home/bun/.agents /home/bun/.bash-cache /home/bun/.npm /home/bun/.bun
|
|
27
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "1.post-create - Creating directories..."
|
|
28
|
+
sudo mkdir -p "${workspace_paths[@]}" "${home_paths[@]}" # Create directories if they don't exist
|
|
30
29
|
|
|
31
|
-
echo "
|
|
32
|
-
|
|
33
|
-
#
|
|
34
|
-
# .
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "2.post-create - Setting permissions..."
|
|
31
|
+
# Only chown paths that are not already owned by the current user. The image pre-creates the
|
|
32
|
+
# home paths, so fresh volumes are seeded correctly and this is a no-op; the workspace volumes
|
|
33
|
+
# still need it on first create, but they are empty then, so the recursion is instant.
|
|
34
|
+
for path in . "${workspace_paths[@]}" "${home_paths[@]}"; do
|
|
35
|
+
if [ "$(stat -c %u "$path")" != "$(id -u)" ]; then
|
|
36
|
+
sudo chown -R "$(id -u):$(id -g)" "$path" # Transfer ownership to the current user
|
|
37
|
+
fi
|
|
38
|
+
done
|
|
37
39
|
|
|
38
|
-
echo "
|
|
40
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "3.post-create - Building Matterbridge..."
|
|
41
|
+
# Change dev to main to install the stable branch.
|
|
42
|
+
bash .devcontainer/bun/install-matterbridge.sh dev
|
|
43
|
+
|
|
44
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "4.post-create - Installing the plugin dependencies..."
|
|
39
45
|
[ -f package-lock.json ] && mv package-lock.json package-lock.json.bak || true
|
|
40
46
|
bun install
|
|
41
47
|
[ -f package-lock.json.bak ] && mv package-lock.json.bak package-lock.json || true
|
|
42
48
|
|
|
43
|
-
echo "5.post-create - Linking Matterbridge..."
|
|
49
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "5.post-create - Linking Matterbridge..."
|
|
44
50
|
if ! bun link matterbridge; then
|
|
45
51
|
echo "Retrying link with elevated permissions..."
|
|
46
52
|
sudo bun link matterbridge
|
|
47
53
|
sudo chown -R bun:bun ./node_modules
|
|
48
54
|
fi
|
|
49
55
|
|
|
50
|
-
echo "6.post-create - Building the plugin..."
|
|
56
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "6.post-create - Building the plugin..."
|
|
51
57
|
bun run build
|
|
52
58
|
|
|
53
|
-
echo "7.post-create - Checking for the plugin frontend..."
|
|
59
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "7.post-create - Checking for the plugin frontend..."
|
|
54
60
|
if [ -f apps/frontend/package.json ]; then
|
|
55
|
-
echo "7.post-create - Building the plugin frontend..."
|
|
61
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "7.post-create - Building the plugin frontend..."
|
|
56
62
|
cd apps/frontend
|
|
57
63
|
[ -f package-lock.json ] && mv package-lock.json package-lock.json.bak || true
|
|
58
64
|
bun install && bun run build
|
|
@@ -60,10 +66,10 @@ if [ -f apps/frontend/package.json ]; then
|
|
|
60
66
|
cd ../..
|
|
61
67
|
fi
|
|
62
68
|
|
|
63
|
-
echo "8.post-create - Adding the plugin to Matterbridge..."
|
|
69
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "8.post-create - Adding the plugin to Matterbridge..."
|
|
64
70
|
bun run add
|
|
65
71
|
|
|
66
|
-
echo "9.post-create - Checking for outdated packages..."
|
|
72
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "9.post-create - Checking for outdated packages..."
|
|
67
73
|
bun outdated || true
|
|
68
74
|
|
|
69
|
-
echo "10.post-create - Post create setup completed!"
|
|
75
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "10.post-create - Post create setup completed!"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
|
-
# .devcontainer/bun/post-start.sh v.2.
|
|
3
|
+
# .devcontainer/bun/post-start.sh v.2.1.0
|
|
4
4
|
|
|
5
5
|
# This script runs after the Dev Container is started to set up the dev container environment.
|
|
6
6
|
|
|
@@ -20,24 +20,24 @@ echo "Bun version: $(bun -v)"
|
|
|
20
20
|
echo "Bun global cache: ${HOME}/.bun/install/cache"
|
|
21
21
|
echo ""
|
|
22
22
|
|
|
23
|
-
echo "1.post-start - Installing the plugin dependencies..."
|
|
23
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "1.post-start - Installing the plugin dependencies..."
|
|
24
24
|
[ -f package-lock.json ] && mv package-lock.json package-lock.json.bak || true
|
|
25
25
|
bun install
|
|
26
26
|
[ -f package-lock.json.bak ] && mv package-lock.json.bak package-lock.json || true
|
|
27
27
|
|
|
28
|
-
echo "2.post-start - Linking Matterbridge..."
|
|
28
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "2.post-start - Linking Matterbridge..."
|
|
29
29
|
if ! bun link matterbridge; then
|
|
30
30
|
echo "Retrying link with elevated permissions..."
|
|
31
31
|
sudo bun link matterbridge
|
|
32
32
|
sudo chown -R bun:bun ./node_modules
|
|
33
33
|
fi
|
|
34
34
|
|
|
35
|
-
echo "3.post-start - Building the plugin..."
|
|
35
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "3.post-start - Building the plugin..."
|
|
36
36
|
bun run build
|
|
37
37
|
|
|
38
|
-
echo "4.post-start - Checking for the plugin frontend..."
|
|
38
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "4.post-start - Checking for the plugin frontend..."
|
|
39
39
|
if [ -f apps/frontend/package.json ]; then
|
|
40
|
-
echo "4.post-start - Building the plugin frontend..."
|
|
40
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "4.post-start - Building the plugin frontend..."
|
|
41
41
|
cd apps/frontend
|
|
42
42
|
[ -f package-lock.json ] && mv package-lock.json package-lock.json.bak || true
|
|
43
43
|
bun install && bun run build
|
|
@@ -45,4 +45,4 @@ if [ -f apps/frontend/package.json ]; then
|
|
|
45
45
|
cd ../..
|
|
46
46
|
fi
|
|
47
47
|
|
|
48
|
-
echo "5.post-start - Post start setup completed!"
|
|
48
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "5.post-start - Post start setup completed!"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// .devcontainer/node/devcontainer.json v.2.
|
|
1
|
+
// .devcontainer/node/devcontainer.json v.2.1.0
|
|
2
2
|
|
|
3
3
|
// This file defines the node development container configuration for a Matterbridge Plugin.
|
|
4
4
|
|
|
@@ -51,6 +51,8 @@ Dev containers have networking limitations depending on the host OS and Docker s
|
|
|
51
51
|
"source=${localWorkspaceFolderBasename}-plugins,target=/home/node/Matterbridge,type=volume",
|
|
52
52
|
"source=${localWorkspaceFolderBasename}-storage,target=/home/node/.matterbridge,type=volume",
|
|
53
53
|
"source=${localWorkspaceFolderBasename}-cert,target=/home/node/.mattercert,type=volume",
|
|
54
|
+
// Shared by Node and Bun: both images seed extensions with UID/GID 1000.
|
|
55
|
+
"source=vscode-extensions,target=/home/node/.vscode-server/extensions,type=volume",
|
|
54
56
|
// Dev container shared volumes for matterbridge, npm cache, bun cache, bash history, claude, codex and agents to improve performance
|
|
55
57
|
"source=matterbridge-node-plugin-dev-container,target=/matterbridge,type=volume",
|
|
56
58
|
"source=npm-cache,target=/home/node/.npm,type=volume",
|
|
@@ -60,9 +62,20 @@ Dev containers have networking limitations depending on the host OS and Docker s
|
|
|
60
62
|
"source=codex,target=/home/node/.codex,type=volume",
|
|
61
63
|
"source=agents,target=/home/node/.agents,type=volume"
|
|
62
64
|
],
|
|
63
|
-
// Set up the Docker environment (runs on the host before the container starts)
|
|
64
|
-
|
|
65
|
-
//
|
|
65
|
+
// Set up the Docker environment (runs on the host before the container starts).
|
|
66
|
+
// Object form: entries run in parallel, each through the host shell (cmd.exe on Windows, /bin/sh elsewhere).
|
|
67
|
+
// Deliberately uses only docker, so the host needs no node, bun or bash: the container is the only toolchain.
|
|
68
|
+
// "||" is one of the few constructs both cmd.exe and /bin/sh share; docker network create is not idempotent,
|
|
69
|
+
// hence the inspect first. On a host that has never created the network, the inspect logs a harmless
|
|
70
|
+
// "network matterbridge not found" to stderr before it is created (there is no portable null device).
|
|
71
|
+
// The pull is unconditional: it costs ~0.9s, runs in parallel with the network check, and guarantees the
|
|
72
|
+
// image itself is never silently stale. Note that pulling refreshes the image, not an existing container:
|
|
73
|
+
// a container keeps the image it was created from until you run "Dev Containers: Rebuild Container".
|
|
74
|
+
"initializeCommand": {
|
|
75
|
+
"network": "docker network inspect matterbridge --format ok || docker network create --ipv6 matterbridge",
|
|
76
|
+
"pull": "docker pull luligu/matterbridge:node-dev-container"
|
|
77
|
+
},
|
|
78
|
+
// On create, prepare directories, install Matterbridge, and install, link, build and register the plugin
|
|
66
79
|
"postCreateCommand": "bash .devcontainer/node/post-create.sh",
|
|
67
80
|
// On start, install and build the plugin (runs inside the container)
|
|
68
81
|
"postStartCommand": "bash .devcontainer/node/post-start.sh",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
|
-
# .devcontainer/node/install-matterbridge.sh v.2.
|
|
3
|
+
# .devcontainer/node/install-matterbridge.sh v.2.1.0
|
|
4
4
|
|
|
5
5
|
# This script globally installs Matterbridge from the given branch (main or dev).
|
|
6
6
|
# To be used only inside the Dev Container with the mounted matterbridge volume.
|
|
@@ -9,34 +9,36 @@ set -euo pipefail
|
|
|
9
9
|
|
|
10
10
|
BRANCH="${1:?Usage: install-matterbridge.sh <main|dev>}"
|
|
11
11
|
|
|
12
|
-
echo "1.install-matterbridge - Installing Matterbridge from the $BRANCH branch..."
|
|
12
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "1.install-matterbridge - Installing Matterbridge from the $BRANCH branch..."
|
|
13
13
|
cd /
|
|
14
14
|
if [ ! -d "/workspaces" ]; then
|
|
15
15
|
echo "Directory /workspaces does not exist. Exiting."
|
|
16
16
|
exit 1
|
|
17
17
|
fi
|
|
18
18
|
|
|
19
|
-
echo "2.install-matterbridge - Preparing Matterbridge directory..."
|
|
20
|
-
|
|
19
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "2.install-matterbridge - Preparing Matterbridge directory..."
|
|
20
|
+
if [ "$(stat -c %u matterbridge)" != "$(id -u)" ]; then
|
|
21
|
+
sudo chown -R "$(id -u):$(id -g)" matterbridge
|
|
22
|
+
fi
|
|
21
23
|
sudo chmod g+s matterbridge
|
|
22
24
|
sudo rm -rf matterbridge/* matterbridge/.[!.]* matterbridge/..?*
|
|
23
25
|
|
|
24
|
-
echo "3.install-matterbridge - Cloning Matterbridge from the $BRANCH branch..."
|
|
26
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "3.install-matterbridge - Cloning Matterbridge from the $BRANCH branch..."
|
|
25
27
|
# Shallow clone for speed (history not needed inside dev container). Remove --depth if full history required.
|
|
26
28
|
git clone --depth 1 --single-branch --no-tags -b "$BRANCH" https://github.com/Luligu/matterbridge.git matterbridge
|
|
27
29
|
cd matterbridge
|
|
28
30
|
|
|
29
|
-
echo "4.install-matterbridge - Setting Matterbridge version..."
|
|
31
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "4.install-matterbridge - Setting Matterbridge version..."
|
|
30
32
|
node scripts/version.mjs git
|
|
31
33
|
|
|
32
|
-
echo "5.install-matterbridge - Installing Matterbridge dependencies and building..."
|
|
34
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "5.install-matterbridge - Installing Matterbridge dependencies and building..."
|
|
33
35
|
npm ci --no-fund --no-audit && npm run build
|
|
34
36
|
|
|
35
|
-
echo "6.install-matterbridge - Installing Matterbridge frontend dependencies and building..."
|
|
37
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "6.install-matterbridge - Installing Matterbridge frontend dependencies and building..."
|
|
36
38
|
cd apps/frontend && npm ci --no-fund --no-audit && npm run build && cd ../..
|
|
37
39
|
|
|
38
|
-
echo "7.install-matterbridge - Installing Matterbridge globally..."
|
|
40
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "7.install-matterbridge - Installing Matterbridge globally..."
|
|
39
41
|
sudo npm link --no-fund --no-audit
|
|
40
42
|
|
|
41
|
-
echo "8.install-matterbridge - Matterbridge has been installed from the $BRANCH branch."
|
|
43
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "8.install-matterbridge - Matterbridge has been installed from the $BRANCH branch."
|
|
42
44
|
sudo rm -rf .agents .cache .claude .codex .devcontainer .git .github .vscode docker docs reflector screenshots scripts systemd
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
|
-
# .devcontainer/node/post-create.sh v.2.
|
|
3
|
+
# .devcontainer/node/post-create.sh v.2.1.0
|
|
4
4
|
|
|
5
5
|
# This script runs after the Dev Container is created to set up the dev container environment.
|
|
6
6
|
|
|
@@ -21,44 +21,50 @@ echo "Npm version: $(npm -v)"
|
|
|
21
21
|
echo "Npm cache: $(npm config get cache)"
|
|
22
22
|
echo ""
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
# Ensure required directories exist and are owned by the current user
|
|
25
|
+
workspace_paths=("$PWD/node_modules" "$PWD/apps/frontend/node_modules" "$PWD/.cache")
|
|
26
|
+
home_paths=("$HOME/Matterbridge" "$HOME/.matterbridge" "$HOME/.mattercert" "$HOME/.claude" "$HOME/.codex" "$HOME/.agents" "$HOME/.bash-cache" "$HOME/.npm" "$HOME/.bun" "$HOME/.bun/install/cache" "$HOME/.vscode-server/extensions")
|
|
27
27
|
|
|
28
|
-
echo "
|
|
29
|
-
sudo
|
|
30
|
-
sudo chown -R node:node /home/node/.claude /home/node/.codex /home/node/.agents /home/node/.bash-cache /home/node/.npm /home/node/.bun
|
|
28
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "1.post-create - Creating directories..."
|
|
29
|
+
sudo mkdir -p "${workspace_paths[@]}" "${home_paths[@]}" # Create directories if they don't exist
|
|
31
30
|
|
|
32
|
-
echo "
|
|
33
|
-
|
|
34
|
-
#
|
|
35
|
-
# .
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "2.post-create - Setting permissions..."
|
|
32
|
+
# Only chown paths that are not already owned by the current user. The image pre-creates the
|
|
33
|
+
# home paths, so fresh volumes are seeded correctly and this is a no-op; the workspace volumes
|
|
34
|
+
# still need it on first create, but they are empty then, so the recursion is instant.
|
|
35
|
+
for path in . "${workspace_paths[@]}" "${home_paths[@]}"; do
|
|
36
|
+
if [ "$(stat -c %u "$path")" != "$(id -u)" ]; then
|
|
37
|
+
sudo chown -R "$(id -u):$(id -g)" "$path" # Transfer ownership to the current user
|
|
38
|
+
fi
|
|
39
|
+
done
|
|
38
40
|
|
|
39
|
-
echo "
|
|
40
|
-
|
|
41
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "3.post-create - Building Matterbridge..."
|
|
42
|
+
# Change dev to main to install the stable branch.
|
|
43
|
+
bash .devcontainer/node/install-matterbridge.sh dev
|
|
41
44
|
|
|
42
|
-
echo "
|
|
45
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "4.post-create - Installing the plugin dependencies..."
|
|
46
|
+
npm install --no-fund --no-audit
|
|
47
|
+
|
|
48
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "5.post-create - Linking Matterbridge..."
|
|
43
49
|
if ! npm link matterbridge --no-fund --no-audit; then
|
|
44
50
|
echo "Retrying link with elevated permissions..."
|
|
45
51
|
sudo npm link matterbridge --no-fund --no-audit
|
|
46
52
|
sudo chown -R node:node ./node_modules
|
|
47
53
|
fi
|
|
48
54
|
|
|
49
|
-
echo "6.post-create - Building the plugin..."
|
|
55
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "6.post-create - Building the plugin..."
|
|
50
56
|
npm run build
|
|
51
57
|
|
|
52
|
-
echo "7.post-create - Checking for the plugin frontend..."
|
|
58
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "7.post-create - Checking for the plugin frontend..."
|
|
53
59
|
if [ -f apps/frontend/package.json ]; then
|
|
54
|
-
echo "7.post-create - Building the plugin frontend..."
|
|
55
|
-
cd apps/frontend && npm
|
|
60
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "7.post-create - Building the plugin frontend..."
|
|
61
|
+
cd apps/frontend && npm install --no-fund --no-audit && npm run build && cd ../..
|
|
56
62
|
fi
|
|
57
63
|
|
|
58
|
-
echo "8.post-create - Adding the plugin to Matterbridge..."
|
|
64
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "8.post-create - Adding the plugin to Matterbridge..."
|
|
59
65
|
npm run add
|
|
60
66
|
|
|
61
|
-
echo "9.post-create - Checking for outdated packages..."
|
|
67
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "9.post-create - Checking for outdated packages..."
|
|
62
68
|
npm outdated || true
|
|
63
69
|
|
|
64
|
-
echo "10.post-create - Post create setup completed!"
|
|
70
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "10.post-create - Post create setup completed!"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
|
-
# .devcontainer/node/post-start.sh v.2.
|
|
3
|
+
# .devcontainer/node/post-start.sh v.2.1.0
|
|
4
4
|
|
|
5
5
|
# This script runs after the Dev Container is started to set up the dev container environment.
|
|
6
6
|
|
|
@@ -21,23 +21,23 @@ echo "Npm version: $(npm -v)"
|
|
|
21
21
|
echo "Npm cache: $(npm config get cache)"
|
|
22
22
|
echo ""
|
|
23
23
|
|
|
24
|
-
echo "1.post-start - Installing the plugin dependencies..."
|
|
25
|
-
npm
|
|
24
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "1.post-start - Installing the plugin dependencies..."
|
|
25
|
+
npm install --no-fund --no-audit
|
|
26
26
|
|
|
27
|
-
echo "2.post-start - Linking Matterbridge..."
|
|
27
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "2.post-start - Linking Matterbridge..."
|
|
28
28
|
if ! npm link matterbridge --no-fund --no-audit; then
|
|
29
29
|
echo "Retrying link with elevated permissions..."
|
|
30
30
|
sudo npm link matterbridge --no-fund --no-audit
|
|
31
31
|
sudo chown -R node:node ./node_modules
|
|
32
32
|
fi
|
|
33
33
|
|
|
34
|
-
echo "3.post-start - Building the plugin..."
|
|
34
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "3.post-start - Building the plugin..."
|
|
35
35
|
npm run build
|
|
36
36
|
|
|
37
|
-
echo "4.post-start - Checking for the plugin frontend..."
|
|
37
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "4.post-start - Checking for the plugin frontend..."
|
|
38
38
|
if [ -f apps/frontend/package.json ]; then
|
|
39
|
-
echo "4.post-start - Building the plugin frontend..."
|
|
40
|
-
cd apps/frontend && npm
|
|
39
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "4.post-start - Building the plugin frontend..."
|
|
40
|
+
cd apps/frontend && npm install --no-fund --no-audit && npm run build && cd ../..
|
|
41
41
|
fi
|
|
42
42
|
|
|
43
|
-
echo "5.post-start - Post start setup completed!"
|
|
43
|
+
echo $'\033[36m'"[$(date '+%Y-%m-%d %H:%M:%S')]"$'\033[0m' "5.post-start - Post start setup completed!"
|
|
@@ -4,13 +4,13 @@ name: CodeQL
|
|
|
4
4
|
|
|
5
5
|
on:
|
|
6
6
|
push:
|
|
7
|
-
branches: [main]
|
|
7
|
+
branches: [main, dev]
|
|
8
8
|
paths-ignore:
|
|
9
9
|
- 'screenshots/**' # any file under screenshots/
|
|
10
10
|
- 'scripts/**' # any file under scripts/
|
|
11
11
|
- '**/*.md' # any .md anywhere
|
|
12
12
|
pull_request:
|
|
13
|
-
branches: [main]
|
|
13
|
+
branches: [main, dev]
|
|
14
14
|
paths-ignore:
|
|
15
15
|
- 'screenshots/**' # any file under screenshots/
|
|
16
16
|
- 'scripts/**' # any file under scripts/
|
|
@@ -4,13 +4,13 @@ name: CodeQL
|
|
|
4
4
|
|
|
5
5
|
on:
|
|
6
6
|
push:
|
|
7
|
-
branches: [main]
|
|
7
|
+
branches: [main, dev]
|
|
8
8
|
paths-ignore:
|
|
9
9
|
- 'screenshots/**' # any file under screenshots/
|
|
10
10
|
- 'scripts/**' # any file under scripts/
|
|
11
11
|
- '**/*.md' # any .md anywhere
|
|
12
12
|
pull_request:
|
|
13
|
-
branches: [main]
|
|
13
|
+
branches: [main, dev]
|
|
14
14
|
paths-ignore:
|
|
15
15
|
- 'screenshots/**' # any file under screenshots/
|
|
16
16
|
- 'scripts/**' # any file under scripts/
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
# .devcontainer/bun/initialize.sh v.2.0.0
|
|
4
|
-
|
|
5
|
-
# This script runs on the host before the Dev Container is created to set up the Docker environment.
|
|
6
|
-
|
|
7
|
-
set -euo pipefail
|
|
8
|
-
|
|
9
|
-
echo "Welcome to Matterbridge Dev Container (initialize.sh)"
|
|
10
|
-
echo ""
|
|
11
|
-
|
|
12
|
-
echo "1.initialize - Creating the Matterbridge Docker network..."
|
|
13
|
-
docker network inspect matterbridge >/dev/null 2>&1 || docker network create --ipv6 matterbridge
|
|
14
|
-
|
|
15
|
-
echo "2.initialize - Pulling the bun dev container image..."
|
|
16
|
-
docker pull luligu/matterbridge:bun-dev-container
|
|
17
|
-
|
|
18
|
-
echo "3.initialize - Setting script permissions..."
|
|
19
|
-
chmod +x .devcontainer/bun/*.sh
|
|
20
|
-
|
|
21
|
-
echo "4.initialize - Initialization completed!"
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
# .devcontainer/node/initialize.sh v.2.0.0
|
|
4
|
-
|
|
5
|
-
# This script runs on the host before the Dev Container is created to set up the Docker environment.
|
|
6
|
-
|
|
7
|
-
set -euo pipefail
|
|
8
|
-
|
|
9
|
-
echo "Welcome to Matterbridge Dev Container (initialize.sh)"
|
|
10
|
-
echo ""
|
|
11
|
-
|
|
12
|
-
echo "1.initialize - Creating the Matterbridge Docker network..."
|
|
13
|
-
docker network inspect matterbridge >/dev/null 2>&1 || docker network create --ipv6 matterbridge
|
|
14
|
-
|
|
15
|
-
echo "2.initialize - Pulling the node dev container image..."
|
|
16
|
-
docker pull luligu/matterbridge:node-dev-container
|
|
17
|
-
|
|
18
|
-
echo "3.initialize - Setting script permissions..."
|
|
19
|
-
chmod +x .devcontainer/node/*.sh
|
|
20
|
-
|
|
21
|
-
echo "4.initialize - Initialization completed!"
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
# .devcontainer/bun/initialize.sh v.2.0.0
|
|
4
|
-
|
|
5
|
-
# This script runs on the host before the Dev Container is created to set up the Docker environment.
|
|
6
|
-
|
|
7
|
-
set -euo pipefail
|
|
8
|
-
|
|
9
|
-
echo "Welcome to Matterbridge Plugin Dev Container (initialize.sh)"
|
|
10
|
-
echo ""
|
|
11
|
-
|
|
12
|
-
echo "1.initialize - Creating the Matterbridge Docker network..."
|
|
13
|
-
docker network inspect matterbridge >/dev/null 2>&1 || docker network create --ipv6 matterbridge
|
|
14
|
-
|
|
15
|
-
echo "2.initialize - Pulling the bun dev container image..."
|
|
16
|
-
docker pull luligu/matterbridge:bun-dev-container
|
|
17
|
-
|
|
18
|
-
echo "3.initialize - Setting script permissions..."
|
|
19
|
-
chmod +x .devcontainer/bun/*.sh
|
|
20
|
-
|
|
21
|
-
echo "4.initialize - Initialization completed!"
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
# .devcontainer/node/initialize.sh v.2.0.0
|
|
4
|
-
|
|
5
|
-
# This script runs on the host before the Dev Container is created to set up the Docker environment.
|
|
6
|
-
|
|
7
|
-
set -euo pipefail
|
|
8
|
-
|
|
9
|
-
echo "Welcome to Matterbridge Plugin Dev Container (initialize.sh)"
|
|
10
|
-
echo ""
|
|
11
|
-
|
|
12
|
-
echo "1.initialize - Creating the Matterbridge Docker network..."
|
|
13
|
-
docker network inspect matterbridge >/dev/null 2>&1 || docker network create --ipv6 matterbridge
|
|
14
|
-
|
|
15
|
-
echo "2.initialize - Pulling the node dev container image..."
|
|
16
|
-
docker pull luligu/matterbridge:node-dev-container
|
|
17
|
-
|
|
18
|
-
echo "3.initialize - Setting script permissions..."
|
|
19
|
-
chmod +x .devcontainer/node/*.sh
|
|
20
|
-
|
|
21
|
-
echo "4.initialize - Initialization completed!"
|