Skip to content
Closed
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
12 changes: 11 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,21 @@ SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsI
# Port for the local server (default: 3000)
PORT=3000

# Bind address (default: loopback only). Set 0.0.0.0 only when LAN access is
# intentionally required and the host firewall/network is trusted.
ISOTOPE_BIND_HOST=127.0.0.1

# Optional comma-separated browser origins allowed to call the local server.
# Same-origin requests are always allowed.
CORS_ALLOWED_ORIGINS=

# ── Admin / Owner only — leave blank for normal users ─────────────────────
# Set ENABLE_ADMIN_MODE=true to unlock /__admin diagnostics
ENABLE_ADMIN_MODE=false

# Service-role key — owner only, never share, never expose to browser
SUPABASE_SECRET_KEY=
# Legacy fallback only. Prefer SUPABASE_SECRET_KEY for server/admin operations.
SUPABASE_SERVICE_ROLE_KEY=

# Admin unlock secret for /__admin/login
Expand All @@ -32,7 +42,7 @@ ADMIN_EMAILS=
# Defaults to ADMIN_EMAIL when blank.
BROWSER_PROOF_EMAIL=

# Supabase management API token (owner diagnostics only)
# Supabase management API token (owner diagnostics only, server-side only)
SUPABASE_ACCESS_TOKEN=

# GitHub PAT (owner diagnostics / update checks only)
Expand Down
26 changes: 26 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: 2
updates:
- package-ecosystem: npm
directory: /
schedule:
interval: weekly
day: monday
time: "06:00"
timezone: Asia/Kolkata
open-pull-requests-limit: 5
groups:
development-dependencies:
dependency-type: development
commit-message:
prefix: deps

- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
day: monday
time: "06:15"
timezone: Asia/Kolkata
open-pull-requests-limit: 5
commit-message:
prefix: ci
2 changes: 1 addition & 1 deletion .github/workflows/auto-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

steps:
- name: 🏷️ Apply labels based on file changes
uses: actions/labeler@v5
uses: actions/labeler@v6
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
configuration-path: .github/labeler.yml
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:

steps:
- name: ⬇️ Checkout
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: 🟢 Setup Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}

