From fe129f525e545b0e1cbf679f11bd589984e1ed54 Mon Sep 17 00:00:00 2001 From: Adib Hanna Date: Fri, 17 Apr 2026 14:05:28 -0500 Subject: [PATCH 1/2] Add repo-hardening foundation - MIT LICENSE - CODEOWNERS pointing at @adibhanna for all paths - SECURITY.md with private vulnerability reporting guidance - Dependabot config for npm and github-actions updates --- .github/CODEOWNERS | 3 +++ .github/dependabot.yml | 19 +++++++++++++++++++ LICENSE | 21 +++++++++++++++++++++ SECURITY.md | 22 ++++++++++++++++++++++ 4 files changed, 65 insertions(+) create mode 100644 .github/CODEOWNERS create mode 100644 .github/dependabot.yml create mode 100644 LICENSE create mode 100644 SECURITY.md diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..3249e956 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,3 @@ +# Every change requires review from a listed code owner. +# See https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-security/customizing-your-repository/about-code-owners +* @adibhanna diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..5896b4fc --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,19 @@ +version: 2 +updates: + - package-ecosystem: npm + directory: / + schedule: + interval: weekly + open-pull-requests-limit: 10 + labels: + - dependencies + - npm + + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly + open-pull-requests-limit: 5 + labels: + - dependencies + - github-actions diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..f52b98d5 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Adib Hanna and ZenNotes contributors + +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/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..b61b1c93 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,22 @@ +# Security Policy + +## Supported Versions + +We support the latest published release of ZenNotes. Security fixes land on +`main` first and roll into the next release. + +## Reporting a Vulnerability + +**Please do not open a public GitHub issue for security vulnerabilities.** + +Report issues privately through GitHub's [private vulnerability reporting +form](https://github.com/ZenNotes/zennotes/security/advisories/new) for this +repository. Include: + +- A description of the issue and the impact +- Steps to reproduce or a proof of concept +- Affected versions, if known +- Any suggested remediation + +We aim to acknowledge reports within 3 business days and to ship a fix or +publish a coordinated advisory within 30 days of confirmation. From f443d7de4e5db0db20eb24cbd892a70cb4a94889 Mon Sep 17 00:00:00 2001 From: Adib Hanna Date: Fri, 17 Apr 2026 14:08:52 -0500 Subject: [PATCH 2/2] Add CONTRIBUTING guide and CodeQL workflow - CONTRIBUTING.md documents the dev loop, PR requirements, and style bar - .github/workflows/codeql.yml adds weekly + per-PR CodeQL scans for javascript-typescript with the security-and-quality query pack --- .github/workflows/codeql.yml | 44 ++++++++++++++++++++++++ CONTRIBUTING.md | 66 ++++++++++++++++++++++++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 .github/workflows/codeql.yml create mode 100644 CONTRIBUTING.md diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 00000000..1e06190d --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,44 @@ +name: CodeQL + +on: + push: + branches: [main] + pull_request: + branches: [main] + schedule: + # Weekly scan on Sundays at 04:17 UTC so it doesn't fight the weekday CI queue. + - cron: '17 4 * * 0' + +permissions: + actions: read + contents: read + security-events: write + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + runs-on: ubuntu-latest + timeout-minutes: 20 + + strategy: + fail-fast: false + matrix: + language: [javascript-typescript] + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + queries: security-and-quality + + - name: Autobuild + uses: github/codeql-action/autobuild@v3 + + - name: Analyze + uses: github/codeql-action/analyze@v3 + with: + category: '/language:${{ matrix.language }}' diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..89743f4b --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,66 @@ +# Contributing to ZenNotes + +Thanks for your interest in improving ZenNotes — a keyboard-first, Markdown-first +desktop notes app built on Electron, React, TypeScript, and CodeMirror 6. + +## Before you start + +- For **anything non-trivial**, open an issue first so we can agree on scope + and approach before you spend time building. +- For **small fixes** (typos, obvious bugs, dependency bumps), open a PR + directly. +- For **security issues**, do not open a public issue — follow + [SECURITY.md](./SECURITY.md). + +## Getting set up + +```bash +git clone https://github.com/ZenNotes/zennotes.git +cd zennotes +npm install +npm run dev +``` + +Useful scripts: + +- `npm run dev` — run the app with hot reload +- `npm test` — run the test suite +- `npm run build` — produce a production build +- `npm run lint` — run the linter + +## Working on a change + +1. Fork the repo and create a feature branch from `main`. +2. Keep commits focused. A clear commit message beats a long PR description. +3. Add or update tests when you change behavior. +4. Make sure `npm test` and `npm run build` pass locally. +5. Open a pull request against `main`. + +## Pull request requirements + +Branch protection on `main` enforces: + +- **Pull request required** — no direct pushes +- **One approving review from a code owner** (see + [.github/CODEOWNERS](./.github/CODEOWNERS)) +- **Green CI** across Linux, macOS, and Windows build jobs +- **Linear history** (squash merge only; the head branch is auto-deleted) +- **All review comments resolved** before merging + +## Style and scope + +- Match the style of the surrounding code — don't introduce new patterns + mid-file. +- Keep the scope of each PR tight. Refactors, feature work, and formatting + changes belong in separate PRs. +- ZenNotes is keyboard-first. Every new user-facing feature should ship with a + keybinding or leader flow. + +## Code of conduct + +Be kind, assume good faith, focus on the work. + +## License + +By contributing, you agree that your contributions are licensed under the +[MIT License](./LICENSE).