Skip to content

humbalei/muy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

66 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”’ SECURITY IMPLEMENTATION

βœ… Implemented Security Features

1. Firebase Security Rules (firestore.rules)

  • All collections protected with read/write rules
  • User data isolated by userId
  • Admin-only write access for users collection
  • Default deny-all for unlisted collections

⚠️ IMPORTANT: Deploy these rules to Firebase Console:

# Install Firebase CLI (if not installed)
npm install -g firebase-tools

# Login to Firebase
firebase login

# Initialize Firebase (if not done)
firebase init firestore

# Deploy security rules
firebase deploy --only firestore:rules

Or manually:

  1. Go to Firebase Console
  2. Select project: assexp-8524b
  3. Navigate to Firestore Database β†’ Rules
  4. Copy content from firestore.rules and publish

2. Authentication & Session Management

  • βœ… Remember Me functionality with persistent login
  • βœ… Session stored in localStorage (persistent) or sessionStorage (temporary)
  • βœ… Auto-redirect to appropriate dashboard (admin/assistant)
  • βœ… Secure logout clears all session data

Session Storage:

  • localStorage.teamUser - User data (when Remember Me is checked)
  • localStorage.teamRememberMe - Remember Me preference
  • localStorage.teamLoginTime - Login timestamp
  • sessionStorage.teamUser - Temporary session (when Remember Me unchecked)

3. Progressive Web App (PWA)

  • βœ… Installable on iPhone/Android home screen
  • βœ… Standalone mode (opens like native app, no browser UI)
  • βœ… Service Worker for offline caching
  • βœ… Custom splash screen and icons
  • βœ… Persistent login when launched from home screen

How to Install on iPhone:

  1. Open https://assexp.pages.dev in Safari
  2. Tap Share button (square with arrow)
  3. Scroll down and tap "Add to Home Screen"
  4. Tap "Add" in top right
  5. App icon appears on home screen
  6. Launch from home screen - opens in standalone mode!

Features:

  • App stays logged in (with Remember Me)
  • No browser address bar
  • Full screen experience
  • Offline support (cached pages)
  • Fast loading

4. Security Headers (_headers)

Deployed via Cloudflare Pages:

  • X-Frame-Options: DENY - Prevents clickjacking
  • X-Content-Type-Options: nosniff - Prevents MIME sniffing
  • X-XSS-Protection: Enabled - XSS filter active
  • Referrer-Policy: strict-origin-when-cross-origin
  • Strict-Transport-Security: HTTPS enforcement
  • Content-Security-Policy: Prevents XSS and injection attacks
  • Permissions-Policy: Blocks unnecessary browser features

5. Privacy Protection

  • βœ… robots.txt blocks search engine indexing
  • βœ… No public access without login
  • βœ… API keys protected (client-side validation)

⚠️ API Keys Security

Current Status:

  • Firebase config is PUBLIC (normal for web apps)
  • LLM, Telegram, ElevenLabs keys are in js/config.js (client-accessible)

Recommendations:

Option A: Keep Current Setup (Simple, Less Secure)

βœ… Works fine for private team app βœ… Firebase rules protect data access ⚠️ API keys can be extracted from client ⚠️ Rate limiting via API provider settings

Option B: Move to Backend (Most Secure)

Implement Cloudflare Workers for:

  • LLM API calls
  • Telegram notifications
  • ElevenLabs voice generation

Steps:

  1. Create Cloudflare Worker endpoints
  2. Store API keys as Worker secrets
  3. Client calls Worker, Worker calls external APIs
  4. Keys never exposed to client

πŸ§ͺ Testing Checklist

Basic Security:

  • Try accessing admin.html without login β†’ redirected to index.html
  • Try accessing assistant.html without login β†’ redirected to index.html
  • Login with wrong password β†’ error message
  • Login with Remember Me checked β†’ stays logged in after browser restart
  • Login without Remember Me β†’ logged out after browser restart
  • Logout β†’ session cleared, redirected to login

PWA Testing (iPhone):

  • Install app to home screen
  • Launch app from home screen β†’ opens in standalone mode (no Safari UI)
  • App stays logged in between launches
  • Close and reopen β†’ still logged in (with Remember Me)
  • Logout and reopen β†’ shows login screen

Offline Testing:

  • Open app while online
  • Turn off WiFi/data
  • Navigate between cached pages β†’ works
  • Try to login offline β†’ fails (needs network)
  • Turn WiFi back on β†’ login works

Firebase Rules:

  • User can only read/write their own data
  • Cannot access other users' collections
  • Cannot modify users collection

πŸš€ Deployment

Current Deployment:

Deploy Command:

cd /Users/perignon/Desktop/mori-team-app
git add -A
git commit -m "your commit message"
npx wrangler pages deploy . --project-name=assexp --commit-dirty=true

πŸ“± Mobile App Experience

Before (Browser):

  • URL bar visible
  • Browser controls
  • "Website" feel
  • Logs out between sessions

After (PWA):

  • Full screen
  • No browser UI
  • Native app feel
  • Stays logged in
  • Faster loading
  • Offline support

πŸ” Best Practices

  1. Never commit real API keys to Git

    • Current keys should be rotated if repo becomes public
    • Use environment variables for production
  2. Regular Security Audits

    • Check Firebase rules monthly
    • Review access logs
    • Update dependencies
  3. User Management

    • Change passwords via Firebase Console
    • Deactivate users by deleting from users collection
    • Monitor login activity
  4. Backup Strategy

    • Export Firestore data monthly
    • Keep backup of configuration files
    • Document custom Firebase rules

πŸ“ž Emergency Procedures

If API Keys Compromised:

  1. Rotate all API keys immediately:

    • Firebase: Generate new config
    • OpenRouter: Regenerate key
    • Telegram: Create new bot via @BotFather
    • ElevenLabs: Generate new API key
  2. Update js/config.js with new keys

  3. Deploy immediately

  4. Check for unauthorized usage in API dashboards

If Data Breach:

  1. Immediately update Firebase Security Rules to deny all
  2. Export all data for forensics
  3. Reset all user passwords
  4. Investigate access logs
  5. Restore from backup if needed

🎯 Future Security Enhancements

  1. Two-Factor Authentication (2FA)
  2. IP Whitelisting via Cloudflare
  3. Audit Logging (track all data changes)
  4. Encrypted Field Storage (for sensitive data)
  5. Session Timeout (auto-logout after inactivity)
  6. Rate Limiting (prevent brute force attacks)
  7. Backend API Gateway (hide all API keys)

Last Updated: 2026-02-04 Security Level: 🟒 PROTECTED

About

ExifTool Video Spoofer

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors