From b77020180276d62047af15e77ab612d5794ea03d Mon Sep 17 00:00:00 2001 From: VailElla <63608800+VailElla@users.noreply.github.com> Date: Tue, 14 Jul 2026 00:34:12 +0800 Subject: [PATCH] Prepare repository for open source contributions --- .github/PULL_REQUEST_TEMPLATE.md | 19 ++++++++++++++ CONTRIBUTING.md | 45 ++++++++++++++++++++++++++++++++ LICENSE | 21 +++++++++++++++ README.md | 8 ++++++ README.zh-CN.md | 7 +++++ SECURITY.md | 25 ++++++++++++++++++ 6 files changed, 125 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE create mode 100644 SECURITY.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..adf5ed3 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,19 @@ +## Summary + + + +## Validation + +- [ ] `dotnet format AutoPowerMode.sln --verify-no-changes` +- [ ] Logic tests passed +- [ ] Windows Settings UI smoke test passed, or the limitation is explained below + +## Checklist + +- [ ] The change is focused and documented where needed. +- [ ] No generated build output, PDB files, local configuration, logs, or secrets are included. +- [ ] User-facing behavior changes are reflected in the relevant README or `CHANGELOG.md`. + +## Notes + + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..daaceb0 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,45 @@ +# Contributing to AutoPowerMode + +Thanks for helping improve AutoPowerMode. Contributions are welcome through +GitHub issues and pull requests. + +## Before you start + +- Search existing issues and pull requests before opening a new one. +- Do not report security vulnerabilities in a public issue. Follow + [SECURITY.md](SECURITY.md) instead. +- Remove personal paths, logs, configuration files, and other sensitive data + from diagnostic output before sharing it. + +## Development environment + +- .NET 8 SDK +- Windows 10 or later for running the application and the Windows UI smoke + test +- A non-Windows development machine can build the Windows-targeted solution + and run the logic tests, but cannot run the Windows UI smoke test locally. + +Useful commands from the repository root: + +```bash +dotnet restore AutoPowerMode.sln +dotnet format AutoPowerMode.sln --verify-no-changes +dotnet build AutoPowerMode.sln --configuration Release +dotnet run --project tests/AutoPowerMode.Tests/AutoPowerMode.Tests.csproj --configuration Release +# Windows only: +dotnet run --project tests/AutoPowerMode.WindowsUi.Tests/AutoPowerMode.WindowsUi.Tests.csproj --configuration Release +``` + +## Pull requests + +- Keep each pull request focused on one coherent change. +- Add or update tests for behavior changes. +- Update `README.md`, `README.zh-CN.md`, or `CHANGELOG.md` when user-facing + behavior changes. +- Explain the validation you ran and call out any Windows-only validation you + could not perform. +- Do not commit `bin/`, `obj/`, `release/`, `publish/`, `dist/`, PDB files, + logs, local configuration, or secrets. + +GitHub Actions runs formatting, logic tests, and the Windows Settings UI smoke +test for pull requests. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..7b87689 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 VailElla + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 49ad31a..31e775d 100644 --- a/README.md +++ b/README.md @@ -65,3 +65,11 @@ dotnet run --project tests/AutoPowerMode.WindowsUi.Tests/AutoPowerMode.WindowsUi ``` The logic tests cover configuration migration, independently configurable dual-rate monitoring, idle protections, language selection and persistence, power-plan parsing, switch policies, notifications, DPI layout, log rotation and path sanitization, startup registration, and external override protection. The Windows-only smoke test opens the localized Settings form and exercises both wide and compact layouts. + +## License and contributing + +AutoPowerMode is open source software released under the [MIT License](LICENSE). +Contributions, bug reports, and focused pull requests are welcome. See +[CONTRIBUTING.md](CONTRIBUTING.md) for the development and validation workflow. +For security vulnerabilities, follow [SECURITY.md](SECURITY.md) instead of +opening a public issue. diff --git a/README.zh-CN.md b/README.zh-CN.md index 964e6e6..b3acb90 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -65,3 +65,10 @@ dotnet run --project tests/AutoPowerMode.WindowsUi.Tests/AutoPowerMode.WindowsUi ``` 逻辑测试覆盖配置迁移、可独立配置的双频检测策略、空闲误触保护、语言选择与持久化、电源计划解析、切换策略、通知、DPI 布局、日志轮转与路径脱敏、开机自启和外部覆盖保护。Windows 专用冒烟测试会实际打开中英文设置窗口并验证宽窄布局切换。 + +## 开源协议与参与贡献 + +AutoPowerMode 是采用 [MIT 许可证](LICENSE) 发布的开源软件。欢迎提交 +问题反馈和聚焦明确的 Pull Request;开发环境与验证流程请参阅 +[CONTRIBUTING.md](CONTRIBUTING.md)。安全漏洞请按照 [SECURITY.md](SECURITY.md) +中的方式私下报告,不要直接创建公开 issue。 diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..7693f47 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,25 @@ +# Security Policy + +## Supported versions + +| Version | Supported | +| --- | --- | +| `main` | Yes | +| Latest release | Yes | +| Older releases | No | + +## Reporting a vulnerability + +Please do not report security vulnerabilities in public issues or pull +requests. Use GitHub's private vulnerability reporting feature for this +repository when it is available. + +If private vulnerability reporting is unavailable, contact the maintainer +through the [VailElla GitHub profile](https://github.com/VailElla) and include: + +- a description of the vulnerability and its potential impact; +- clear reproduction steps or a minimal proof of concept; and +- any suggested mitigation, if available. + +Please avoid including passwords, access tokens, private user data, or other +secrets in a report.