{"id":17280399,"url":"https://github.com/umputun/proxy-cron","last_synced_at":"2025-03-22T18:34:37.934Z","repository":{"id":221601833,"uuid":"754839673","full_name":"umputun/proxy-cron","owner":"umputun","description":"A simple proxy with crontab scheduling","archived":false,"fork":false,"pushed_at":"2024-08-03T18:12:33.000Z","size":1735,"stargazers_count":14,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-16T09:20:33.010Z","etag":null,"topics":["crontab","http","proxy","proxy-server"],"latest_commit_sha":null,"homepage":"https://proxy-cron.umputun.dev","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/umputun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["umputun"]}},"created_at":"2024-02-08T21:28:55.000Z","updated_at":"2024-08-03T18:12:32.000Z","dependencies_parsed_at":"2024-02-09T00:15:19.421Z","dependency_job_id":"379b4892-698d-4ea6-961a-e9df88832f32","html_url":"https://github.com/umputun/proxy-cron","commit_stats":{"total_commits":33,"total_committers":3,"mean_commits":11.0,"dds":0.1515151515151515,"last_synced_commit":"85d6f338cccc061a27994b7c9a71f81db4662a53"},"previous_names":["umputun/proxy-cron"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umputun%2Fproxy-cron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umputun%2Fproxy-cron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umputun%2Fproxy-cron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umputun%2Fproxy-cron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/umputun","download_url":"https://codeload.github.com/umputun/proxy-cron/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221832450,"owners_count":16888251,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crontab","http","proxy","proxy-server"],"created_at":"2024-10-15T09:20:26.348Z","updated_at":"2024-10-28T13:34:35.453Z","avatar_url":"https://github.com/umputun.png","language":"Go","readme":"[![Build Status](https://github.com/umputun/proxy-cron/workflows/build/badge.svg)](https://github.com/umputun/proxy-cron/actions) [![Coverage Status](https://coveralls.io/repos/github/umputun/proxy-cron/badge.svg?branch=master)](https://coveralls.io/github/umputun/proxy-cron?branch=master)\n\n\nProxy-cron is a simple HTTP proxy server designed to handle requests based on crontab-like scheduling. It enables requests to be proxied during specified times and serves cached responses when requests are made outside the allowed schedule. This is particularly useful for managing systems that aren't operational 24/7, to prevent unnecessary alerts or checks during their downtime.\n\n## Why it's needed\n\nConsider a service that does not operate around the clock, yet requires monitoring. Utilizing a regular monitoring system is not feasible, as it would generate alerts every time the service is offline. Similarly, a cron job is not a solution, as it only executes at specific intervals. A method is needed to proxy requests to the service only when it's active and serve cached responses when it's not.\n\nWith proxy-cron, users can specify a schedule in the URL, determining when requests should be proxied to the service. During these permitted times, requests are proxied as usual. However, when requests occur outside of these times, proxy-cron provides the last cached response. This enables monitoring of the service without triggering alerts each time it becomes unavailable.\n\n## How it works\n\nProxy-cron operates as a straightforward HTTP server, processing only `GET` requests. Each request must include two query parameters:\n \n- `endpoint`: The actual endpoint URL you want to proxy.\n- `crontab`: The crontab schedule expression defining the allowed times for proxying requests.\n\nUpon receiving a request, proxy-cron evaluates the 'crontab' query parameter to determine if the current time falls within the allowed period. If so, proxy-cron proxies the request to the specified endpoint, caches the response, and forwards it to the client. If the request is made outside the permitted time, proxy-cron supplies the last cached response instead.\n\n## Installation\n\nproxy-cron is available as a Docker image and be loaded from the docker hub as `umputun/proxy-cron` and from the GitHub Container Registry as\n`ghcr.io/umputun/proxy-cron`. Tagged images are available for each release and the `latest` tag is also available for the latest build. The current master branch is also built and available as `master` tag, but it is not recommended for production use as it may be unstable.\n\nBinary releases are also available on the [releases page](https://github.com/umputun/proxy-cron/releases).\n\nFor macOS users, proxy-cron can be installed using Homebrew: `brew install umputun/apps/proxy-cron`.\n\n## Usage\n\nTo use the proxy, send HTTP requests to it with the following query parameters `endpoint` and `crontab`. For example:\n```\ncurl \"http://localhost:8080/?endpoint=http://example.com\u0026crontab=* 8-16 * * 1-5\"\n```\nnote: the `crontab` parameter can be passed with `_` instead of spaces to avoid the need for URL encoding, \ni.e. `* 8-16 * * 1-5` becomes `*_8-16_*_* _1-5`.\n\nSee example of the basic [docker-compose.yml](https://github.com/umputun/proxy-cron/blob/master/docker-compose.yml) file\nto run proxy-cron with docker compose.\n\n\n## Application options\n\n```\n      --port=            port to listen on (default: 8080) [$PORT]\n      --max-size=        max body size in bytes (default: 1048576) [$MAX_SIZE]\n      --suppress-headers suppress custom proxy-cron headers in the response [$SUPPRESS_HEADERS]      \n      --no-colors        disable colorized logging [$NO_COLORS]\n      --dbg              debug mode [$DEBUG]\n\ntimeout:\n      --timeout.connect= connect timeout (default: 10s) [$TIMEOUT_CONNECT]\n      --timeout.read=    read timeout (default: 10s) [$TIMEOUT_READ]\n      --timeout.write=   write timeout (default: 10s) [$TIMEOUT_WRITE]\n      --timeout.idle=    idle timeout (default: 15s) [$TIMEOUT_IDLE]\n\nHelp Options:\n  -h, --help             Show this help message\n\n```\n","funding_links":["https://github.com/sponsors/umputun"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumputun%2Fproxy-cron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fumputun%2Fproxy-cron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumputun%2Fproxy-cron/lists"}