Expand Down Expand Up @@ -201,7 +201,11 @@ jobs:
isotope-complete.sql
community-patch-v4.sql
sql/006_security_policy_cleanup.sql
sql/007_comprehensive_sql_rls_hardening.sql
sql/008_security_invoker_rpc_boundary.sql
sql/009_remove_redundant_indexes.sql
sql/backup_manifests.sql
scripts/verify-sql-hardening.sql
sql/verify-security.sql
.env.example
README.md
Expand Down Expand Up @@ -239,7 +243,7 @@ jobs:
echo "❌ .env is tracked; remove it before release"
exit 1
fi
if git grep -nE 'SUPABASE_SERVICE_ROLE_KEY[[:space:]]*=[[:space:]]*eyJ|SUPABASE_ACCESS_TOKEN[[:space:]]*=[[:space:]]*sbp_|ADMIN_SECRET[[:space:]]*=[[:space:]]*[A-Za-z0-9_-]{24,}' -- \
if git grep -nE 'SUPABASE_SECRET_KEY[[:space:]]*=[[:space:]]*sb_secret_[A-Za-z0-9_-]{16,}|SUPABASE_SERVICE_ROLE_KEY[[:space:]]*=[[:space:]]*eyJ|SUPABASE_ACCESS_TOKEN[[:space:]]*=[[:space:]]*sbp_|ADMIN_SECRET[[:space:]]*=[[:space:]]*[A-Za-z0-9_-]{24,}' -- \
':!*.md' ':!.env.example' ':!public/assets/**'; then
echo "❌ Hardcoded private secret detected!"
exit 1
Expand All @@ -250,7 +254,7 @@ jobs:
- name: 📋 Schema file stats
run: |
set -euo pipefail
for f in isotope-complete.sql community-patch-v4.sql sql/006_security_policy_cleanup.sql sql/backup_manifests.sql sql/verify-security.sql performance-patch.sql; do
for f in isotope-complete.sql community-patch-v4.sql sql/006_security_policy_cleanup.sql sql/007_comprehensive_sql_rls_hardening.sql sql/008_security_invoker_rpc_boundary.sql sql/009_remove_redundant_indexes.sql sql/backup_manifests.sql sql/verify-security.sql scripts/verify-sql-hardening.sql performance-patch.sql; do
if [ -f "$f" ]; then
echo "=== $f ==="
echo " Size : $(wc -c < "$f") bytes"
Expand Down Expand Up @@ -332,7 +336,7 @@ jobs:
unzip -q "isotope-v${VERSION}-ci-test.zip" -d "$TMPDIR"
echo "Verifying extracted release..."
FAIL=0
for f in server.mjs package.json setup.sh install-termux.sh bin/isotope .env.example public/sync/backup-normalizer.js public/sync/local-data-adapter.js server/backup-manager.mjs scripts/prove-new-browser-restore.mjs sql/backup_manifests.sql docs/sync-system.md docs/storage-backup-system.md docs/supabase-connection-map.md; do
for f in server.mjs package.json setup.sh install-termux.sh bin/isotope .env.example public/sync/backup-normalizer.js public/sync/local-data-adapter.js server/backup-manager.mjs scripts/prove-new-browser-restore.mjs sql/backup_manifests.sql sql/007_comprehensive_sql_rls_hardening.sql sql/008_security_invoker_rpc_boundary.sql sql/009_remove_redundant_indexes.sql scripts/verify-sql-hardening.sql docs/sync-system.md docs/storage-backup-system.md docs/supabase-connection-map.md; do
if [ -f "$TMPDIR/$f" ]; then
echo " ✅ $f"
else
Expand All @@ -356,7 +360,7 @@ jobs:
# ── Upload logs on failure ────────────────────────────────────────────────
- name: 📤 Upload CI logs on failure
if: failure()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: ci-logs-node${{ matrix.node }}-${{ github.run_id }}
path: |
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,20 @@ jobs:

steps:
- name: ⬇️ Checkout
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: 🔍 Initialize CodeQL
uses: github/codeql-action/init@v3
uses: github/codeql-action/init@v4
with:
languages: javascript-typescript
languages: javascript-typescript, actions
# Config excludes public/ (154 minified React bundle files) and docs/
# which would otherwise generate hundreds of false-positive warnings.
# Uses security-extended only — security-and-quality adds stylistic
# rules that are not actionable for a single-file server app.
config-file: ./.github/codeql/codeql-config.yml

- name: 🏗️ Autobuild
uses: github/codeql-action/autobuild@v3
uses: github/codeql-action/autobuild@v4

- name: 📊 Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: /language:javascript-typescript
uses: github/codeql-action/analyze@v4
4 changes: 2 additions & 2 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:

steps:
- name: ⬇️ Checkout
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: 🔒 Dependency Review
uses: actions/dependency-review-action@v4
uses: actions/dependency-review-action@v5
with:
fail-on-severity: high
comment-summary-in-pr: always
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Lighthouse CI

on:
pull_request:
branches: [main]
push:
branches: [main]
workflow_dispatch:

concurrency:
group: lighthouse-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
lighthouse:
name: Lighthouse audit
runs-on: ubuntu-latest
timeout-minutes: 20

steps:
- name: Checkout
uses: actions/checkout@v7

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '22'
cache: npm

- name: Install dependencies
run: npm ci

- name: Verify current file audit
run: |
npm run audit:generate
npm run audit:verify
git diff --exit-code -- audit/current

- name: Run Lighthouse CI
run: npm run lighthouse

