Skip to content

Commit 959eef1

Browse files
authored
Merge pull request #1 from 398ja/develop
Fix admin defects, enable CI, and improve documentation and deployment
2 parents 23ce4c7 + e511830 commit 959eef1

43 files changed

Lines changed: 664 additions & 162 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.commitlintrc.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
extends: '@commitlint/config-conventional'
3+
4+
rules:
5+
# See: https://commitlint.js.org/reference/rules.html
6+
#
7+
# Rules are made up by a name and a configuration array. The configuration
8+
# array contains:
9+
#
10+
# * Severity [0..2]: 0 disable rule, 1 warning if violated, or 2 error if
11+
# violated
12+
# * Applicability [always|never]: never inverts the rule
13+
# * Value: value to use for this rule (if applicable)
14+
#
15+
# Run `npx commitlint --print-config` to see the current setting for all rules.
16+
17+
header-max-length: [2, always, 100] # Header can not exceed 100 chars
18+
19+
type-case: [2, always, lower-case] # Type must be lower case
20+
type-empty: [2, never] # Type must not be empty
21+
22+
# Supported conventional commit types
23+
type-enum: [2, always, [build, ci, chore, docs, feat, fix, perf, refactor, revert, style, test]]
24+
25+
scope-case: [2, always, lower-case] # Scope must be lower case
26+
27+
# Error if subject is one of these cases (encourages lower-case)
28+
subject-case: [2, never, [sentence-case, start-case, pascal-case, upper-case]]
29+
subject-empty: [2, never] # Subject must not be empty
30+
subject-full-stop: [2, never, "."] # Subject must not end with a period
31+
32+
body-leading-blank: [2, always] # Body must have a blank line before it
33+
body-max-line-length: [2, always, 100] # Body lines can not exceed 100 chars
34+
35+
footer-leading-blank: [2, always] # Footer must have a blank line before it
36+
footer-max-line-length: [2, always, 100] # Footer lines can not exceed 100 chars
37+
38+
# ------------------------------------------------------------
39+
# BREAKING CHANGES — guidance (informational; not enforced):
40+
#
41+
# How to mark a breaking change (either or both):
42+
# 1) Put "!" in the header after the type or scope, e.g.:
43+
# feat!: drop support for node 14
44+
# refactor(auth)!: remove legacy token flow
45+
#
46+
# 2) Add a footer that starts with:
47+
# BREAKING CHANGE: <short summary>
48+
# Follow with impact/migration details, each line ≤ 100 chars.
49+
#
50+
# This config already allows both patterns via @commitlint/config-conventional.
51+
# Note: commitlint cannot (in YAML) *require* a BREAKING CHANGE footer only
52+
# when "!" is used. If you need that kind of conditional enforcement, use a
53+
# JS config (*.cjs) with a custom rule.
54+
# ------------------------------------------------------------

