This document explains how to set up monitoring for the install-chromium.sh script using Supabase to track installation success rates and debug issues on client machines.
- Go to supabase.com and create a new project
- Note your project URL and anon key from Settings > API
Run this SQL in your Supabase SQL editor:
-- Create installation reports table
CREATE TABLE installation_reports (
id BIGSERIAL PRIMARY KEY,
timestamp TIMESTAMPTZ NOT NULL DEFAULT NOW(),
status TEXT NOT NULL,
os_info TEXT,
python_version TEXT,
python_path TEXT,
script_version TEXT DEFAULT '1.0.0',
install_method TEXT DEFAULT 'curl_script',
created_at TIMESTAMPTZ DEFAULT NOW()
);
-- Create index for faster queries
CREATE INDEX idx_installation_reports_timestamp ON installation_reports(timestamp);
CREATE INDEX idx_installation_reports_status ON installation_reports(status);
-- Enable Row Level Security (RLS)
ALTER TABLE installation_reports ENABLE ROW LEVEL SECURITY;
-- Allow inserts from anyone (for anonymous reporting)
CREATE POLICY "Allow anonymous inserts" ON installation_reports
FOR INSERT TO anon
WITH CHECK (true);
-- Allow reads only for authenticated users
CREATE POLICY "Allow authenticated reads" ON installation_reports
FOR SELECT TO authenticated
USING (true);Replace the placeholder values in install-chromium.sh:
# Replace these lines in the script:
REPORTING_ENDPOINT="${SUPABASE_URL:-https://your-project.supabase.co}/rest/v1/installation_reports"
REPORTING_API_KEY="${SUPABASE_KEY:-your-anon-key}"
# With your actual values:
REPORTING_ENDPOINT="${SUPABASE_URL:-https://xyzabc.supabase.co}/rest/v1/installation_reports"
REPORTING_API_KEY="${SUPABASE_KEY:-eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...}"Run the script with your Supabase credentials:
SUPABASE_URL="https://your-project.supabase.co" \
SUPABASE_KEY="your-anon-key-here" \
curl -fsSL https://raw.githubusercontent.com/your-username/your-repo/main/install-chromium.sh | bash# Skip reporting entirely
SKIP_REPORTING=1 curl -fsSL ... | bash
# Skip the demo but still report installation success
SKIP_DEMO=1 curl -fsSL ... | bash
# Force Python 3.11 installation
FORCE_PYTHON311=1 curl -fsSL ... | bash
# Custom Supabase configuration
SUPABASE_URL="https://custom.supabase.co" \
SUPABASE_KEY="custom-key" \
curl -fsSL ... | bashThe script sends these status values:
success- Full installation and demo completed successfullysuccess_no_demo- Installation succeeded, demo was skippedexample_failed- Installation succeeded but demo failedfailed- Installation failed
-- Installation success rate (last 24 hours)
SELECT
status,
COUNT(*) as count,
ROUND(COUNT(*) * 100.0 / SUM(COUNT(*)) OVER (), 2) as percentage
FROM installation_reports
WHERE timestamp > NOW() - INTERVAL '24 hours'
GROUP BY status
ORDER BY count DESC;
-- Installations by OS (last 7 days)
SELECT
CASE
WHEN os_info LIKE '%Darwin%' THEN 'macOS'
WHEN os_info LIKE '%Linux%' THEN 'Linux'
WHEN os_info LIKE '%Ubuntu%' THEN 'Ubuntu'
ELSE 'Other'
END as os_type,
COUNT(*) as installations
FROM installation_reports
WHERE timestamp > NOW() - INTERVAL '7 days'
GROUP BY os_type
ORDER BY installations DESC;
-- Python version distribution
SELECT
python_version,
COUNT(*) as count
FROM installation_reports
WHERE timestamp > NOW() - INTERVAL '7 days'
GROUP BY python_version
ORDER BY count DESC;
-- Recent failed installations
SELECT
timestamp,
os_info,
python_version,
status
FROM installation_reports
WHERE status = 'failed'
ORDER BY timestamp DESC
LIMIT 10;Create views for easier dashboard creation:
-- Daily installation stats
CREATE VIEW daily_installation_stats AS
SELECT
DATE(timestamp) as date,
COUNT(*) as total_installations,
COUNT(CASE WHEN status = 'success' THEN 1 END) as successful,
COUNT(CASE WHEN status = 'failed' THEN 1 END) as failed,
ROUND(
COUNT(CASE WHEN status = 'success' THEN 1 END) * 100.0 / COUNT(*),
2
) as success_rate
FROM installation_reports
GROUP BY DATE(timestamp)
ORDER BY date DESC;The script collects only technical information needed for debugging:
- Timestamp of installation
- Installation status (success/failed)
- OS information (
uname -aoutput) - Python version
- Python executable path
- Script version
The script does NOT collect:
- ❌ User names or personal information
- ❌ File contents or directory listings
- ❌ Network information
- ❌ Browser history or personal data
- ❌ API keys or credentials
Installation logs are also saved locally to ~/.rebrowse_install.log for user debugging.
-
No reports appearing in Supabase
- Check your project URL and API key
- Verify the table exists and has the correct schema
- Check RLS policies allow anonymous inserts
-
Installation succeeds but no report sent
- Check internet connectivity during installation
- Verify curl is available on the system
- Reports are sent in background and won't block installation
-
Custom endpoint not working
- Ensure your custom endpoint accepts the same JSON schema
- Check CORS settings if using a different service
Add debug logging to the script:
# Add this after the "set -e" line for verbose output
set -x # Enable debug modeIf you don't want to use Supabase, you can:
- Use any REST API - Modify the
send_installation_reportfunction - Use webhooks - Send to Discord, Slack, or webhook services
- Use log aggregation - Ship logs to Datadog, Splunk, etc.
- Disable completely - Set
SKIP_REPORTING=1
The reporting is designed to be:
- ✅ Non-blocking (won't fail installation)
- ✅ Privacy-focused (no personal data)
- ✅ Configurable (easy to disable/customize)
- ✅ Lightweight (minimal overhead)