{"id":44760931,"url":"https://github.com/thedarthmole/upswake","last_synced_at":"2026-04-03T00:24:10.516Z","repository":{"id":201043371,"uuid":"700580954","full_name":"TheDarthMole/upswake","owner":"TheDarthMole","description":"UPSWake reads data from a UPS Nut Server and uses it to dynamically send Wake on Lan packets to servers","archived":false,"fork":false,"pushed_at":"2026-02-22T22:08:08.000Z","size":1181,"stargazers_count":17,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-23T03:14:35.897Z","etag":null,"topics":["docker","golang","nut","ups","wake-on-lan","wol"],"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/TheDarthMole.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"docs/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":"docs/MAINTAINERS.md","copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-10-04T21:39:01.000Z","updated_at":"2026-02-22T19:32:44.000Z","dependencies_parsed_at":"2026-02-27T00:00:56.376Z","dependency_job_id":null,"html_url":"https://github.com/TheDarthMole/upswake","commit_stats":null,"previous_names":["thedarthmole/upswake"],"tags_count":30,"template":false,"template_full_name":null,"purl":"pkg:github/TheDarthMole/upswake","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheDarthMole%2Fupswake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheDarthMole%2Fupswake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheDarthMole%2Fupswake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheDarthMole%2Fupswake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheDarthMole","download_url":"https://codeload.github.com/TheDarthMole/upswake/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheDarthMole%2Fupswake/sbom","scorecard":{"id":1237202,"data":{"date":"2025-09-07T22:34:43Z","repo":{"name":"github.com/TheDarthMole/upswake","commit":"4de80f48340f5e6889c717b16bfc39e9ab35a478"},"scorecard":{"version":"v5.2.1","commit":"ab2f6e92482462fe66246d9e32f642855a691dc1"},"score":8.1,"checks":[{"name":"Dependency-Update-Tool","score":10,"reason":"update tool detected","details":["Info: detected update tool: RenovateBot: renovate.json:1"],"documentation":{"short":"Determines if the project uses a dependency update tool.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#dependency-update-tool"}},{"name":"Code-Review","score":0,"reason":"Found 0/7 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#code-review"}},{"name":"Maintained","score":10,"reason":"30 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#dangerous-workflow"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: docs/SECURITY.md:1","Info: Found linked content: docs/SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: docs/SECURITY.md:1","Info: Found text in security policy: docs/SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#security-policy"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":10,"reason":"all dependencies are pinned","details":["Info:  14 out of  14 GitHub-owned GitHubAction dependencies pinned","Info:  17 out of  17 third-party GitHubAction dependencies pinned","Info:   1 out of   1 goCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":10,"reason":"GitHub workflow tokens follow principle of least privilege","details":["Info: jobLevel 'contents' permission set to 'read': .github/workflows/build.yml:27","Info: jobLevel 'contents' permission set to 'read': .github/workflows/dependency-review.yml:18","Info: jobLevel 'contents' permission set to 'read': .github/workflows/golangci-lint.yml:16","Info: jobLevel 'contents' permission set to 'read': .github/workflows/lint-swagger.yml:16","Info: jobLevel 'contents' permission set to 'read': .github/workflows/test.yml:16","Info: jobLevel 'contents' permission set to 'read': .github/workflows/test.yml:73","Info: topLevel 'contents' permission set to 'read': .github/workflows/build.yml:16","Info: topLevel 'contents' permission set to 'read': .github/workflows/dependency-review.yml:11","Info: topLevel 'contents' permission set to 'read': .github/workflows/golangci-lint.yml:9","Info: topLevel 'contents' permission set to 'read': .github/workflows/lint-swagger.yml:9","Info: topLevel permissions set to 'read-all': .github/workflows/scorecard.yml:18","Info: topLevel 'contents' permission set to 'read': .github/workflows/test.yml:9","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":2,"reason":"badge detected: InProgress","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#cii-best-practices"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/build.yml:19"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#packaging"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#branch-protection"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#license"}},{"name":"SAST","score":10,"reason":"SAST tool is run on all commits","details":["Info: all commits (30) are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#sast"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#fuzzing"}},{"name":"Contributors","score":0,"reason":"project has 0 contributing companies or organizations -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project has a set of contributors from multiple organizations (e.g., companies).","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#contributors"}},{"name":"CI-Tests","score":10,"reason":"13 out of 13 merged PRs checked by a CI test -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project runs tests before pull requests are merged.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#ci-tests"}}]},"last_synced_at":"2025-09-08T00:21:17.935Z","repository_id":201043371,"created_at":"2025-09-08T00:21:17.935Z","updated_at":"2025-09-08T00:21:17.935Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29878264,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T23:51:21.483Z","status":"ssl_error","status_checked_at":"2026-02-26T23:50:46.793Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["docker","golang","nut","ups","wake-on-lan","wol"],"created_at":"2026-02-16T02:48:30.793Z","updated_at":"2026-04-03T00:24:10.484Z","avatar_url":"https://github.com/TheDarthMole.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌟 UPSWake\n\n[![Build](https://github.com/TheDarthMole/upswake/actions/workflows/build.yml/badge.svg)](https://github.com/TheDarthMole/upswake/actions/workflows/build.yml)\n[![Tests](https://github.com/TheDarthMole/upswake/actions/workflows/test.yml/badge.svg)](https://github.com/TheDarthMole/upswake/actions/workflows/test.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/TheDarthMole/UPSWake)](https://goreportcard.com/report/github.com/TheDarthMole/UPSWake)\n[![License](https://img.shields.io/github/license/TheDarthMole/UPSWake?color=blue)](LICENSE)\n[![Docker Image Size](https://img.shields.io/docker/image-size/thedarthmole/upswake/latest)](https://hub.docker.com/r/thedarthmole/upswake)\n[![Docker Pulls](https://img.shields.io/docker/pulls/thedarthmole/upswake)](https://hub.docker.com/r/thedarthmole/upswake)\n[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/11143/badge)](https://www.bestpractices.dev/projects/11143)\n[![codecov](https://codecov.io/github/TheDarthMole/upswake/graph/badge.svg?token=B23QF8JDVJ)](https://codecov.io/github/TheDarthMole/upswake)\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FTheDarthMole%2Fupswake.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FTheDarthMole%2Fupswake?ref=badge_shield)\n\nA dynamic Wake on Lan application that wakes servers based on the status of a NUT UPS server using the Rego policy language.\n\n## 📜 Highlights\n\n### ⚡ Efficiency\n\n- 🌐 Lightweight API server to handle Wake on Lan requests\n- 📦 Small Docker image size and low footprint\n- 🥧 Can be run on a Raspberry Pi or other small computer\n\n### 🛠️ Flexibility\n\n- 📝 Define dynamic rules using the Rego policy language\n- 📦 Multi-arch Docker image can run on any platform\n- ⚙️ CLI tool to manually wake a server\n- 📡 Connect to multiple NUT servers and wake multiple servers\n\n### 🛡️ Attention to Security\n\n\u003cdetails\u003e\u003csummary\u003e\u003cem\u003eClick to expand:\u003c/em\u003e ✍️ You can verify the Docker images were built from this repository using the cosign tool.\u003c/summary\u003e\n\n\n```bash\ncosign verify thedarthmole/upswake:latest \\\n    --certificate-identity-regexp https://github.com/TheDarthMole/upswake/ \\\n    --certificate-oidc-issuer https://token.actions.githubusercontent.com\n```\n\n```bash\ncosign verify ghcr.io/thedarthmole/upswake:latest \\\n    --certificate-identity-regexp https://github.com/TheDarthMole/upswake/ \\\n    --certificate-oidc-issuer https://token.actions.githubusercontent.com\n```\n\n\u003e [!NOTE]\n\u003e This only proves that the Docker image is from this repository, assuming that no one hacks into GitHub or the repository. It does not prove that the code itself is secure.\n\n\u003c/details\u003e\n\n## 🔍 Overview\n\nUPSWake is an application that allows you to dynamically wake servers using Wake on Lan based on the status of \na NUT UPS server.\n\nThe OPA Rego language is used in order to allow for dynamic rules to be defined for when to wake a server. \nThe status of one or many NUT UPS servers is checked against the defined rules and if the rules are met, \na Wake on Lan packet is sent to the defined server.\n\nUpswake is designed to run on a [Raspberry Pi](https://www.raspberrypi.org/) or any small, always-on computer that\nshares the same network as the servers you want to wake. \nIt is ideal for environments where the servers are set to shut down using the [NUT client](https://technotim.live/posts/NUT-server-guide/) \nwhen the UPS switches to battery power, as Upswake provides the capability to wake them back up using intelligent rules.\n\n## 🏎️ Getting Started\n\nCreate a `config.yaml` file in the same directory as the application.\nIf a config is not provided, the application will attempt to create a default config.\n\n```yaml\nnut_servers:\n  - name: raspberrypi\n    host: 192.168.13.37\n    port: 3493\n    username: upsmon\n    password: bigsecret\n    targets:\n      - name: MyNAS\n        mac: \"01:23:45:67:89:01\"\n        broadcast: 192.168.13.255\n        port: 9\n        interval: 5s\n        rules:\n          - 80percentOn.rego\n      - name: Gaming PC\n        mac: \"10:98:76:54:32:01\"\n        broadcast: 192.168.13.255\n        port: 9\n        interval: 15m\n        rules:\n          - alwaysTrue.rego\n```\n\nThe above config allows for a flexible configuration where you can define multiple NUT hosts and multiple target hosts. \nMultiple rules can also be defined for each server to be woken.\nYAML anchors can be used if the same NUT client is used for multiple servers.\n\n\u003e [!NOTE] \n\u003e The Rego rules are evaluated in a logical OR fashion. If any of the rules evaluate to true, the host will be woken.\n\nRules are stored and read from the [rules](rules) folder and are written in the OPA Rego language. \nThe example rule [80percentOn.rego](./rules/80percentOn.rego) will wake the server if the UPS named \"cyberpower900\" is \non line power and the battery level is above 80%.\n\n### 🐋 Deployment with Docker Compose\n\n```yaml\nservices:\n  upswake:\n    # Choose the appropriate tag based on your need:\n    # - \"latest\" for the latest stable version (which could become 2.x.y in the future and break things)\n    # - \"edge\" for the latest development version running on the default branch\n    # - \"1\" for the latest stable version whose major version is 1\n    # - \"1.x\" for the latest stable version whose major.minor version is 1.x\n    # - \"1.x.y\" to pin the specific version 1.x.y\n    image: thedarthmole/upswake:latest\n    # image: ghcr.io/thedarthmole/upswake:latest # Use this if you prefer the GitHub Container Registry\n    container_name: upswake\n    # Required to allow the container to access the host's network interface to send Wake-on-LAN packets\n    network_mode: host\n    # Restart the container automatically after reboot\n    restart: always\n    # Run the application as a non-root user (optional but recommended)\n    # Change the user and group IDs based on your needs\n    user: \"1000:1000\"\n    # Make the container filesystem read-only (optional but recommended)\n    read_only: true\n    # Drop all Linux capabilities (optional but recommended)\n    cap_drop: [ all ]\n    # Another protection to restrict superuser privileges (optional but recommended)\n    security_opt: [no-new-privileges:true]\n    command: [\"serve\"]\n    # Mount the configuration file and the rules folder as read-only volumes\n    volumes:\n      - \"./config.yaml:/config.yaml:ro\" # upswake will create a config if one doesn't exist, you may want to remove the ':ro' in that case\n      - \"./rules/:/rules/:ro\"\n```\n\n#### 🚀 Start the application\n\n```bash\ndocker compose up --detach --pull always --force-recreate\n````\n\n### ⛷️ Other Installation Methods\n\n\u003cdetails\u003e\u003csummary\u003e\u003cem\u003eClick to expand:\u003c/em\u003e 🐋 Directly run the Docker image\u003c/summary\u003e\n\n```bash\ndocker run \\\n  --network host \\\n  -v ${PWD}/config.yaml:/config.yaml:ro \\\n  -v ${PWD}/rules:/rules/:ro \\\n  --name upswake \\\n  thedarthmole/upswake:latest\n```\n\n\u003e Note: The `--network host` flag is required to allow the container to access the host's network interface to send Wake-on-LAN packets.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e\u003cem\u003eClick to expand:\u003c/em\u003e 🧬 Directly install upswake from its source\u003c/summary\u003e\n\nYou need the [Go tool](https://golang.org/doc/install) to run upswake from its source.\n\n```bash\ngo install github.com/TheDarthMole/UPSWake/cmd/upswake@latest\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e\u003cem\u003eClick to expand:\u003c/em\u003e 🏗️ Build upswake from its source\u003c/summary\u003e\n\nYou need the [Go tool](https://golang.org/doc/install) to build upswake from its source.\n\n```bash\ngit clone git@github.com:TheDarthMole/upswake.git\ncd upswake\ngo build -o upswake ./cmd/upswake\n```\n\n\u003c/details\u003e\n\n## Usage\n\n```yaml\nUsage:\n  upswake [command]\n\nAvailable Commands:\n  completion  Generate the autocompletion script for the specified shell\n  help        Help about any command\n  json        Retrieve JSON from a NUT server\n  serve       Run the UPSWake server\n  wake        Manually wake a computer\n\nFlags:\n  -h, --help   help for upswake\n\nUse \"upswake [command] --help\" for more information about a command.\n```\n## Development\n\nThis project uses [Golang](https://go.dev/), [Just](https://github.com/casey/just) and your choice of [Docker](https://www.docker.com/) or [Podman](https://podman.io/) for development.\nTo install other dependencies, build or run the application, you can use the `just` tool to run the commands defined in \nthe [justfile](justfile).\n\n```\njust -l\nAvailable recipes:\n    build            # Build upswake\n    build-container  # Build the thedarthmole/upswake:local container\n    help             # Display this help message\n    install-deps     # Install development dependencies\n    lint             # Runs all linters\n    run *args        # Run upswake with arguments\n    run-container    # Builds and runs the upswake container\n    start-nut-server # Runs a NUT server in a container for testing\n    stop-nut-server  # Stops the NUT server container\n    swagger          # Generate Swagger documentation\n    test             # Run all Go tests\n```\n\nFor more information about contributing to UPSWake, please read the [CONTRIBUTING.md](docs/CONTRIBUTING.md) and\n[MAINTAINERS.md](docs/MAINTAINERS.md) docs.\n\n## License\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FTheDarthMole%2Fupswake.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FTheDarthMole%2Fupswake?ref=badge_large)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthedarthmole%2Fupswake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthedarthmole%2Fupswake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthedarthmole%2Fupswake/lists"}