{"id":16161915,"url":"https://github.com/mrrfv/offline-server-auto-restart","last_synced_at":"2025-10-12T13:30:45.770Z","repository":{"id":189531494,"uuid":"680843910","full_name":"mrrfv/offline-server-auto-restart","owner":"mrrfv","description":"Use a Raspberry Pi and Tapo P100 (or P105) smart plug to automatically power cycle a server that unexpectedly went down","archived":false,"fork":false,"pushed_at":"2025-10-02T18:03:35.000Z","size":46,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-02T20:15:30.864Z","etag":null,"topics":["failsafe","raspberry-pi","raspberrypi","self-hosted","selfhosted","server","smart-home","smart-plug","smarthome","tapo","tapo-p100","tapo-p105"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrrfv.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-08-20T15:34:23.000Z","updated_at":"2025-10-02T18:03:11.000Z","dependencies_parsed_at":"2024-02-20T21:25:44.451Z","dependency_job_id":"43eb703c-c61c-4660-85bd-bac0b3f005df","html_url":"https://github.com/mrrfv/offline-server-auto-restart","commit_stats":null,"previous_names":["mrrfv/offline-server-auto-restart"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mrrfv/offline-server-auto-restart","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrrfv%2Foffline-server-auto-restart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrrfv%2Foffline-server-auto-restart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrrfv%2Foffline-server-auto-restart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrrfv%2Foffline-server-auto-restart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrrfv","download_url":"https://codeload.github.com/mrrfv/offline-server-auto-restart/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrrfv%2Foffline-server-auto-restart/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279011443,"owners_count":26084947,"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","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"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":["failsafe","raspberry-pi","raspberrypi","self-hosted","selfhosted","server","smart-home","smart-plug","smarthome","tapo","tapo-p100","tapo-p105"],"created_at":"2024-10-10T02:28:18.029Z","updated_at":"2025-10-12T13:30:45.505Z","avatar_url":"https://github.com/mrrfv.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# offline-server-auto-restart\n\nHave you tried turning it off and on again? Offline Server Auto Restart uses a Raspberry Pi and Tapo P100 (or P105) smart plug to automatically power cycle a server that unexpectedly went down.\n\n## Requirements\n\n- Tapo P100 or P105 smart plug connected to your server as well as to your network\n- Node.js and npm installed\n- Any open port on the server (could be SSH, HTTP, etc.)\n- Raspberry Pi or similar second computer that is always on and connected to the same network as the smart plug and server\n\n### Nice to have\n\n- BIOS settings configured to turn on the server when power is restored (not absolutely necessary as Wake-on-LAN is used, but it's a good failsafe)\n\n## Usage\n\n1. Clone this repository to your Raspberry Pi\n2. Run `npm install` to install dependencies\n3. Copy `.env.example` to `.env` and fill in the required values\n4. Run `node get_device_id.mjs` to get the device ID of your smart plug\n5. Copy the device ID to the `.env` file\n6. Run `node index.mjs` to start the script. Preferably, use a process manager like [PM2](https://pm2.keymetrics.io/) to keep the script running in the background and to automatically restart it if it crashes.\n\n## Why not ping?\n\nSome servers respond to ping requests even if they are turned off (for example, devices with Intel AMT configured or servers with Wake-on-LAN enabled). This script checks the ports to see if the server is running.\n\n## Important\n\n- There is a chance that the checked port will be closed during a graceful shutdown or reboot. In that case, the script will assume that the server is down and will power cycle it. This could result in **data loss**.\n- Servers rebooting into the BIOS or UEFI setup will not be detected as running and will be power cycled.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrrfv%2Foffline-server-auto-restart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrrfv%2Foffline-server-auto-restart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrrfv%2Foffline-server-auto-restart/lists"}