Private tool made to automate staff clocks around work.
- Python 97.8%
- Shell 1.2%
- Dockerfile 1%
Major refactor from monolithic main.py to clean MVC architecture with proper separation of concerns (core/, models/, controllers/, services/, views/). Fixes all critical and high-severity issues from security audit: - Fix backup data corruption (wrong dict key extraction) - Hash PINs with SHA-256, force first-run setup, mask input fields - Add rate limiting (5 attempts → 30s lockout) for admin access - Atomic settings writes via tempfile + os.replace - Add settings schema validation and JSON type checking - Fix all resource leaks (SQLite connections use try/finally) - Add thread lock on shared break state in ClockController - Use socket context manager in printer connection test - Add PRAGMA table name whitelist to prevent SQL injection - Replace bare except clauses with specific exception types - Add path traversal protection for archive deletion - Remove sensitive files from git tracking (db, logs, settings) - Add .dockerignore, .env.example for Docker secrets - Upgrade Docker to Python 3.13, remove passwordless sudo - Add resource limits and localhost-only ports in docker-compose - Pin dependency versions, remove unused packages - Remove duplicate timesheetDailyCheck.py - Clean emoji characters from log messages Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| staffclock | ||
| .dockerignore | ||
| .DS_Store | ||
| .env.example | ||
| .gitignore | ||
| docker-compose.yml | ||
| docker-entrypoint.sh | ||
| Dockerfile | ||
| README.md | ||
| requirements.txt | ||
| test_fixes.py | ||
Staff Digital Timesheet System
A comprehensive staff clock-in/clock-out system with fingerprint authentication, timesheet management, and visitor tracking.
Features
- Digital Clock In/Out: Staff can clock in and out using staff codes or fingerprints (continuous scanning)
- Fingerprint Authentication: DigitalPersona U.are.U 4500 integration with user-friendly enrollment
- Admin Panel: Complete staff management, record editing, and system administration
- Timesheet Generation: Automated PDF timesheet generation with customizable scheduling
- Visitor Management: Track and manage visitor entries and exits
- Archive System: Database archiving and backup functionality
- Real-time Backup: Continuous data protection with automatic backups
Quick Start
-
Install Dependencies:
pip install -r requirements.txt -
Run the Application:
python main.py -
Initial Setup:
- Connect DigitalPersona fingerprint scanner (optional)
- Access Admin Panel (default PIN: 1234)
- Add staff members
- Enroll fingerprints for enhanced security
System Requirements
- Windows 10/11
- Python 3.13+
- DigitalPersona U.are.U 4500 fingerprint scanner (optional)
- PyQt6
Key Components
main.py- Main application with integrated enrollment UIfingerprint_manager.py- Fingerprint device managementdigitalpersona_sdk_simple.py- DigitalPersona SDK interfacebiometric_enrollment.py- Biometric profile management
Database
The system uses SQLite databases:
staff_timesheet.db- Main operational databasebiometric_profiles.db- Fingerprint templates and profiles- Archive databases in
Archive_Databases/folder
License
Proprietary software for internal use.
Running the Application
For Windows:
Double-click on run_staffclock.bat.
For macOS/Linux:
- Open a terminal.
- Make the script executable:
chmod +x run_staffclock.sh - Run the script:
./run_staffclock.sh