Skip to content
Draft
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
195 changes: 195 additions & 0 deletions .github/workflows/build-extensions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
name: Build & Pack Extensions

on:
push:
tags:
- 'v*'

permissions:
contents: write

jobs:
# ──────────────────────────────────────────────
# Chrome Extension
# ──────────────────────────────────────────────
build-chrome:
name: Build Chrome Extension
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: extension/package-lock.json

- name: Install dependencies
working-directory: extension
run: npm ci

- name: Build Chrome extension
working-directory: extension
run: npm run build

- name: Package Chrome extension
run: |
cd extension/dist
zip -r ../../trustvault-chrome-${{ github.ref_name }}.zip .

- name: Upload Chrome artifact
uses: actions/upload-artifact@v4
with:
name: trustvault-chrome-${{ github.ref_name }}
path: trustvault-chrome-${{ github.ref_name }}.zip
retention-days: 90

# ──────────────────────────────────────────────
# Firefox Extension
# ──────────────────────────────────────────────
build-firefox:
name: Build Firefox Extension
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: extension/package-lock.json

- name: Install dependencies
working-directory: extension
run: npm ci

- name: Build Firefox extension
working-directory: extension
run: npm run build:firefox

- name: Package Firefox extension
run: |
cd extension/dist-firefox
zip -r ../../trustvault-firefox-${{ github.ref_name }}.zip .

- name: Upload Firefox artifact
uses: actions/upload-artifact@v4
with:
name: trustvault-firefox-${{ github.ref_name }}
path: trustvault-firefox-${{ github.ref_name }}.zip
retention-days: 90

# ──────────────────────────────────────────────
# Mattermost Plugin
# ──────────────────────────────────────────────
build-mattermost:
name: Build Mattermost Plugin
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: mattermost-plugin/webapp/package-lock.json

- name: Install dependencies
working-directory: mattermost-plugin/webapp
run: npm install

- name: Build Mattermost webapp bundle
working-directory: mattermost-plugin/webapp
run: npm run build

- name: Package Mattermost plugin
run: |
PLUGIN_ID="com.trustvault.plugin"
PLUGIN_VERSION="${{ github.ref_name }}"
BUNDLE_DIR="plugin-bundle"
mkdir -p "$BUNDLE_DIR/$PLUGIN_ID/webapp"
cp mattermost-plugin/plugin.json "$BUNDLE_DIR/$PLUGIN_ID/"
cp mattermost-plugin/webapp/main.js "$BUNDLE_DIR/$PLUGIN_ID/webapp/"
cd "$BUNDLE_DIR"
tar -czf "../trustvault-mattermost-$PLUGIN_VERSION.tar.gz" "$PLUGIN_ID"

- name: Upload Mattermost artifact
uses: actions/upload-artifact@v4
with:
name: trustvault-mattermost-${{ github.ref_name }}
path: trustvault-mattermost-${{ github.ref_name }}.tar.gz
retention-days: 90

# ──────────────────────────────────────────────
# GitHub Release — attach all three artifacts
# ──────────────────────────────────────────────
release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs: [build-chrome, build-firefox, build-mattermost]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Download Chrome artifact
uses: actions/download-artifact@v4
with:
name: trustvault-chrome-${{ github.ref_name }}

- name: Download Firefox artifact
uses: actions/download-artifact@v4
with:
name: trustvault-firefox-${{ github.ref_name }}

- name: Download Mattermost artifact
uses: actions/download-artifact@v4
with:
name: trustvault-mattermost-${{ github.ref_name }}

- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: TrustVault ${{ github.ref_name }}
body: |
## TrustVault ${{ github.ref_name }}

### Downloads

| Add-on | File |
|--------|------|
| 🌐 Chrome Extension | `trustvault-chrome-${{ github.ref_name }}.zip` |
| 🦊 Firefox Extension | `trustvault-firefox-${{ github.ref_name }}.zip` |
| 💬 Mattermost Plugin | `trustvault-mattermost-${{ github.ref_name }}.tar.gz` |

### Installation

**Chrome / Chromium browsers**
1. Unzip `trustvault-chrome-*.zip`
2. Open `chrome://extensions` → Enable Developer mode
3. Click "Load unpacked" and select the unzipped folder

**Firefox**
1. Open `about:debugging#/runtime/this-firefox`
2. Click "Load Temporary Add-on…" and select the ZIP

**Mattermost**
1. Go to System Console → Plugin Management → Upload Plugin
2. Upload `trustvault-mattermost-*.tar.gz`
3. Enable the "Trust Vault" plugin
draft: false
prerelease: false
files: |
trustvault-chrome-${{ github.ref_name }}.zip
trustvault-firefox-${{ github.ref_name }}.zip
trustvault-mattermost-${{ github.ref_name }}.tar.gz
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ logs/

# Build outputs
dist/
dist-firefox/
build/
mattermost-plugin/webapp/main.js
mattermost-plugin/webapp/main.js.LICENSE.txt

# IDE
.vscode/
Expand Down
2 changes: 2 additions & 0 deletions client/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import GroupList from './pages/Admin/GroupList';
import AuditLogList from './pages/Admin/AuditLogList';
import SecuritySettings from './pages/Admin/SecuritySettings';
import MyActivity from './pages/MyActivity';
import DownloadsPage from './pages/DownloadsPage';

const queryClient = new QueryClient();

Expand All @@ -32,6 +33,7 @@ export default function App() {
<Route element={<Layout />}>
<Route path="/" element={<VaultList />} />
<Route path="/activity" element={<MyActivity />} />
<Route path="/downloads" element={<DownloadsPage />} />

<Route element={<ProtectedRoute allowedRoles={['admin']} />}>
<Route path="/users" element={<UserList />} />
Expand Down
4 changes: 3 additions & 1 deletion client/src/components/Layout.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState } from 'react';
import { Link, useLocation, useNavigate, Outlet } from 'react-router-dom';
import { useAuth } from '../context/AuthContext';
import { LayoutDashboard, Users, Shield, Key, FileText, LogOut, Lock, ChevronRight, Menu, X } from 'lucide-react';
import { LayoutDashboard, Users, Shield, Key, FileText, LogOut, Lock, ChevronRight, Menu, X, Download } from 'lucide-react';
import { cn } from '../lib/utils';

export default function Layout() {
Expand Down Expand Up @@ -62,6 +62,7 @@ export default function Layout() {
</div>
<NavItem to="/" icon={LayoutDashboard} label="Vault Items" />
<NavItem to="/activity" icon={FileText} label="My Activity" />
<NavItem to="/downloads" icon={Download} label="Downloads" />

{user?.role === 'admin' && (
<>
Expand Down Expand Up @@ -148,6 +149,7 @@ export default function Layout() {
<h2 className="text-lg font-semibold text-gray-900">
{location.pathname === '/' && 'Dashboard'}
{location.pathname === '/activity' && 'My Activity'}
{location.pathname === '/downloads' && 'Downloads'}
{location.pathname === '/users' && 'User Management'}
{location.pathname === '/groups' && 'Group Management'}
{location.pathname === '/audit-logs' && 'Audit Logs'}
Expand Down
Loading