20 Commits

Author SHA1 Message Date
minori 7107581007 deps: update @types/node to 25.2.3
Node.js CI / CI (pull_request) Successful in 32s
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m31s
2026-02-20 07:04:45 -08:00
minori f50c6dca18 deps: update @types/node to 25.2.2
Node.js CI / CI (pull_request) Successful in 31s
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m22s
2026-02-18 07:04:31 -08:00
minori 6c63f5a89d deps: update @types/node to 25.2.1
Node.js CI / CI (pull_request) Successful in 27s
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m34s
2026-02-15 07:04:31 -08:00
minori 17f0bf411d deps: update @types/node to 25.2.0
Node.js CI / CI (pull_request) Successful in 33s
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m27s
2026-02-12 07:04:33 -08:00
minori 3d05e0e61e deps: update @types/node to 25.1.0
Node.js CI / CI (pull_request) Successful in 47s
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 2m30s
2026-02-08 07:08:24 -08:00
minori 795b18a597 deps: update @types/node to 25.0.10
Node.js CI / CI (pull_request) Successful in 31s
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m34s
2026-02-04 08:24:17 -08:00
hikari c032951865 docs: update feedback section to use support forum
Node.js CI / CI (push) Successful in 23s
Security Scan and Upload / Security & DefectDojo Upload (push) Successful in 1m43s
2026-01-26 12:37:08 -08:00
naomi c128097f64 feat: automated upload of .gitea/workflows/ci.yml
Node.js CI / CI (push) Successful in 22s
Security Scan and Upload / Security & DefectDojo Upload (push) Successful in 56s
2025-12-22 19:42:23 +01:00
naomi c238207db8 feat: automated upload of .gitea/workflows/ci.yml
Node.js CI / CI (push) Has been cancelled
Security Scan and Upload / Security & DefectDojo Upload (push) Has been cancelled
2025-12-22 19:35:52 +01:00
naomi ead3bd18ad feat: automated upload of .gitea/workflows/ci.yml
Node.js CI / Lint and Test (push) Has been cancelled
Security Scan and Upload / Security & DefectDojo Upload (push) Has been cancelled
2025-12-22 19:25:40 +01:00
naomi 5d37ae0aa8 feat: automated upload of .npmrc
Node.js CI / Lint and Test (push) Has been cancelled
Security Scan and Upload / Security & DefectDojo Upload (push) Has been cancelled
2025-12-22 19:16:29 +01:00
naomi d2c3f3d77c feat: automated upload of .gitea/workflows/security.yml
Node.js CI / Lint and Test (push) Successful in 24s
Security Scan and Upload / Security & DefectDojo Upload (push) Successful in 1m7s
2025-12-18 03:08:21 +01:00
naomi adbc67390a feat: automated upload of .gitea/workflows/security.yml
Node.js CI / Lint and Test (push) Successful in 24s
Security Scan and Upload / Security & DefectDojo Upload (push) Successful in 1m0s
2025-12-17 23:26:21 +01:00
naomi b293b5673a feat: automated upload of .gitea/workflows/security.yml
Node.js CI / Lint and Test (push) Successful in 23s
Security Scan / Security Audit (push) Failing after 5m2s
2025-12-12 03:38:06 +01:00
naomi 0739efa7fa feat: automated upload of .gitea/workflows/security.yml
Node.js CI / Lint and Test (push) Successful in 21s
Security Scan / Trivy Security Scan (push) Failing after 4m46s
2025-12-11 20:12:10 +01:00
naomi 68b806ccba feat: avatar
Node.js CI / Lint and Test (push) Successful in 39s
2025-05-22 20:09:59 -07:00
naomi 6158fb73a6 chore: remove fediverse component (#2)
Node.js CI / Lint and Test (push) Successful in 47s
### Explanation

_No response_

### Issue

_No response_

### Attestations

- [x] I have read and agree to the [Code of Conduct](https://docs.nhcarrigan.com/community/coc/)
- [x] I have read and agree to the [Community Guidelines](https://docs.nhcarrigan.com/community/guide/).
- [x] My contribution complies with the [Contributor Covenant](https://docs.nhcarrigan.com/dev/covenant/).

### Dependencies

- [x] I have pinned the dependencies to a specific patch version.

### Style

- [x] I have run the linter and resolved any errors.
- [x] My pull request uses an appropriate title, matching the conventional commit standards.
- [x] My scope of feat/fix/chore/etc. correctly matches the nature of changes in my pull request.

### Tests

- [ ] My contribution adds new code, and I have added tests to cover it.
- [ ] My contribution modifies existing code, and I have updated the tests to reflect these changes.
- [ ] All new and existing tests pass locally with my changes.
- [ ] Code coverage remains at or above the configured threshold.

### Documentation

_No response_

### Versioning

_No response_

Reviewed-on: #2
Co-authored-by: Naomi Carrigan <commits@nhcarrigan.com>
Co-committed-by: Naomi Carrigan <commits@nhcarrigan.com>
2025-03-11 15:19:34 -07:00
naomi ad12241ad0 feat: add installation buttons
Node.js CI / Lint and Test (push) Successful in 47s
2025-03-07 12:04:42 -08:00
naomi deed8e6436 fix: forgot to gitignore prod
Node.js CI / Lint and Test (push) Successful in 41s
2025-03-07 11:55:11 -08:00
naomi 411a647d2d feat: initial prototype (#1)
Node.js CI / Lint and Test (push) Successful in 41s
### Explanation

_No response_

### Issue

_No response_

### Attestations

- [x] I have read and agree to the [Code of Conduct](https://docs.nhcarrigan.com/community/coc/)
- [x] I have read and agree to the [Community Guidelines](https://docs.nhcarrigan.com/community/guide/).
- [x] My contribution complies with the [Contributor Covenant](https://docs.nhcarrigan.com/dev/covenant/).

### Dependencies

- [x] I have pinned the dependencies to a specific patch version.

### Style

- [x] I have run the linter and resolved any errors.
- [x] My pull request uses an appropriate title, matching the conventional commit standards.
- [x] My scope of feat/fix/chore/etc. correctly matches the nature of changes in my pull request.

### Tests

- [ ] My contribution adds new code, and I have added tests to cover it.
- [ ] My contribution modifies existing code, and I have updated the tests to reflect these changes.
- [ ] All new and existing tests pass locally with my changes.
- [ ] Code coverage remains at or above the configured threshold.

### Documentation

_No response_

### Versioning

_No response_

Reviewed-on: #1
Co-authored-by: Naomi Carrigan <commits@nhcarrigan.com>
Co-committed-by: Naomi Carrigan <commits@nhcarrigan.com>
2025-03-07 11:54:07 -08:00
13 changed files with 348 additions and 236 deletions
+47
View File
@@ -0,0 +1,47 @@
name: Node.js CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
ci:
name: CI
runs-on: ubuntu-latest
steps:
- name: Checkout Source Files
uses: actions/checkout@v4
- name: Use Node.js v24
uses: actions/setup-node@v4
with:
node-version: 24
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 10
- name: Ensure Dependencies are Pinned
uses: naomi-lgbt/dependency-pin-check@main
with:
language: javascript
dev-dependencies: true
peer-dependencies: true
optional-dependencies: true
- name: Install Dependencies
run: pnpm install
- name: Lint Source Files
run: pnpm run lint
- name: Verify Build
run: pnpm run build
- name: Run Tests
run: pnpm run test
+177
View File
@@ -0,0 +1,177 @@
name: Security Scan and Upload
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 0 * * 1'
workflow_dispatch:
jobs:
security-audit:
name: Security & DefectDojo Upload
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout code
uses: actions/checkout@v4
# --- AUTO-SETUP PROJECT ---
- name: Ensure DefectDojo Product Exists
env:
DD_URL: ${{ secrets.DD_URL }}
DD_TOKEN: ${{ secrets.DD_TOKEN }}
PRODUCT_NAME: ${{ github.repository }}
PRODUCT_TYPE_ID: 1
run: |
sudo apt-get install jq -y > /dev/null
echo "Checking connection to $DD_URL..."
# Check if product exists - capture HTTP code to debug connection issues
RESPONSE=$(curl --write-out "%{http_code}" --silent --output /tmp/response.json \
-H "Authorization: Token $DD_TOKEN" \
"$DD_URL/api/v2/products/?name=$PRODUCT_NAME")
# If response is not 200, print error
if [ "$RESPONSE" != "200" ]; then
echo "::error::Failed to query DefectDojo. HTTP Code: $RESPONSE"
cat /tmp/response.json
exit 1
fi
COUNT=$(cat /tmp/response.json | jq -r '.count')
if [ "$COUNT" = "0" ]; then
echo "Creating product '$PRODUCT_NAME'..."
curl -s -X POST "$DD_URL/api/v2/products/" \
-H "Authorization: Token $DD_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "name": "'"$PRODUCT_NAME"'", "description": "Auto-created by Gitea Actions", "prod_type": '$PRODUCT_TYPE_ID' }'
else
echo "Product '$PRODUCT_NAME' already exists."
fi
# --- 1. TRIVY (Dependencies & Misconfig) ---
- name: Install Trivy
run: |
sudo apt-get install wget apt-transport-https gnupg lsb-release -y
wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | sudo apt-key add -
echo "deb https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main" | sudo tee -a /etc/apt/sources.list.d/trivy.list
sudo apt-get update && sudo apt-get install trivy -y
- name: Run Trivy (FS Scan)
run: |
trivy fs . --scanners vuln,misconfig --format json --output trivy-results.json --exit-code 0
- name: Upload Trivy to DefectDojo
env:
DD_URL: ${{ secrets.DD_URL }}
DD_TOKEN: ${{ secrets.DD_TOKEN }}
run: |
echo "Uploading Trivy results..."
# Generate today's date in YYYY-MM-DD format
TODAY=$(date +%Y-%m-%d)
HTTP_CODE=$(curl --write-out "%{http_code}" --output response.txt --silent -X POST "$DD_URL/api/v2/import-scan/" \
-H "Authorization: Token $DD_TOKEN" \
-F "active=true" \
-F "verified=true" \
-F "scan_type=Trivy Scan" \
-F "engagement_name=CI/CD Pipeline" \
-F "product_name=${{ github.repository }}" \
-F "scan_date=$TODAY" \
-F "auto_create_context=true" \
-F "file=@trivy-results.json")
if [[ "$HTTP_CODE" != "200" && "$HTTP_CODE" != "201" ]]; then
echo "::error::Upload Failed with HTTP $HTTP_CODE"
echo "--- SERVER RESPONSE ---"
cat response.txt
echo "-----------------------"
exit 1
else
echo "Upload Success!"
fi
# --- 2. GITLEAKS (Secrets) ---
- name: Install Gitleaks
run: |
wget -qO gitleaks.tar.gz https://github.com/gitleaks/gitleaks/releases/download/v8.18.0/gitleaks_8.18.0_linux_x64.tar.gz
tar -xzf gitleaks.tar.gz
sudo mv gitleaks /usr/local/bin/ && chmod +x /usr/local/bin/gitleaks
- name: Run Gitleaks
run: gitleaks detect --source . -v --report-path gitleaks-results.json --report-format json --no-git || true
- name: Upload Gitleaks to DefectDojo
env:
DD_URL: ${{ secrets.DD_URL }}
DD_TOKEN: ${{ secrets.DD_TOKEN }}
run: |
echo "Uploading Gitleaks results..."
TODAY=$(date +%Y-%m-%d)
HTTP_CODE=$(curl --write-out "%{http_code}" --output response.txt --silent -X POST "$DD_URL/api/v2/import-scan/" \
-H "Authorization: Token $DD_TOKEN" \
-F "active=true" \
-F "verified=true" \
-F "scan_type=Gitleaks Scan" \
-F "engagement_name=CI/CD Pipeline" \
-F "product_name=${{ github.repository }}" \
-F "scan_date=$TODAY" \
-F "auto_create_context=true" \
-F "file=@gitleaks-results.json")
if [[ "$HTTP_CODE" != "200" && "$HTTP_CODE" != "201" ]]; then
echo "::error::Upload Failed with HTTP $HTTP_CODE"
echo "--- SERVER RESPONSE ---"
cat response.txt
echo "-----------------------"
exit 1
else
echo "Upload Success!"
fi
# --- 3. SEMGREP (SAST) ---
- name: Install Semgrep (via pipx)
run: |
sudo apt-get install pipx -y
pipx install semgrep
# Add pipx binary path to GITHUB_PATH so next steps can see 'semgrep'
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Run Semgrep
run: semgrep scan --config=p/security-audit --config=p/owasp-top-ten --json --output semgrep-results.json . || true
- name: Upload Semgrep to DefectDojo
env:
DD_URL: ${{ secrets.DD_URL }}
DD_TOKEN: ${{ secrets.DD_TOKEN }}
run: |
echo "Uploading Semgrep results..."
TODAY=$(date +%Y-%m-%d)
HTTP_CODE=$(curl --write-out "%{http_code}" --output response.txt --silent -X POST "$DD_URL/api/v2/import-scan/" \
-H "Authorization: Token $DD_TOKEN" \
-F "active=true" \
-F "verified=true" \
-F "scan_type=Semgrep JSON Report" \
-F "engagement_name=CI/CD Pipeline" \
-F "product_name=${{ github.repository }}" \
-F "scan_date=$TODAY" \
-F "auto_create_context=true" \
-F "file=@semgrep-results.json")
if [[ "$HTTP_CODE" != "200" && "$HTTP_CODE" != "201" ]]; then
echo "::error::Upload Failed with HTTP $HTTP_CODE"
echo "--- SERVER RESPONSE ---"
cat response.txt
echo "-----------------------"
exit 1
else
echo "Upload Success!"
fi
+1
View File
@@ -1 +1,2 @@
node_modules
prod
+25
View File
@@ -0,0 +1,25 @@
# Package Manager Configuration
# Force pnpm usage - breaks npm/yarn intentionally
node-linker=pnpm
# Security: Disable all lifecycle scripts
ignore-scripts=true
enable-pre-post-scripts=false
# Security: Require packages to be 10+ days old before installation
minimum-release-age=14400
# Security: Verify package integrity hashes
verify-store-integrity=true
# Security: Enforce strict trust policies
trust-policy=strict
# Security: Strict peer dependency resolution
strict-peer-dependencies=true
# Performance: Use symlinks for node_modules
symlink=true
# Lockfile: Ensure lockfile is not modified during install
frozen-lockfile=false
+1 -1
View File
@@ -18,7 +18,7 @@ This page is currently deployed. [View the live website.]
## Feedback and Bugs
If you have feedback or a bug report, please feel free to open a GitHub issue!
If you have feedback or a bug report, please [log a ticket on our forum](https://support.nhcarrigan.com).
## Contributing
+2 -2
View File
@@ -9,7 +9,7 @@
"dev": "tsx watch src/index.ts",
"lint": "eslint src --max-warnings 0",
"start": "op run --env-file=prod.env --no-masking -- node prod/index.js",
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 0"
},
"keywords": [],
"author": "Naomi Carrigan",
@@ -17,7 +17,7 @@
"devDependencies": {
"@nhcarrigan/eslint-config": "5.2.0",
"@nhcarrigan/typescript-config": "4.0.0",
"@types/node": "22.13.9",
"@types/node": "25.2.3",
"@types/node-schedule": "2.1.7",
"eslint": "9.21.0",
"typescript": "5.8.2"
+48 -38
View File
@@ -35,13 +35,13 @@ importers:
devDependencies:
'@nhcarrigan/eslint-config':
specifier: 5.2.0
version: 5.2.0(@typescript-eslint/utils@8.26.0(eslint@9.21.0)(typescript@5.8.2))(eslint@9.21.0)(playwright@1.51.0)(react@19.0.0)(typescript@5.8.2)(vitest@3.0.8(@types/node@22.13.9))
version: 5.2.0(@typescript-eslint/utils@8.26.0(eslint@9.21.0)(typescript@5.8.2))(eslint@9.21.0)(playwright@1.51.0)(react@19.0.0)(typescript@5.8.2)(vitest@3.0.8(@types/node@25.2.3))
'@nhcarrigan/typescript-config':
specifier: 4.0.0
version: 4.0.0(typescript@5.8.2)
'@types/node':
specifier: 22.13.9
version: 22.13.9
specifier: 25.2.3
version: 25.2.3
'@types/node-schedule':
specifier: 2.1.7
version: 2.1.7
@@ -426,51 +426,61 @@ packages:
resolution: {integrity: sha512-88I+D3TeKItrw+Y/2ud4Tw0+3CxQ2kLgu3QvrogZ0OfkmX/DEppehus7L3TS2Q4lpB+hYyxhkQiYPJ6Mf5/dPg==}
cpu: [arm]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-arm-musleabihf@4.34.9':
resolution: {integrity: sha512-3qyfWljSFHi9zH0KgtEPG4cBXHDFhwD8kwg6xLfHQ0IWuH9crp005GfoUUh/6w9/FWGBwEHg3lxK1iHRN1MFlA==}
cpu: [arm]
os: [linux]
libc: [musl]
'@rollup/rollup-linux-arm64-gnu@4.34.9':
resolution: {integrity: sha512-6TZjPHjKZUQKmVKMUowF3ewHxctrRR09eYyvT5eFv8w/fXarEra83A2mHTVJLA5xU91aCNOUnM+DWFMSbQ0Nxw==}
cpu: [arm64]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-arm64-musl@4.34.9':
resolution: {integrity: sha512-LD2fytxZJZ6xzOKnMbIpgzFOuIKlxVOpiMAXawsAZ2mHBPEYOnLRK5TTEsID6z4eM23DuO88X0Tq1mErHMVq0A==}
cpu: [arm64]
os: [linux]
libc: [musl]
'@rollup/rollup-linux-loongarch64-gnu@4.34.9':
resolution: {integrity: sha512-dRAgTfDsn0TE0HI6cmo13hemKpVHOEyeciGtvlBTkpx/F65kTvShtY/EVyZEIfxFkV5JJTuQ9tP5HGBS0hfxIg==}
cpu: [loong64]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-powerpc64le-gnu@4.34.9':
resolution: {integrity: sha512-PHcNOAEhkoMSQtMf+rJofwisZqaU8iQ8EaSps58f5HYll9EAY5BSErCZ8qBDMVbq88h4UxaNPlbrKqfWP8RfJA==}
cpu: [ppc64]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-riscv64-gnu@4.34.9':
resolution: {integrity: sha512-Z2i0Uy5G96KBYKjeQFKbbsB54xFOL5/y1P5wNBsbXB8yE+At3oh0DVMjQVzCJRJSfReiB2tX8T6HUFZ2k8iaKg==}
cpu: [riscv64]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-s390x-gnu@4.34.9':
resolution: {integrity: sha512-U+5SwTMoeYXoDzJX5dhDTxRltSrIax8KWwfaaYcynuJw8mT33W7oOgz0a+AaXtGuvhzTr2tVKh5UO8GVANTxyQ==}
cpu: [s390x]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-x64-gnu@4.34.9':
resolution: {integrity: sha512-FwBHNSOjUTQLP4MG7y6rR6qbGw4MFeQnIBrMe161QGaQoBQLqSUEKlHIiVgF3g/mb3lxlxzJOpIBhaP+C+KP2A==}
cpu: [x64]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-x64-musl@4.34.9':
resolution: {integrity: sha512-cYRpV4650z2I3/s6+5/LONkjIz8MBeqrk+vPXV10ORBnshpn8S32bPqQ2Utv39jCiDcO2eJTuSlPXpnvmaIgRA==}
cpu: [x64]
os: [linux]
libc: [musl]
'@rollup/rollup-win32-arm64-msvc@4.34.9':
resolution: {integrity: sha512-z4mQK9dAN6byRA/vsSgQiPeuO63wdiDxZ9yg9iyX2QTzKuQM7T4xlBoeUP/J8uiFkqxkcWndWi+W7bXdPbt27Q==}
@@ -570,8 +580,8 @@ packages:
'@types/node-schedule@2.1.7':
resolution: {integrity: sha512-G7Z3R9H7r3TowoH6D2pkzUHPhcJrDF4Jz1JOQ80AX0K2DWTHoN9VC94XzFAPNMdbW9TBzMZ3LjpFi7RYdbxtXA==}
'@types/node@22.13.9':
resolution: {integrity: sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw==}
'@types/node@25.2.3':
resolution: {integrity: sha512-m0jEgYlYz+mDJZ2+F4v8D1AyQb+QzsNqRuI7xg1VQX/KlKS0qT9r1Mo16yo5F/MtifXFgaofIFsdFMox2SxIbQ==}
'@types/normalize-package-data@2.4.4':
resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==}
@@ -2441,8 +2451,8 @@ packages:
resolution: {integrity: sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==}
engines: {node: '>= 0.4'}
undici-types@6.20.0:
resolution: {integrity: sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==}
undici-types@7.16.0:
resolution: {integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==}
undici@6.21.1:
resolution: {integrity: sha512-q/1rj5D0/zayJB2FraXdaWxbhWiNKDvu8naDT2dl1yTlvJp4BLtOcp2a5BvgGNQpYYJzau7tf1WgKv3b+7mqpQ==}
@@ -2874,7 +2884,7 @@ snapshots:
'@jridgewell/sourcemap-codec@1.5.0': {}
'@nhcarrigan/eslint-config@5.2.0(@typescript-eslint/utils@8.26.0(eslint@9.21.0)(typescript@5.8.2))(eslint@9.21.0)(playwright@1.51.0)(react@19.0.0)(typescript@5.8.2)(vitest@3.0.8(@types/node@22.13.9))':
'@nhcarrigan/eslint-config@5.2.0(@typescript-eslint/utils@8.26.0(eslint@9.21.0)(typescript@5.8.2))(eslint@9.21.0)(playwright@1.51.0)(react@19.0.0)(typescript@5.8.2)(vitest@3.0.8(@types/node@25.2.3))':
dependencies:
'@eslint-community/eslint-plugin-eslint-comments': 4.4.1(eslint@9.21.0)
'@eslint/compat': 1.2.4(eslint@9.21.0)
@@ -2883,7 +2893,7 @@ snapshots:
'@stylistic/eslint-plugin': 2.12.1(eslint@9.21.0)(typescript@5.8.2)
'@typescript-eslint/eslint-plugin': 8.19.0(@typescript-eslint/parser@8.19.0(eslint@9.21.0)(typescript@5.8.2))(eslint@9.21.0)(typescript@5.8.2)
'@typescript-eslint/parser': 8.19.0(eslint@9.21.0)(typescript@5.8.2)
'@vitest/eslint-plugin': 1.1.24(@typescript-eslint/utils@8.26.0(eslint@9.21.0)(typescript@5.8.2))(eslint@9.21.0)(typescript@5.8.2)(vitest@3.0.8(@types/node@22.13.9))
'@vitest/eslint-plugin': 1.1.24(@typescript-eslint/utils@8.26.0(eslint@9.21.0)(typescript@5.8.2))(eslint@9.21.0)(typescript@5.8.2)(vitest@3.0.8(@types/node@25.2.3))
eslint: 9.21.0
eslint-plugin-deprecation: 3.0.0(eslint@9.21.0)(typescript@5.8.2)
eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.19.0(eslint@9.21.0)(typescript@5.8.2))(eslint@9.21.0)
@@ -2896,7 +2906,7 @@ snapshots:
playwright: 1.51.0
react: 19.0.0
typescript: 5.8.2
vitest: 3.0.8(@types/node@22.13.9)
vitest: 3.0.8(@types/node@25.2.3)
transitivePeerDependencies:
- '@typescript-eslint/utils'
- eslint-import-resolver-typescript
@@ -3012,14 +3022,14 @@ snapshots:
'@slack/logger@4.0.0':
dependencies:
'@types/node': 22.13.9
'@types/node': 25.2.3
'@slack/oauth@3.0.2':
dependencies:
'@slack/logger': 4.0.0
'@slack/web-api': 7.8.0
'@types/jsonwebtoken': 9.0.9
'@types/node': 22.13.9
'@types/node': 25.2.3
jsonwebtoken: 9.0.2
lodash.isstring: 4.0.1
transitivePeerDependencies:
@@ -3029,7 +3039,7 @@ snapshots:
dependencies:
'@slack/logger': 4.0.0
'@slack/web-api': 7.8.0
'@types/node': 22.13.9
'@types/node': 25.2.3
'@types/ws': 8.18.0
eventemitter3: 5.0.1
ws: 8.18.1
@@ -3044,7 +3054,7 @@ snapshots:
dependencies:
'@slack/logger': 4.0.0
'@slack/types': 2.14.0
'@types/node': 22.13.9
'@types/node': 25.2.3
'@types/retry': 0.12.0
axios: 1.8.2
eventemitter3: 5.0.1
@@ -3072,17 +3082,17 @@ snapshots:
'@types/body-parser@1.19.5':
dependencies:
'@types/connect': 3.4.38
'@types/node': 22.13.9
'@types/node': 25.2.3
'@types/connect@3.4.38':
dependencies:
'@types/node': 22.13.9
'@types/node': 25.2.3
'@types/estree@1.0.6': {}
'@types/express-serve-static-core@5.0.6':
dependencies:
'@types/node': 22.13.9
'@types/node': 25.2.3
'@types/qs': 6.9.18
'@types/range-parser': 1.2.7
'@types/send': 0.17.4
@@ -3103,7 +3113,7 @@ snapshots:
'@types/jsonwebtoken@9.0.9':
dependencies:
'@types/ms': 2.1.0
'@types/node': 22.13.9
'@types/node': 25.2.3
'@types/mime@1.3.5': {}
@@ -3111,11 +3121,11 @@ snapshots:
'@types/node-schedule@2.1.7':
dependencies:
'@types/node': 22.13.9
'@types/node': 25.2.3
'@types/node@22.13.9':
'@types/node@25.2.3':
dependencies:
undici-types: 6.20.0
undici-types: 7.16.0
'@types/normalize-package-data@2.4.4': {}
@@ -3128,17 +3138,17 @@ snapshots:
'@types/send@0.17.4':
dependencies:
'@types/mime': 1.3.5
'@types/node': 22.13.9
'@types/node': 25.2.3
'@types/serve-static@1.15.7':
dependencies:
'@types/http-errors': 2.0.4
'@types/node': 22.13.9
'@types/node': 25.2.3
'@types/send': 0.17.4
'@types/ws@8.18.0':
dependencies:
'@types/node': 22.13.9
'@types/node': 25.2.3
'@typescript-eslint/eslint-plugin@8.19.0(@typescript-eslint/parser@8.19.0(eslint@9.21.0)(typescript@5.8.2))(eslint@9.21.0)(typescript@5.8.2)':
dependencies:
@@ -3292,13 +3302,13 @@ snapshots:
'@typescript-eslint/types': 8.26.0
eslint-visitor-keys: 4.2.0
'@vitest/eslint-plugin@1.1.24(@typescript-eslint/utils@8.26.0(eslint@9.21.0)(typescript@5.8.2))(eslint@9.21.0)(typescript@5.8.2)(vitest@3.0.8(@types/node@22.13.9))':
'@vitest/eslint-plugin@1.1.24(@typescript-eslint/utils@8.26.0(eslint@9.21.0)(typescript@5.8.2))(eslint@9.21.0)(typescript@5.8.2)(vitest@3.0.8(@types/node@25.2.3))':
dependencies:
'@typescript-eslint/utils': 8.26.0(eslint@9.21.0)(typescript@5.8.2)
eslint: 9.21.0
optionalDependencies:
typescript: 5.8.2
vitest: 3.0.8(@types/node@22.13.9)
vitest: 3.0.8(@types/node@25.2.3)
'@vitest/expect@3.0.8':
dependencies:
@@ -3307,13 +3317,13 @@ snapshots:
chai: 5.2.0
tinyrainbow: 2.0.0
'@vitest/mocker@3.0.8(vite@6.2.1(@types/node@22.13.9))':
'@vitest/mocker@3.0.8(vite@6.2.1(@types/node@25.2.3))':
dependencies:
'@vitest/spy': 3.0.8
estree-walker: 3.0.3
magic-string: 0.30.17
optionalDependencies:
vite: 6.2.1(@types/node@22.13.9)
vite: 6.2.1(@types/node@25.2.3)
'@vitest/pretty-format@3.0.8':
dependencies:
@@ -5329,7 +5339,7 @@ snapshots:
has-symbols: 1.1.0
which-boxed-primitive: 1.1.1
undici-types@6.20.0: {}
undici-types@7.16.0: {}
undici@6.21.1: {}
@@ -5354,13 +5364,13 @@ snapshots:
vary@1.1.2: {}
vite-node@3.0.8(@types/node@22.13.9):
vite-node@3.0.8(@types/node@25.2.3):
dependencies:
cac: 6.7.14
debug: 4.4.0
es-module-lexer: 1.6.0
pathe: 2.0.3
vite: 6.2.1(@types/node@22.13.9)
vite: 6.2.1(@types/node@25.2.3)
transitivePeerDependencies:
- '@types/node'
- jiti
@@ -5375,19 +5385,19 @@ snapshots:
- tsx
- yaml
vite@6.2.1(@types/node@22.13.9):
vite@6.2.1(@types/node@25.2.3):
dependencies:
esbuild: 0.25.0
postcss: 8.5.3
rollup: 4.34.9
optionalDependencies:
'@types/node': 22.13.9
'@types/node': 25.2.3
fsevents: 2.3.3
vitest@3.0.8(@types/node@22.13.9):
vitest@3.0.8(@types/node@25.2.3):
dependencies:
'@vitest/expect': 3.0.8
'@vitest/mocker': 3.0.8(vite@6.2.1(@types/node@22.13.9))
'@vitest/mocker': 3.0.8(vite@6.2.1(@types/node@25.2.3))
'@vitest/pretty-format': 3.0.8
'@vitest/runner': 3.0.8
'@vitest/snapshot': 3.0.8
@@ -5403,11 +5413,11 @@ snapshots:
tinyexec: 0.3.2
tinypool: 1.0.2
tinyrainbow: 2.0.0
vite: 6.2.1(@types/node@22.13.9)
vite-node: 3.0.8(@types/node@22.13.9)
vite: 6.2.1(@types/node@25.2.3)
vite-node: 3.0.8(@types/node@25.2.3)
why-is-node-running: 2.3.0
optionalDependencies:
'@types/node': 22.13.9
'@types/node': 25.2.3
transitivePeerDependencies:
- jiti
- less
-62
View File
@@ -1,62 +0,0 @@
/**
* @copyright nhcarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
import { AtpAgent } from "@atproto/api";
import pkg from "@slack/bolt";
import { Client, Events } from "discord.js";
import { scheduleJob } from "node-schedule";
import { serve } from "./server/serve.js";
import { getMommy } from "./utils/getMommy.js";
import { logger } from "./utils/logger.js";
const { App, FileInstallationStore } = pkg;
const discord = new Client({ intents: [] });
discord.on(Events.ClientReady, () => {
void logger.log("info", "Connected to Discord!");
});
// eslint-disable-next-line @typescript-eslint/no-misused-promises -- This is intentional.
discord.on(Events.InteractionCreate, async (interaction) => {
if (!interaction.isChatInputCommand()) {
return;
}
await interaction.deferReply();
const name = interaction.options.getString("name");
const response = await getMommy(name ?? undefined);
await interaction.editReply(response);
});
const slack = new App({
clientId: process.env.SLACK_CLIENT_ID ?? "",
clientSecret: process.env.SLACK_CLIENT_SECRET ?? "",
installationStore: new FileInstallationStore(),
installerOptions: {
directInstall: true,
},
scopes: ["commands", "chat:write"],
signingSecret: process.env.SLACK_SIGNING_SECRET ?? "",
stateSecret: process.env.SLACK_STATE_SECRET ?? "",
});
slack.command("/mommy", async ({ ack, body, respond }) => {
await ack();
const response = await getMommy(body.text);
await respond(response);
});
const bsky = new AtpAgent({
service: "https://bsky.social",
});
await discord.login(process.env.DISCORD_TOKEN);
await slack.start(8010);
await logger.log("info", "Connected to Slack!");
await bsky.login({
identifier: "mommy.naomi.party",
password: process.env.BSKY_PASSWORD ?? "",
});
await logger.log("info", "Connected to bsky.social!");
scheduleJob("0 9 * * *", async () => {
const response = await getMommy();
await bsky.post({
text: response,
});
await logger.log("info", "Posted to bsky.social!");
});
serve();
-72
View File
@@ -1,72 +0,0 @@
/**
* @copyright nhcarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
import fastify from "fastify";
import { logger } from "../utils/logger.js";
const html = `<!DOCTYPE html>
<html>
<head>
<title>Mommy Bot</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="Mommy loves you~!" />
<script src="https://cdn.nhcarrigan.com/headers/index.js" async defer></script>
</head>
<body>
<main>
<h1>Mommy Bot</h1>
<section>
<p>Mommy loves you~!</p>
<a href="https://slack.com/oauth/v2/authorize?client_id=8569765106322.8554301974567&scope=chat:write,commands&user_scope="><img alt="Add to Slack" height="40" width="139" src="https://platform.slack-edge.com/img/add_to_slack.png" srcSet="https://platform.slack-edge.com/img/add_to_slack.png 1x, https://platform.slack-edge.com/img/add_to_slack@2x.png 2x" /></a>
</section>
<section>
<h2>Links</h2>
<p>
<a href="https://git.nhcarrigan.com/nhcarrigan/mommy-bot">
<i class="fa-solid fa-code"></i> Source Code
</a>
</p>
<p>
<a href="https://docs.nhcarrigan.com/">
<i class="fa-solid fa-book"></i> Documentation
</a>
</p>
<p>
<a href="https://chat.nhcarrigan.com">
<i class="fa-solid fa-circle-info"></i> Support
</a>
</p>
</section>
</main>
</body>
</html>`;
/**
* Starts up a web server for health monitoring.
*/
export const serve = () => {
try {
const server = fastify({
logger: false,
});
server.get("/", (_request, response) => {
response.header("Content-Type", "text/html");
response.send(html);
});
server.listen({ port: 8009 }, (error) => {
if (error) {
void logger.error("instantiate server", error);
return;
}
void logger.log("debug", "Server listening on port 8009.");
});
}
catch (error) {
if (error instanceof Error) {
void logger.error("instantiate server", error);
return;
}
void logger.error("instantiate server", new Error("Unknown error"));
}
};
-20
View File
@@ -1,20 +0,0 @@
/**
* @copyright nhcarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
import { isProfane } from "no-profanity";
/**
* Fetches a mommy quote from the API.
* @param name - The user's name, if provided.
* @returns The mommy quote.
*/
export const getMommy = async (name = "dear") => {
const finalName = isProfane(name)
? "dear"
: name;
const url = `https://mommy.nhcarrigan.com/api?name=${finalName}`;
const request = await fetch(url);
const response = await request.text();
return response;
};
-7
View File
@@ -1,7 +0,0 @@
/**
* @copyright nhcarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
import { Logger } from "@nhcarrigan/logger";
export const logger = new Logger("Mommy", process.env.LOG_TOKEN ?? "");
+7 -6
View File
@@ -6,12 +6,13 @@
import { AtpAgent } from "@atproto/api";
import pkg from "@slack/bolt";
import { Client, Events } from "discord.js";
import { Client, Events, MessageFlags } from "discord.js";
import { scheduleJob } from "node-schedule";
import { serve } from "./server/serve.js";
import { getMommy } from "./utils/getMommy.js";
import { logger } from "./utils/logger.js";
// eslint-disable-next-line @typescript-eslint/naming-convention -- Classes.
const { App, FileInstallationStore } = pkg;
const discord = new Client({ intents: [ ] });
@@ -25,7 +26,7 @@ discord.on(Events.InteractionCreate, async(interaction) => {
if (!interaction.isChatInputCommand()) {
return;
}
await interaction.deferReply();
await interaction.deferReply({ flags: MessageFlags.Ephemeral });
const name = interaction.options.getString("name");
const response = await getMommy(name ?? undefined);
await interaction.editReply(response);
@@ -38,19 +39,19 @@ const slack = new App({
installerOptions: {
directInstall: true,
},
scopes: [ "commands", "chat:write" ],
scopes: [ "commands" ],
signingSecret: process.env.SLACK_SIGNING_SECRET ?? "",
stateSecret: process.env.SLACK_STATE_SECRET ?? "",
});
slack.command("/mommy", async({ ack, body, say }) => {
slack.command("/mommy", async({ ack, body, respond }) => {
await ack();
const trimmed = body.text.trim();
const name = trimmed.length > 0
? trimmed
: undefined;
const response = await getMommy(name);
await say(response);
await respond(response);
});
const bsky = new AtpAgent({
@@ -73,7 +74,7 @@ scheduleJob("0 9 * * *", async() => {
await bsky.post({
text: response,
});
await logger.log("info", "Posted to bsky.social!");
await logger.log("info", "Posted to bsky!");
});
serve();
+40 -28
View File
@@ -9,40 +9,52 @@ import { logger } from "../utils/logger.js";
const html = `<!DOCTYPE html>
<html>
<head>
<title>Mommy Bot</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="Mommy loves you~!" />
<script src="https://cdn.nhcarrigan.com/headers/index.js" async defer></script>
</head>
<body>
<main>
<head>
<title>Mommy Bot</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="Mommy loves you~!" />
<script src="https://cdn.nhcarrigan.com/headers/index.js" async defer></script>
</head>
<body>
<main>
<h1>Mommy Bot</h1>
<img src="https://cdn.nhcarrigan.com/new-avatars/mommy-full.png" width="250" alt="Mommy" />
<section>
<p>Mommy loves you~!</p>
<a href="https://mommy-slack.nhcarrigan.com/slack/install"><img alt="Add to Slack" height="40" width="139" src="https://platform.slack-edge.com/img/add_to_slack.png" srcSet="https://platform.slack-edge.com/img/add_to_slack.png 1x, https://platform.slack-edge.com/img/add_to_slack@2x.png 2x" /></a>
<a href="https://mommy-slack.nhcarrigan.com/slack/install" style="display: inline-block; background-color: #ffffff; color: black; padding: 10px 20px; text-decoration: none; border-radius: 4px; margin: 5px;">
<i class="fab fa-slack"></i> Add to Slack
</a>
<a href="https://discord.com/oauth2/authorize?client_id=1347642447643017289" class="social-button discord-button" style="display: inline-block; background-color: #5865F2; color: white; padding: 10px 20px; text-decoration: none; border-radius: 4px; margin: 5px;">
<i class="fab fa-discord"></i> Add to Discord
</a>
<a href="https://bsky.app/profile/mommy.naomi.party" class="social-button bluesky-button" style="display: inline-block; background-color: #0085FF; color: white; padding: 10px 20px; text-decoration: none; border-radius: 4px; margin: 5px;">
<i class="fab fa-bluesky"></i> Follow on Bluesky
</a>
</section>
<section>
<h2>Links</h2>
<p>
<a href="https://git.nhcarrigan.com/nhcarrigan/mommy-bot">
<i class="fa-solid fa-code"></i> Source Code
</a>
</p>
<p>
<a href="https://docs.nhcarrigan.com/">
<i class="fa-solid fa-book"></i> Documentation
</a>
</p>
<p>
<a href="https://chat.nhcarrigan.com">
<i class="fa-solid fa-circle-info"></i> Support
</a>
</p>
<h2>Links</h2>
<p>
<a href="https://git.nhcarrigan.com/nhcarrigan/mommy-bot">
<i class="fa-solid fa-code"></i> Source Code
</a>
</p>
<p>
<a href="https://docs.nhcarrigan.com/">
<i class="fa-solid fa-book"></i> Documentation
</a>
</p>
<p>
<a href="https://chat.nhcarrigan.com">
<i class="fa-solid fa-circle-info"></i> Support
</a>
</p>
</section>
</main>
</body>
</main>
</body>
</html>`;
/**