{"id":15573321,"url":"https://github.com/silentsokolov/go-sleep","last_synced_at":"2026-06-29T21:31:44.813Z","repository":{"id":57604205,"uuid":"81121506","full_name":"silentsokolov/go-sleep","owner":"silentsokolov","description":"go-sleep helps to automatically start cloud instances Google Compute Engine / Amazon EC2 by request (HTTP) and stopping unused instances, after some time.","archived":false,"fork":false,"pushed_at":"2017-11-02T09:14:30.000Z","size":16705,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-26T21:24:33.789Z","etag":null,"topics":["amazon-ec2","ec2","gce","go","golang","google-compute-engine"],"latest_commit_sha":null,"homepage":"","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/silentsokolov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-06T19:07:46.000Z","updated_at":"2017-11-03T15:54:21.000Z","dependencies_parsed_at":"2022-09-04T11:42:12.541Z","dependency_job_id":null,"html_url":"https://github.com/silentsokolov/go-sleep","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/silentsokolov/go-sleep","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silentsokolov%2Fgo-sleep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silentsokolov%2Fgo-sleep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silentsokolov%2Fgo-sleep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silentsokolov%2Fgo-sleep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/silentsokolov","download_url":"https://codeload.github.com/silentsokolov/go-sleep/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silentsokolov%2Fgo-sleep/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34944147,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-29T02:00:05.398Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["amazon-ec2","ec2","gce","go","golang","google-compute-engine"],"created_at":"2024-10-02T18:11:50.207Z","updated_at":"2026-06-29T21:31:44.797Z","avatar_url":"https://github.com/silentsokolov.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/silentsokolov/go-sleep.svg?branch=master)](https://travis-ci.org/silentsokolov/go-sleep)\n[![GoDoc](https://godoc.org/github.com/silentsokolov/go-sleep?status.svg)](https://godoc.org/github.com/silentsokolov/go-sleep/) [![codecov](https://codecov.io/gh/silentsokolov/go-sleep/branch/master/graph/badge.svg)](https://codecov.io/gh/silentsokolov/go-sleep)\n[![Go Report Card](https://goreportcard.com/badge/github.com/silentsokolov/go-sleep)](https://goreportcard.com/report/github.com/silentsokolov/go-sleep)\n\n# go-sleep\n\ngo-sleep helps to automatically start cloud instances [Google Compute Engine](https://cloud.google.com/compute/) / [Amazon EC2](https://aws.amazon.com/ec2/) by request (HTTP) and stopping unused instances, after some time.\n\nHere is basic workflow: the go-sleep handles all incoming requests, if instance running, proxy all traffic. Else request start instance and waiting him.\n\n![Diagram](https://raw.githubusercontent.com/silentsokolov/go-sleep/master/docs/diagram.png)\n\n\n## Installation\n\nDownload latest binary from https://github.com/silentsokolov/go-sleep/releases\n\n\n## Getting started\n\nRun `./go-sleep -config=/path/to/config.toml`\n\n\n## Config\n\nPlease refer to the [config.sample.toml](https://github.com/silentsokolov/go-sleep/blob/master/config.sample.toml) to get full documentation.\n\n### Global\n\n```toml\n# Port\n# Reserved for web API interface\nport = \":9090\"\n\n# Secret key\n# Is passed along with every request to that site in the X-Go-Sleep-Key header\nsecret_key = \"my-secret-key\"\n\n# Log level\nlog_level = \"info\"\n```\n\n### Basic auth\n\n```toml\n# Group user for basic auth\n# Passwords can be encoded in MD5, SHA1 and BCrypt: you can use htpasswd to generate those ones\n\n# [auth]\n#  [auth.\u003cgroup_name\u003e]\n#    users = [\"\u003cuser\u003e:\u003cpassword\u003e\", \"\u003cuser\u003e:\u003cpassword\u003e\"]\n\n# This example register two groups admins/freelancers with user \"test\" with password \"test\"\n[auth]\n  [auth.admins]\n    users = [\"test:$apr1$bfLZ0ZMK$CYhTBqS.Yl.V1hbOpHze51\"]\n  [auth.freelancers]\n    users = [\"test:$apr1$bfLZ0ZMK$CYhTBqS.Yl.V1hbOpHze51\"]\n```\n\n### Instance (Google Compute Engine)\n\n```toml\n# This example register one GCE instance with two hostnames (example.com and www.example.com) on 80/443 port (with TLS)\n# Access is limited basic auth (for group \"admins\")\n[[gce]]\njwt_path = \"/path/to/key_jwt.json\"\nproject_id = \"project-test-12\"\nzone = \"europe-west1-a\"\nname = \"instance-1\"\n  [[gce.route]]\n  address = \":80\"\n  hostnames = [\"example.com\", \"www.example.com\"]\n  auth_group = \"admins\"\n\n  [[gce.route]]\n  address = \":443\"\n  hostnames = [\"example.com\", \"www.example.com\"]\n  auth_group = \"admins\"\n  backend_port = 80\n    [[gce.route.certificate]]\n    cert_file = \"/path/to/server.crt\"\n    key_file = \"/path/to/server.key\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilentsokolov%2Fgo-sleep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsilentsokolov%2Fgo-sleep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilentsokolov%2Fgo-sleep/lists"}