A secure, web-based deadman switch service that automatically sends pre-configured emails to designated recipients if you fail to check in within a specified time period.
- π Secure Authentication - JWT-based user authentication with password hashing
- π§ Email Integration - Supports Gmail SMTP and custom SMTP servers
- β° Flexible Timers - Configurable check-in intervals and inactivity periods
- π One-Click Check-ins - Simple email links to reset the deadman timer
- π± Real-time Dashboard - Live countdown timers and status monitoring
- π§Ή Complete Data Lifecycle - Automatic cleanup after activation
- βοΈ Flexible Intervals - Configurable check-in and deadman timer periods
- Configure: Set up your check-in frequency and inactivity timeout
- Add Recipients: Configure emails to be sent if deadman activates
- Activate: Start the deadman switch with real-time monitoring
- Check-in: Click links in periodic check-in emails to stay active
- Automatic Trigger: If you don't check in, recipient emails are sent automatically
- Node.js (v16 or higher)
- Gmail account with App Password OR SMTP server access
-
Clone the repository
git clone https://github.com/ericscalibur/Deploy-Deadman-Switch.git cd Deploy-Deadman-Switch -
Install dependencies
npm install
-
Generate environment configuration
python3 generate_secret.py
Follow the prompts to create a
.envfile with secure JWT keys. -
Configure email settings Edit the
.envfile with your email credentials:SECRET_KEY=your-generated-secret-key EMAIL_USER=your-email@gmail.com EMAIL_PASS=your-app-password APP_URL=http://localhost:3000 PORT=3000
-
Start the server
node server.js
-
Open the application Navigate to
http://localhost:3000
The SECRET_KEY is used to sign JWT tokens for user authentication. It must be a secure, random string.
Important: Never share or commit your SECRET_KEY to version control!
-
Generate automatically (recommended):
python3 generate_secret.py
This creates a
.envfile with a cryptographically secure 64-character key. -
Generate manually (alternative):
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"Copy the output to your
.envfile asSECRET_KEY=your-generated-key
- Enable 2-factor authentication on your Google account
- Generate an App Password: Google Account β Security β App Passwords
- Use your Gmail address as
EMAIL_USERand the app password asEMAIL_PASS
SMTP_HOST=smtp.your-provider.com
SMTP_PORT=587
SMTP_USER=your-smtp-username
SMTP_PASS=your-smtp-password- Check-in Intervals: 1 minute to 2 weeks
- Deadman Timer: 3 minutes to 9 months
POST /auth/signup- Create new user accountPOST /auth/login- User loginPOST /auth/forgot-password- Password reset (planned)
POST /deadman/emails- Configure recipient emailsGET /deadman/emails- Retrieve configured emailsPOST /deadman/activate- Activate deadman switchPOST /deadman/deactivate- Deactivate deadman switchGET /deadman/timer-status- Get current timer statusGET /deadman/checkin/:token- Process check-in from email link
GET /deadman/debug/status- System status
Deploy/
βββ server.js # Main server application
βββ package.json # Dependencies and scripts
βββ generate_secret.py # Environment setup utility
βββ .env # Environment configuration (excluded from git)
βββ .gitignore # Git ignore rules
βββ models/
β βββ user.js # User data management
βββ routes/
β βββ auth.js # Authentication routes
β βββ deadman-minimal.js # Core deadman switch functionality
βββ utils/
β βββ emailService.js # Email sending service
βββ public/
β βββ index.html # Main web interface
β βββ edit-email.html # Email configuration page
β βββ script.js # Frontend JavaScript
β βββ styles.css # Application styling
βββ data/ # User data storage (auto-created)
- Password Hashing: PBKDF2 with salt for secure password storage
- JWT Authentication: Secure token-based session management
- Environment Variables: Sensitive configuration kept in
.envfile - Data Isolation: User data stored in separate files
- Token Expiration: Check-in tokens are single-use and cleaned up
Monitor backend state during development:
// Check email count
fetch('/deadman/debug/status').then(r=>r.json()).then(d=>console.log('π Backend Email Count:', d.userEmailsCount))
// Full status
fetch('/deadman/debug/status').then(r=>r.json()).then(console.log)- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
This software is provided as-is for educational and personal use. Users are responsible for:
- Securing their email credentials
- Testing the system before relying on it
- Understanding local laws regarding automated communications
- Maintaining backup communication methods
For issues, questions, or contributions:
- Open an issue on GitHub
- Check existing documentation
- Review the codebase for implementation details