- name: Upload Lighthouse reports
if: always()
uses: actions/upload-artifact@v7
with:
name: lighthouse-reports
path: |
artifacts/lighthouse
.lighthouseci
if-no-files-found: warn
retention-days: 14
8 changes: 4 additions & 4 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v7
- name: Setup Pages
uses: actions/configure-pages@v4
uses: actions/configure-pages@v6
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
uses: actions/upload-pages-artifact@v5
with:
path: './docs'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@v5
8 changes: 6 additions & 2 deletions .github/workflows/regenerate-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

steps:
- name: ⬇️ Checkout
uses: actions/checkout@v4
uses: actions/checkout@v7
with:
fetch-depth: 0

Expand All @@ -47,7 +47,7 @@ jobs:
echo "version=$VERSION" >> "$GITHUB_OUTPUT"

- name: 🟢 Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: '22'

Expand Down Expand Up @@ -106,6 +106,10 @@ jobs:
scripts/compare-remote-assets.mjs
isotope-complete.sql
sql/backup_manifests.sql
sql/007_comprehensive_sql_rls_hardening.sql
sql/008_security_invoker_rpc_boundary.sql
sql/009_remove_redundant_indexes.sql
scripts/verify-sql-hardening.sql
docs/sync-system.md
docs/storage-backup-system.md
docs/supabase-connection-map.md
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

steps:
- name: ⬇️ Checkout
uses: actions/checkout@v4
uses: actions/checkout@v7
with:
fetch-depth: 0

Expand All @@ -44,7 +44,7 @@ jobs:
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"

- name: 🟢 Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: '22'

Expand Down Expand Up @@ -182,6 +182,10 @@ jobs:
scripts/compare-remote-assets.mjs
sql/backup_manifests.sql
sql/006_security_policy_cleanup.sql
sql/007_comprehensive_sql_rls_hardening.sql
sql/008_security_invoker_rpc_boundary.sql
sql/009_remove_redundant_indexes.sql
scripts/verify-sql-hardening.sql
docs/sync-system.md
docs/storage-backup-system.md
docs/supabase-connection-map.md
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/schema-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

steps:
- name: ⬇️ Checkout
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: 📊 Schema file stats
run: |
Expand Down Expand Up @@ -135,16 +135,22 @@ jobs:
fi

echo "Stripping Supabase-cloud-only statements..."
grep -v \
awk '
/^CREATE EVENT TRIGGER / { skip_event_trigger = 1 }
skip_event_trigger {
if ($0 ~ /;[[:space:]]*$/) skip_event_trigger = 0
next
}
/^DROP EVENT TRIGGER / { next }
{ print }
' isotope-complete.sql | grep -v \
-e 'ALTER PUBLICATION' \
-e 'supabase_realtime' \
-e 'CREATE EVENT TRIGGER' \
-e 'DROP EVENT TRIGGER' \
-e 'pg_net\.' \
-e 'http_request' \
-e 'supabase_admin' \
-e 'net\.http' \
isotope-complete.sql > /tmp/schema_test.sql
> /tmp/schema_test.sql

echo "Running schema against PostgreSQL 16..."
set +e
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

steps:
- name: 🕰️ Process stale issues and PRs
uses: actions/stale@v9
uses: actions/stale@v10
with:
# Issues
stale-issue-message: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/welcome.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
steps:
- name: 👋 Welcome first-time issue opener
if: github.event_name == 'issues'
uses: actions/github-script@v7
uses: actions/github-script@v9
with:
script: |
const { owner, repo } = context.repo;
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:

- name: 🎉 Welcome first-time PR opener
if: github.event_name == 'pull_request_target'
uses: actions/github-script@v7
uses: actions/github-script@v9
with:
script: |
const { owner, repo } = context.repo;
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ build/
.isotope/logs/
.isotope/tmp/
artifacts/
.lighthouseci/
/screenshot
/screenshot.zip
/screenshots/*.zip
Loading
Loading