mirror of
https://github.com/DRYTRIX/TimeTracker.git
synced 2026-01-06 03:30:25 -06:00
feat: add time-entry editing; improve invoices/PDF; harden Docker startup
Timer/Editing - Add/edit time-entry UI and flows in templates (`templates/timer/*`) - Extend timer and API routes (`app/routes/timer.py`, `app/routes/api.py`) - Update mobile interactions (`app/static/mobile.js`) Invoices/PDF - Improve invoice model and route handling (`app/models/invoice.py`, `app/routes/invoices.py`) - Enhance PDF generation and fallback logic (`app/utils/pdf_generator*.py`) - Adjust invoice view layout (`templates/invoices/view.html`) Docker/Startup - Refine Docker build and startup paths (`Dockerfile`) - Improve init/entrypoint scripts (`docker/init-database-*.py`, new `docker/entrypoint*.sh`, `docker/entrypoint.py`) - General startup robustness and permissions fixes Docs/UI - Refresh README and Docker docs (setup, troubleshooting, structure) - Minor UI/help updates (`templates/main/help.html`, `templates/projects/create.html`) - Remove obsolete asset (`assets/screenshots/Task_Management.png`) - Add repo hygiene updates (e.g., `.gitattributes`)
This commit is contained in:
@@ -130,7 +130,7 @@ existing governing policies.
|
||||
|
||||
* [Contributing Guidelines](CONTRIBUTING.md)
|
||||
* [Project Documentation](README.md)
|
||||
* [Community Guidelines](https://github.com/yourusername/TimeTracker/discussions)
|
||||
* [Community Guidelines](https://github.com/drytrix/TimeTracker/discussions)
|
||||
|
||||
## License
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ This project and everyone participating in it is governed by our [Code of Conduc
|
||||
|
||||
1. Clone the repository:
|
||||
```bash
|
||||
git clone https://github.com/yourusername/TimeTracker.git
|
||||
git clone https://github.com/drytrix/TimeTracker.git
|
||||
cd TimeTracker
|
||||
```
|
||||
|
||||
|
||||
@@ -24,16 +24,17 @@ This guide explains how to set up and use the public Docker image for TimeTracke
|
||||
|
||||
**Linux/macOS:**
|
||||
```bash
|
||||
git clone https://github.com/yourusername/TimeTracker.git
|
||||
git clone https://github.com/drytrix/TimeTracker.git
|
||||
cd TimeTracker
|
||||
./deploy-public.sh
|
||||
# Remote production image (latest)
|
||||
docker-compose -f docker-compose.remote.yml up -d
|
||||
```
|
||||
|
||||
**Windows:**
|
||||
```cmd
|
||||
git clone https://github.com/yourusername/TimeTracker.git
|
||||
git clone https://github.com/drytrix/TimeTracker.git
|
||||
cd TimeTracker
|
||||
deploy-public.bat
|
||||
docker-compose -f docker-compose.remote.yml up -d
|
||||
```
|
||||
|
||||
#### Option B: Manual Deployment
|
||||
@@ -44,10 +45,7 @@ deploy-public.bat
|
||||
cd TimeTracker
|
||||
```
|
||||
|
||||
2. **Set your GitHub repository:**
|
||||
```bash
|
||||
export GITHUB_REPOSITORY="yourusername/timetracker"
|
||||
```
|
||||
2. (Optional) **Use a specific version tag:** set the tag in `docker-compose.remote.yml`.
|
||||
|
||||
3. **Create environment file:**
|
||||
```bash
|
||||
@@ -57,8 +55,8 @@ deploy-public.bat
|
||||
|
||||
4. **Pull and run the image:**
|
||||
```bash
|
||||
docker pull ghcr.io/$GITHUB_REPOSITORY:latest
|
||||
docker-compose -f docker-compose.public.yml up -d
|
||||
docker pull ghcr.io/drytrix/timetracker:latest
|
||||
docker-compose -f docker-compose.remote.yml up -d
|
||||
```
|
||||
|
||||
## 🔧 Configuration
|
||||
@@ -86,11 +84,11 @@ DATABASE_URL=postgresql+psycopg2://timetracker:timetracker@db:5432/timetracker
|
||||
|
||||
### Docker Compose Configuration
|
||||
|
||||
The `docker-compose.public.yml` file includes:
|
||||
Use `docker-compose.remote.yml` (production) or `docker-compose.remote-dev.yml` (testing):
|
||||
|
||||
- **TimeTracker App**: Main application container
|
||||
- **PostgreSQL Database**: Persistent data storage
|
||||
- **Caddy Reverse Proxy**: Optional HTTPS support
|
||||
- **App**: `ghcr.io/drytrix/timetracker` image
|
||||
- **PostgreSQL**: Database service with healthcheck
|
||||
- **Ports**: App exposed on 8080 by default
|
||||
|
||||
## 📦 Available Images
|
||||
|
||||
@@ -114,10 +112,10 @@ The public image is automatically updated when you push to the main branch. To u
|
||||
|
||||
```bash
|
||||
# Pull the latest image
|
||||
docker pull ghcr.io/yourusername/timetracker:latest
|
||||
docker pull ghcr.io/drytrix/timetracker:latest
|
||||
|
||||
# Restart the containers
|
||||
docker-compose -f docker-compose.public.yml up -d
|
||||
docker-compose -f docker-compose.remote.yml up -d
|
||||
```
|
||||
|
||||
### Manual Updates
|
||||
@@ -126,11 +124,11 @@ For specific versions:
|
||||
|
||||
```bash
|
||||
# Pull a specific version
|
||||
docker pull ghcr.io/yourusername/timetracker:v1.0.0
|
||||
docker pull ghcr.io/drytrix/timetracker:v1.0.0
|
||||
|
||||
# Update docker-compose.public.yml to use the specific tag
|
||||
# Update docker-compose.remote.yml to use the specific tag
|
||||
# Then restart
|
||||
docker-compose -f docker-compose.public.yml up -d
|
||||
docker-compose -f docker-compose.remote.yml up -d
|
||||
```
|
||||
|
||||
## 🛠️ Troubleshooting
|
||||
@@ -168,23 +166,23 @@ docker-compose -f docker-compose.public.yml up -d
|
||||
|
||||
```bash
|
||||
# List available images
|
||||
docker images ghcr.io/yourusername/timetracker
|
||||
docker images ghcr.io/drytrix/timetracker
|
||||
|
||||
# Inspect image details
|
||||
docker inspect ghcr.io/yourusername/timetracker:latest
|
||||
docker inspect ghcr.io/drytrix/timetracker:latest
|
||||
```
|
||||
|
||||
#### View Logs
|
||||
|
||||
```bash
|
||||
# Application logs
|
||||
docker-compose -f docker-compose.public.yml logs app
|
||||
docker-compose -f docker-compose.remote.yml logs app
|
||||
|
||||
# Database logs
|
||||
docker-compose -f docker-compose.public.yml logs db
|
||||
docker-compose -f docker-compose.remote.yml logs db
|
||||
|
||||
# All logs
|
||||
docker-compose -f docker-compose.public.yml logs -f
|
||||
docker-compose -f docker-compose.remote.yml logs -f
|
||||
```
|
||||
|
||||
#### Health Check
|
||||
@@ -194,7 +192,7 @@ docker-compose -f docker-compose.public.yml logs -f
|
||||
curl http://localhost:8080/_health
|
||||
|
||||
# Check container status
|
||||
docker-compose -f docker-compose.public.yml ps
|
||||
docker-compose -f docker-compose.remote.yml ps
|
||||
```
|
||||
|
||||
## 🔒 Security Considerations
|
||||
@@ -240,10 +238,10 @@ docker ps --format "table {{.Names}}\t{{.Status}}"
|
||||
|
||||
```bash
|
||||
# Follow application logs
|
||||
docker-compose -f docker-compose.public.yml logs -f app
|
||||
docker-compose -f docker-compose.remote.yml logs -f app
|
||||
|
||||
# Export logs for analysis
|
||||
docker-compose -f docker-compose.public.yml logs app > timetracker.log
|
||||
docker-compose -f docker-compose.remote.yml logs app > timetracker.log
|
||||
```
|
||||
|
||||
## 🚀 Production Deployment
|
||||
@@ -263,7 +261,7 @@ docker-compose -f docker-compose.public.yml logs app > timetracker.log
|
||||
version: '3.8'
|
||||
services:
|
||||
app:
|
||||
image: ghcr.io/yourusername/timetracker:v1.0.0
|
||||
image: ghcr.io/drytrix/timetracker:v1.0.0
|
||||
environment:
|
||||
- SECRET_KEY=${SECRET_KEY}
|
||||
- ADMIN_USERNAMES=${ADMIN_USERNAMES}
|
||||
|
||||
@@ -13,14 +13,17 @@ This error typically occurs due to one of these issues:
|
||||
|
||||
## Solutions
|
||||
|
||||
### Solution 1: Use the Fixed Dockerfile (Recommended)
|
||||
### Solution 1: Use the Remote Compose (Recommended)
|
||||
```bash
|
||||
# Use the fixed Dockerfile that addresses all issues
|
||||
docker-compose -f docker-compose.fixed.yml up --build
|
||||
# Use the production remote compose with prebuilt image
|
||||
docker-compose -f docker-compose.remote.yml up -d
|
||||
```
|
||||
|
||||
### Solution 2: Fix the Original Dockerfile
|
||||
The original Dockerfile has been updated to use `start-new.sh` instead of `start-fixed.sh`.
|
||||
### Solution 2: Rebuild Locally
|
||||
The provided `Dockerfile` supports local builds. If you prefer rebuilding:
|
||||
```bash
|
||||
docker-compose up --build -d
|
||||
```
|
||||
|
||||
### Solution 3: Manual Fix
|
||||
If you want to fix it manually:
|
||||
@@ -69,18 +72,18 @@ docker-compose build --no-cache
|
||||
```
|
||||
|
||||
## File Structure
|
||||
- `Dockerfile.fixed` - Fixed version addressing all issues
|
||||
- `docker-compose.fixed.yml` - Uses the fixed Dockerfile
|
||||
- `Dockerfile` - Container build file
|
||||
- `docker/start.sh` - Startup wrapper
|
||||
- `docker/start-simple.sh` - Simple, reliable startup script
|
||||
- `docker/start-new.sh` - Enhanced startup script with schema fixes
|
||||
- `docker/start-fixed.sh` - Enhanced startup script with schema fixes
|
||||
|
||||
## Quick Test
|
||||
```bash
|
||||
# Test with the fixed version
|
||||
docker-compose -f docker-compose.fixed.yml up --build
|
||||
# Test remote production image
|
||||
docker-compose -f docker-compose.remote.yml up -d
|
||||
|
||||
# Or test with the original (after fixes)
|
||||
docker-compose up --build
|
||||
# Or build locally
|
||||
docker-compose up --build -d
|
||||
```
|
||||
|
||||
## Common Issues and Fixes
|
||||
|
||||
@@ -14,9 +14,10 @@ TimeTracker/
|
||||
├── 📁 .github/ # GitHub workflows and configurations
|
||||
├── 📁 logs/ # Application logs (with .gitkeep)
|
||||
├── 🐳 Dockerfile # Main Dockerfile
|
||||
├── 🐳 Dockerfile.simple # Simple container Dockerfile
|
||||
├── 📄 docker-compose.simple.yml # Simple container setup
|
||||
├── 📄 docker-compose.public.yml # Public container setup
|
||||
├── 🐳 Dockerfile # Main Dockerfile
|
||||
├── 📄 docker-compose.yml # Local development compose
|
||||
├── 📄 docker-compose.remote.yml # Remote/production compose (ghcr.io)
|
||||
├── 📄 docker-compose.remote-dev.yml # Remote dev/testing compose (ghcr.io)
|
||||
├── 📄 requirements.txt # Python dependencies
|
||||
├── 📄 app.py # Application entry point
|
||||
├── 📄 env.example # Environment variables template
|
||||
@@ -80,17 +81,20 @@ TimeTracker/
|
||||
|
||||
## 🚀 Deployment Options
|
||||
|
||||
### 1. Simple Container (Recommended)
|
||||
- **File**: `docker-compose.simple.yml`
|
||||
- **Dockerfile**: `Dockerfile.simple`
|
||||
- **Features**: All-in-one with PostgreSQL database
|
||||
### 1. Local Development
|
||||
- **File**: `docker-compose.yml`
|
||||
- **Image**: Built from local source
|
||||
- **Use case**: Developer workstation
|
||||
|
||||
### 2. Remote/Production
|
||||
- **File**: `docker-compose.remote.yml`
|
||||
- **Image**: `ghcr.io/drytrix/timetracker:latest` (or versioned tag)
|
||||
- **Use case**: Production deployment
|
||||
|
||||
### 2. Public Container
|
||||
- **File**: `docker-compose.public.yml`
|
||||
- **Dockerfile**: `Dockerfile`
|
||||
- **Features**: External database configuration
|
||||
- **Use case**: Development and testing
|
||||
### 3. Remote Dev/Testing
|
||||
- **File**: `docker-compose.remote-dev.yml`
|
||||
- **Image**: `ghcr.io/drytrix/timetracker:development`
|
||||
- **Use case**: Pre-release testing
|
||||
|
||||
## 📚 Documentation Files
|
||||
|
||||
@@ -135,9 +139,9 @@ The Task Management feature is fully integrated into the application with automa
|
||||
|
||||
## 🎯 Getting Started
|
||||
|
||||
1. **Choose deployment type**: Simple container (recommended) or public container
|
||||
1. **Choose deployment type**: Local dev, remote, or remote-dev
|
||||
2. **Follow README.md**: Complete setup instructions
|
||||
3. **Use appropriate compose file**: `docker-compose.simple.yml` or `docker-compose.public.yml`
|
||||
3. **Use appropriate compose file**: `docker-compose.yml`, `docker-compose.remote.yml`, or `docker-compose.remote-dev.yml`
|
||||
4. **Configure timezone**: Access admin settings to set your local timezone
|
||||
|
||||
## 🔍 File Purposes
|
||||
|
||||
@@ -20,7 +20,7 @@ Welcome to the TimeTracker documentation. This directory contains comprehensive
|
||||
- **[INVOICE_FEATURE_README.md](INVOICE_FEATURE_README.md)** - Invoice system documentation
|
||||
- **[ENHANCED_INVOICE_SYSTEM_README.md](ENHANCED_INVOICE_SYSTEM_README.md)** - Advanced invoice features
|
||||
- **[INVOICE_INTERFACE_IMPROVEMENTS.md](INVOICE_INTERFACE_IMPROVEMENTS.md)** - Invoice UI improvements
|
||||
- **[ANALYTICS_FEATURE.md](ANALYTICS_FEATURE.md)** - Analytics and reporting features
|
||||
- Analytics and reporting features (see the Reports section in the app)
|
||||
- **[MOBILE_IMPROVEMENTS.md](MOBILE_IMPROVEMENTS.md)** - Mobile interface enhancements
|
||||
|
||||
### 🛠️ Technical Details
|
||||
|
||||
Reference in New Issue
Block a user