.github/copilot-instructions.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# GitHub Copilot Instructions
2+
3+
This repository implements Bottin, a NIP-05 registry service for Nostr. When using GitHub Copilot, keep the following guidelines in mind:
4+
5+
## Commit Messages
6+
7+
- Use Conventional Commits as defined in [.commitlintrc.yml](../.commitlintrc.yml).
8+
- Allowed types: `build`, `ci`, `chore`, `docs`, `feat`, `fix`, `perf`, `refactor`, `revert`, `style`, `test`.
9+
- Header max 100 characters, lowercase type and scope.
10+
- Example: `feat(api): add domain verification endpoint`
11+
12+
## Code Guidelines
13+
14+
- Maintain Java 21 compatibility and update `pom.xml` for new dependencies.
15+
- Use Spring Boot conventions for controllers, services, and repositories.
16+
- Remove unused imports.
17+
- Run `mvn -q verify` before committing code.
18+
19+
## Protocol
20+
21+
- Follow the [NIP-05 specification](https://github.com/nostr-protocol/nips/blob/master/05.md) for identity verification endpoints.
22+
- The `/.well-known/nostr.json` endpoint must return valid NIP-05 responses.
23+
24+
## Pull Requests
25+
26+
- Ensure pull requests include a clear description and test results.
27+
- Reference related issues using `Closes #123` when applicable.
28+
- Document new features in the README or related docs.
29+
30+
These instructions help Copilot produce code that respects the repository's conventions and Nostr protocol requirements.

.github/dependabot.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
version: 2
2+
3+
# Private registries used by Dependabot
4+
registries:
5+
maven-releases:
6+
type: maven-repository
7+
url: https://maven.398ja.xyz/releases
8+
username: ${{secrets.MVN_USER}}
9+
password: ${{secrets.MVN_PASSWORD}}
10+
maven-snapshots:
11+
type: maven-repository
12+
url: https://maven.398ja.xyz/snapshots
13+
username: ${{secrets.MVN_USER}}
14+
password: ${{secrets.MVN_PASSWORD}}
15+
16+
updates:
17+
- package-ecosystem: "maven"
18+
directory: "/"
19+
schedule:
20+
interval: "weekly"
21+
open-pull-requests-limit: 5
22+
target-branch: "develop"
23+
- package-ecosystem: "github-actions"
24+
directory: "/"
25+
schedule:
26+
interval: "weekly"
27+
open-pull-requests-limit: 5
28+
target-branch: "develop"

.github/pull_request_template.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## Summary
2+
<!-- What motivated this change? -->
3+
4+
## What changed?
5+
<!-- Provide a concise summary of the changes. -->
6+
7+
## Breaking changes
8+
- [ ] BREAKING: this change introduces breaking API or behavior
9+
10+
## Review focus
11+
<!-- Highlight areas that need the most attention from reviewers. -->
12+
13+
## Checklist
14+
- [ ] Tests added or updated
15+
- [ ] `mvn -q verify` passes
16+
- [ ] Documentation updated (README, docs, etc.)
17+
- [ ] No unused imports

.github/workflows/ci.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v5
14+
- uses: actions/setup-java@v5
15+
with:
16+
java-version: '21'
17+
distribution: 'temurin'
18+
cache: 'maven'
19+
- name: Build with Maven
20+
run: mvn -q verify
21+
- name: Upload surefire reports
22+
if: always()
23+
uses: actions/upload-artifact@v4
24+
with:
25+
name: surefire-reports
26+
path: '**/target/surefire-reports'
27+
if-no-files-found: ignore
28+
- name: Upload JaCoCo coverage
29+
if: always()
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: jacoco-exec
33+
path: '**/target/jacoco.exec'
34+
if-no-files-found: ignore
35+
- name: Upload coverage to Codecov
36+
uses: codecov/codecov-action@v5
37+
with:
38+
files: '**/target/site/jacoco/jacoco.xml'
39+
token: ${{ secrets.CODECOV_TOKEN }}
40+
- name: Upload test results to Codecov
41+
if: ${{ !cancelled() }}
42+
uses: codecov/test-results-action@v1
43+
with:
44+
token: ${{ secrets.CODECOV_TOKEN }}
45+
files: '**/target/surefire-reports/*.xml'
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Conventional Commits
2+
3+
permissions:
4+
contents: read
5+
pull-requests: read
6+
7+
on:
8+
pull_request:
9+
branches:
10+
- main
11+
- develop
12+
13+
jobs:
14+
commit-lint:
15+
name: Verify Conventional Commits
16+
if: (github.event_name == 'pull_request' && !startsWith(github.event.pull_request.head.ref, 'release-please--'))
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v5
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Check Commit Messages
26+
uses: wagoid/commitlint-github-action@v6
27+
with:
28+
configFile: .commitlintrc.yml
29+
token: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Format
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
13+
formatting:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v5
17+
- name: Set up JDK 21
18+
uses: actions/setup-java@v5
19+
with:
20+
distribution: 'temurin'
21+
java-version: '21'
22+
- uses: axel-op/googlejavaformat-action@v4
23+
with:
24+
args: "--replace"
25+
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/qodana.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Qodana
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
- develop
9+
10+
jobs:
11+
qodana:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
checks: write
17+
steps:
18+
- uses: actions/checkout@v3
19+
with:
20+
ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit
21+
fetch-depth: 0 # a full history is required for pull request analysis
22+
- name: 'Qodana Scan'
23+
uses: JetBrains/qodana-action@v2025.2
24+
with:
25+
pr-mode: false
26+
env:
27+
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
28+
QODANA_ENDPOINT: 'https://qodana.cloud'

Dockerfile.admin

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ WORKDIR /app
3434
RUN addgroup -g 1000 bottin && \
3535
adduser -u 1000 -G bottin -s /bin/sh -D bottin
3636

37-
# Copy the built JAR
38-
COPY --from=builder /app/bottin-admin-ui/target/bottin-admin-ui-*.jar app.jar
37+
# Copy the built JAR (use the exec jar which is the repackaged Spring Boot jar)
38+
COPY --from=builder /app/bottin-admin-ui/target/bottin-admin-ui-*-exec.jar app.jar
3939

4040
# Set ownership
4141
RUN chown -R bottin:bottin /app

Dockerfile.web

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ WORKDIR /app
3434
RUN addgroup -g 1000 bottin && \
3535
adduser -u 1000 -G bottin -s /bin/sh -D bottin
3636

37-
# Copy the built JAR
38-
COPY --from=builder /app/bottin-web/target/bottin-web-*.jar app.jar
37+
# Copy the built JAR (use the exec jar which is the repackaged Spring Boot jar)
38+
COPY --from=builder /app/bottin-web/target/bottin-web-*-exec.jar app.jar
3939

4040
# Set ownership
4141
RUN chown -R bottin:bottin /app

0 commit comments

Comments
 (0)