Merge 3057433586582c335f9b7ab609adbe333fbe6f0b into fa3fbfb0a562be8b52d7f7a473adf6875c6eb58c

This commit is contained in:
Jason Cameron 2025-07-09 18:22:23 +01:00 committed by GitHub
commit a26c02ba34
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 1147 additions and 3 deletions

View File

@ -176,7 +176,7 @@ licend
licstart
lightpanda
LIMSA
Linting
linting
linuxbrew
LLU
loadbalancer

View File

@ -0,0 +1,31 @@
name: Commit Lint
on: [push, pull_request]
permissions:
contents: read
jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
persist-credentials: false
- name: Setup node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
cache: npm
- name: Install commitlint
run: npm ci
- name: Validate current commit (last commit) with commitlint
if: github.event_name == 'push'
run: npx commitlint --last --verbose
- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose

1
.husky/commit-msg Executable file
View File

@ -0,0 +1 @@
npx --no -- commitlint --edit $1

27
commitlint.config.js Normal file
View File

@ -0,0 +1,27 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [
2,
'always',
[
'build',
'chore',
'ci',
'docs',
'feat',
'fix',
'perf',
'refactor',
'revert',
'style',
'test'
]
],
'subject-case': [2, 'never', ['pascal-case', 'upper-case']],
'subject-empty': [2, 'never'],
'subject-full-stop': [2, 'never', '.'],
'type-case': [2, 'always', 'lower-case'],
'type-empty': [2, 'never']
}
};

View File

@ -92,7 +92,10 @@ There are a bunch of other assorted features and fixes too:
- Add `COOKIE_SECURE` option to set the cookie [Secure flag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Cookies#block_access_to_your_cookies)
- Sets cookie defaults to use [SameSite: None](https://web.dev/articles/samesite-cookies-explained)
- Determine the `BIND_NETWORK`/`--bind-network` value from the bind address ([#677](https://github.com/TecharoHQ/anubis/issues/677)).
- Add conventional commit linting to enforce standardized commit message formatting across the project
- Fix OpenGraph passthrough with new policy definitions ([#717](https://github.com/TecharoHQ/anubis/issues/717))
- Determine the `BIND_NETWORK`/`--bind-network` value from the bind address ([#677](https://github.com/TecharoHQ/anubis/issues/677))
- Implement localization system. Find locale files in lib/localization/locales/.
- Implement a [development container](https://containers.dev/) manifest to make contributions easier.
- Fix dynamic cookie domains functionality ([#731](https://github.com/TecharoHQ/anubis/pull/731))
- Add option for custom cookie prefix ([#732](https://github.com/TecharoHQ/anubis/pull/732))

View File

@ -60,6 +60,43 @@ This builds a prod-ready container image with [ko](https://ko.build). If you wan
DOCKER_REPO=registry.host/org/repo DOCKER_METADATA_OUTPUT_TAGS=registry.host/org/repo:latest npm run container
```
## Commit linting
Anubis enforces [conventional commits](https://www.conventionalcommits.org/) to maintain consistent commit messages. The commit linting is automatically set up when you run:
```text
npm ci
```
### Commit message format
Commits must follow this format:
```text
type(scope): description
```
**Valid types:**
- `feat`: New features
- `fix`: Bug fixes
- `docs`: Documentation changes
- `style`: Code style changes (formatting, missing semicolons, etc.)
- `refactor`: Code refactoring without changing functionality
- `perf`: Performance improvements
- `test`: Adding or updating tests
- `build`: Build system changes
- `ci`: CI/CD configuration changes
- `chore`: Maintenance tasks
- `revert`: Reverting previous commits
**Examples:**
- `feat: add dark mode support`
- `fix(policy): resolve memory leak in challenge validation`
- `docs: update API documentation`
- `perf(hash): optimize SHA-256 hashing performance`
The commit hook will automatically validate your commit messages and prevent commits that don't follow the conventional format.
## Building packages
For more information, see [Building native packages is complicated](https://xeiaso.net/blog/2025/anubis-packaging/) and [#156: Debian, RPM, and binary tarball packages](https://github.com/TecharoHQ/anubis/issues/156).

1041
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -13,14 +13,18 @@
"dev": "npm run assets && go run ./cmd/anubis --use-remote-address --target http://localhost:3000",
"container": "npm run assets && go run ./cmd/containerbuild",
"package": "yeet",
"lint": "make lint"
"lint": "make lint",
"prepare": "husky"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@commitlint/cli": "^19.8.1",
"@commitlint/config-conventional": "^19.8.1",
"cssnano": "^7.0.7",
"cssnano-preset-advanced": "^7.0.7",
"esbuild": "^0.25.5",
"husky": "^9.1.7",
"playwright": "^1.52.0",
"postcss-cli": "^11.0.1",
"postcss-import": "^16.1.1",