From 8e3278be37d21f39bf94e4d29389207605502530 Mon Sep 17 00:00:00 2001 From: Eliezer Steinbock <3090527+elie222@users.noreply.github.com> Date: Wed, 26 Nov 2025 11:51:14 -0500 Subject: [PATCH 1/3] add cron for docker compose self-hosters --- docker-compose.yml | 20 ++++++++++++++++++++ version.txt | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 8e8729b16f..cd4ab0bfbd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -82,6 +82,26 @@ services: UPSTASH_REDIS_URL: ${UPSTASH_REDIS_URL:-http://serverless-redis-http:80} restart: always + cron: + image: alpine:latest + command: > + sh -c " + apk add --no-cache curl && + while true; do + echo \"[cron] Renewing email watches...\" && + curl -s -X GET 'http://web:3000/api/watch/all' -H \"Authorization: Bearer $${CRON_SECRET}\" && + echo \"[cron] Done. Sleeping for 6 hours...\" && + sleep 21600 + done + " + env_file: + - ./apps/web/.env + depends_on: + - web + networks: + - inbox-zero-network + restart: always + volumes: database-data: diff --git a/version.txt b/version.txt index 5de370062c..674f71074b 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -v2.20.28 +v2.20.29 From a09dfd801aee611f9cddf82b693e78b1d3ef18e6 Mon Sep 17 00:00:00 2001 From: Eliezer Steinbock <3090527+elie222@users.noreply.github.com> Date: Wed, 26 Nov 2025 11:51:32 -0500 Subject: [PATCH 2/3] readme --- docs/hosting/docker.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/hosting/docker.md b/docs/hosting/docker.md index cd87a9ddb8..3787b08baf 100644 --- a/docs/hosting/docker.md +++ b/docs/hosting/docker.md @@ -121,6 +121,18 @@ docker compose logs -f web docker compose logs -f db ``` +## Scheduled Tasks + +Gmail and Outlook push notification subscriptions expire periodically and must be renewed. The Docker Compose setup includes a `cron` container that handles this automatically. + +**If you're not using Docker Compose** (e.g., running directly, Kubernetes, etc.), you need to set up a cron job to call the watch renewal endpoint every 6 hours: + +```bash +0 */6 * * * curl -s -X GET "https://yourdomain.com/api/watch/all" -H "Authorization: Bearer YOUR_CRON_SECRET" +``` + +Replace `YOUR_CRON_SECRET` with the value of `CRON_SECRET` from your `.env` file. + ## Building from Source (Optional) If you prefer to build the image yourself instead of using the pre-built one: From 71beaab7993ab2135a16b4c7d5acda2f51688936 Mon Sep 17 00:00:00 2001 From: Eliezer Steinbock <3090527+elie222@users.noreply.github.com> Date: Wed, 26 Nov 2025 11:53:20 -0500 Subject: [PATCH 3/3] rename file --- README.md | 6 +++--- docs/hosting/aws-copilot.md | 2 +- docs/hosting/ec2-deployment.md | 2 +- docs/hosting/{docker.md => self-hosting.md} | 0 4 files changed, 5 insertions(+), 5 deletions(-) rename docs/hosting/{docker.md => self-hosting.md} (100%) diff --git a/README.md b/README.md index 86ddc5f58c..8e28611f97 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ We offer a hosted version of Inbox Zero at [https://getinboxzero.com](https://ge The easiest way to self-host Inbox Zero is using our pre-built Docker image. -See our **[Docker Self-Hosting Guide](docs/hosting/docker.md)** for complete instructions. +See our **[Self-Hosting Guide](docs/hosting/self-hosting.md)** for complete instructions. ### Local Development Setup @@ -303,7 +303,7 @@ To build and run the full stack (App + DB + Redis) locally in production mode us NEXT_PUBLIC_BASE_URL=http://localhost:3000 docker compose --profile all up --build ``` -For production deployments with external databases, see the [Docker Self-Hosting Guide](docs/hosting/docker.md). +For production deployments with external databases, see the [Self-Hosting Guide](docs/hosting/self-hosting.md). To run without Docker (local production build): @@ -376,7 +376,7 @@ For detailed instructions on: - Production configuration See our comprehensive guides: -- [Docker Self-Hosting Guide](docs/hosting/docker.md) +- [Self-Hosting Guide](docs/hosting/self-hosting.md) - [AWS EC2 Deployment Guide](docs/hosting/ec2-deployment.md) - [AWS Copilot Deployment Guide](docs/hosting/aws-copilot.md) diff --git a/docs/hosting/aws-copilot.md b/docs/hosting/aws-copilot.md index 1f57a0ac12..7702ec6216 100644 --- a/docs/hosting/aws-copilot.md +++ b/docs/hosting/aws-copilot.md @@ -182,5 +182,5 @@ If migrations fail: - [AWS Copilot Documentation](https://aws.github.io/copilot-cli/docs/) - [Copilot Manifest Reference](https://aws.github.io/copilot-cli/docs/manifest/overview/) -- [Docker Self-Hosting Guide](./docker.md) - For local Docker setup +- [Self-Hosting Guide](./self-hosting.md) - For local Docker setup diff --git a/docs/hosting/ec2-deployment.md b/docs/hosting/ec2-deployment.md index d8f223af39..32354e5f9d 100644 --- a/docs/hosting/ec2-deployment.md +++ b/docs/hosting/ec2-deployment.md @@ -133,4 +133,4 @@ You can also use nginx or any approach of your choice. ## 4. Deployment -Once your EC2 instance is set up with Docker, swap memory, and HTTPS, follow the deployment steps in the [Docker deployment guide](./docker.md). +Once your EC2 instance is set up with Docker, swap memory, and HTTPS, follow the deployment steps in the [Self-Hosting Guide](./self-hosting.md). diff --git a/docs/hosting/docker.md b/docs/hosting/self-hosting.md similarity index 100% rename from docs/hosting/docker.md rename to docs/hosting/self-hosting.md