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/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/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 89% rename from docs/hosting/docker.md rename to docs/hosting/self-hosting.md index cd87a9ddb8..3787b08baf 100644 --- a/docs/hosting/docker.md +++ b/docs/hosting/self-hosting.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: 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