Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Default owner for everything.
* @omercnet
11 changes: 11 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## What changed

## Why

## How it was verified

## Checklist

- [ ] Tests added or updated, or not applicable
- [ ] No secrets or credentials committed
- [ ] Docs updated, or not applicable
94 changes: 94 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# RunsOn label convention for heavy jobs that arrive with the code (not used
# yet: every job below is a tiny gate job on ubuntu-latest):
# runs-on: runs-on=${{ github.run_id }}-${{ github.run_attempt }}-<job>/runner=4cpu-linux-x64
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

concurrency:
# Key PR runs by number so they cannot cancel the push run for a merged commit.
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
gitleaks:
name: Secret Scan
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0
persist-credentials: false
- name: Install gitleaks
env:
# renovate: datasource=github-releases depName=gitleaks/gitleaks
GITLEAKS_VERSION: 8.30.1
GITLEAKS_SHA256: 551f6fc83ea457d62a0d98237cbad105af8d557003051f41f3e7ca7b3f2470eb
run: |
curl -fsSLo gitleaks.tar.gz "https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz"
echo "${GITLEAKS_SHA256} gitleaks.tar.gz" | sha256sum -c -
tar -xzf gitleaks.tar.gz gitleaks && rm gitleaks.tar.gz
- name: Scan commits
run: ./gitleaks git --config .gitleaks.toml --redact --verbose .
- name: Scan tree
run: ./gitleaks dir --config .gitleaks.toml --redact --verbose .

workflow-policy:
name: Workflow Policy
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- name: Run actionlint
env:
# renovate: datasource=github-releases depName=rhysd/actionlint
ACTIONLINT_VERSION: 1.7.12
ACTIONLINT_SHA256: 8aca8db96f1b94770f1b0d72b6dddcb1ebb8123cb3712530b08cc387b349a3d8
run: |
curl -fsSLo actionlint.tar.gz "https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}/actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz"
echo "${ACTIONLINT_SHA256} actionlint.tar.gz" | sha256sum -c -
tar -xzf actionlint.tar.gz actionlint && rm actionlint.tar.gz
./actionlint
- name: Run zizmor
uses: zizmorcore/zizmor-action@45d7276c9ca790aabd705e31ca99c6185c3e76dd # v0.8.1
env:
# renovate: datasource=github-releases depName=zizmorcore/zizmor
ZIZMOR_VERSION: 1.30.1
with:
advanced-security: false
annotations: true
version: ${{ env.ZIZMOR_VERSION }}

ci-required:
name: CI Required
runs-on: ubuntu-latest
timeout-minutes: 5
if: always()
needs:
- gitleaks
- workflow-policy
steps:
- name: Verify every needed job succeeded
env:
NEEDS_JSON: ${{ toJSON(needs) }}
run: |
set -eu
# Strict success-only semantics: a skipped or failed job fails the gate.
jq -r 'to_entries[] | if .value.result == "success" then "OK \(.key)" else "FAIL \(.key) (result=\(.value.result))" end' <<< "$NEEDS_JSON"
if jq -e '[ to_entries[] | select(.value.result != "success") ] | length > 0' <<< "$NEEDS_JSON" >/dev/null; then
echo ""
echo "::error::One or more required jobs did not succeed. CI gate failing."
exit 1
fi
echo ""
echo "All required jobs succeeded. CI gate passes."
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules/
.env
.env.*
!.env.example
dist/
coverage/
.vitest/
test-results/
7 changes: 7 additions & 0 deletions .gitleaks.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Gitleaks config. Extends the default rules. Nothing is allow-listed yet:
# each pull request that adds credential-shaped test fixtures allow-lists only
# what it needs here, with a comment explaining why.
title = "grimoire gitleaks"

[extend]
useDefault = true
16 changes: 16 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Contributing

Grimoire is developed in the open, through small pull requests into `main`.

- Keep each pull request focused on one change.
- Use [Conventional Commits](https://www.conventionalcommits.org/) for commit
and pull request titles (for example `feat: add page export`). Pull requests
are squash-merged, so the title becomes the commit message on `main`.
- Every change needs passing CI (the `CI Required` check) and one approval,
and all review threads must be resolved.
- Pull requests from outside the project are welcome, but reviews may take a
while.
- Never commit secrets or credentials.

To report a security issue, do not open a public issue: follow
[SECURITY.md](SECURITY.md).
31 changes: 31 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Security policy

## Status

Grimoire is in active development. It has not been deployed, released, or
audited. There are no supported versions yet; once releases exist, this file
will say which ones receive security fixes.

## Reporting a vulnerability

Report security issues privately with GitHub private vulnerability reporting:
open the **Security** tab of this repository and choose **Report a
vulnerability**. Please do not open a public issue or pull request before the
maintainers have had a reasonable opportunity to investigate.

Include a description of the problem, steps to reproduce it, and the commit you
tested.

## Scope

In scope:

- vulnerabilities in code or configuration in this repository;
- weaknesses in the CI workflows or other supply-chain tooling;
- secrets or credentials committed to the repository.

Out of scope:

- vulnerabilities in third-party dependencies with no effect on this project;
- issues that require an already compromised machine or account;
- general support requests.
63 changes: 63 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended",
"helpers:pinGitHubActionDigests"
],
"schedule": [
"at any time"
],
"prConcurrentLimit": 5,
"automerge": true,
"automergeType": "pr",
"automergeStrategy": "squash",
"platformAutomerge": true,
"lockFileMaintenance": {
"enabled": true,
"schedule": [
"before 4am on monday"
],
"automerge": false
},
"packageRules": [
{
"description": "0.x minor bumps can be breaking; keep manual",
"matchCurrentVersion": "/^v?0\\./",
"matchUpdateTypes": [
"minor"
],
"automerge": false
},
{
"description": "Major updates stay manual",
"matchUpdateTypes": [
"major"
],
"automerge": false
},
{
"description": "Pinned tool binaries carry a sha256 that must be bumped by hand in the same PR",
"matchDepNames": [
"gitleaks/gitleaks",
"rhysd/actionlint"
],
"automerge": false
}
],
"minimumReleaseAge": "3 days",
"internalChecksFilter": "strict",
"customManagers": [
{
"customType": "regex",
"description": "Version pins in workflow step env vars, e.g. the gitleaks binary (sha256 must be bumped in the same PR; the checksum step fails otherwise)",
"managerFilePatterns": ["/^\\.github/workflows/.+\\.ya?ml$/"],
"matchStrings": [
"# renovate: datasource=(?<datasource>\\S+) depName=(?<depName>\\S+)\\s+\\w+_VERSION: (?<currentValue>\\S+)"
],
"extractVersionTemplate": "^v?(?<version>.*)$"
}
],
"github-actions": {
"pinDigests": true
}
}