Automate TimeWatch time reporting - available as a Slack Bot or standalone Docker container.
- Automatically fills incomplete timewatch entries
- Supports multiple users
- Can run as a Slack Bot or standalone script
- Docker support for Google Cloud Run deployment
# Build the image
docker build -t timewatch-filler .
# Run with single user
docker run \
-e TIMEWATCH_COMPANY=11447 \
-e TIMEWATCH_USERNAME=5 \
-e TIMEWATCH_PASSWORD=your_password \
timewatch-filler
# Run with multiple users
docker run \
-e 'TIMEWATCH_USERS=[{"company":"11447","username":"5","password":"pass1"},{"company":"11447","username":"6","password":"pass2"}]' \
timewatch-filler# Install dependencies
pip install -r requirements.txt
# Set environment variables and run
TIMEWATCH_COMPANY=11447 TIMEWATCH_USERNAME=5 TIMEWATCH_PASSWORD=your_password python main_time.pySingle user (legacy format):
TIMEWATCH_COMPANY=11447
TIMEWATCH_USERNAME=5
TIMEWATCH_PASSWORD=your_passwordMultiple users (JSON array):
TIMEWATCH_USERS='[
{"company": "11447", "username": "5", "password": "pass1"},
{"company": "11447", "username": "6", "password": "pass2"}
]'Month selection:
# Fill current month (default: false = fill previous month)
TIMEWATCH_FILL_CURRENT_MONTH=trueCreate a .env file in the project root:
TIMEWATCH_COMPANY=11447
TIMEWATCH_USERNAME=5
TIMEWATCH_PASSWORD=your_password
Then run:
python main_time.pygcloud builds submit --tag gcr.io/YOUR_PROJECT_ID/timewatch-fillergcloud run deploy timewatch-filler \
--image gcr.io/YOUR_PROJECT_ID/timewatch-filler \
--platform managed \
--region us-central1 \
--no-allow-unauthenticated \
--set-env-vars 'TIMEWATCH_USERS=[{"company":"11447","username":"5","password":"your_password"}]'# Create a service account
gcloud iam service-accounts create timewatch-scheduler
# Grant permission to invoke Cloud Run
gcloud run services add-iam-policy-binding timewatch-filler \
--member=serviceAccount:timewatch-scheduler@YOUR_PROJECT_ID.iam.gserviceaccount.com \
--role=roles/run.invoker
# Create scheduler job (runs daily at 9 AM)
gcloud scheduler jobs create http timewatch-daily \
--schedule="0 9 * * *" \
--uri="YOUR_CLOUD_RUN_URL" \
--oidc-service-account-email=timewatch-scheduler@YOUR_PROJECT_ID.iam.gserviceaccount.com# Login to ghcr.io
echo YOUR_GITHUB_TOKEN | docker login ghcr.io -u YOUR_GITHUB_USERNAME --password-stdin
# Build and tag
docker build -t ghcr.io/YOUR_GITHUB_USERNAME/timewatch-filler:latest .
# Push
docker push ghcr.io/YOUR_GITHUB_USERNAME/timewatch-filler:latestIf you wish to use the Slack Bot integration:
-
Change the company code in
time_bolt.py:tw_return = main_time.some_func('YOUR_COMPANY_CODE', username, password)
-
Follow the Slack Bolt setup guide: https://slack.dev/bolt-python/tutorial/getting-started
This project is forked from timewatch_slack_filler by tobenary.
MIT