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
28 changes: 8 additions & 20 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
# ─────────────────────────────────────────────────────────────
# AntiLink — environment configuration
# Copy this file to `.env` and fill in your values.
# NEVER commit your real .env file or bot token.
# ─────────────────────────────────────────────────────────────

# Required: your Discord bot token (Developer Portal → Bot → Token)
DISCORD_TOKEN=

# Optional: Discord webhook URL for moderation logs.
# Leave blank to disable webhook logging.
WEBHOOK_URL=

# Optional: comma-separated channel IDs where links are always allowed.
# Example: WHITELISTED_CHANNEL_IDS=123456789012345678,234567890123456789
WHITELISTED_CHANNEL_IDS=

# Optional: comma-separated role IDs whose members bypass link filtering.
# Example: IGNORED_ROLE_IDS=345678901234567890
IGNORED_ROLE_IDS=
# AntiLink Guard OSS - this is a pnpm monorepo; environment configuration is
# per-app, not shared at the repository root.
#
# - Running the bot? see apps/example-bot/.env.example
# - Running the dashboard? see apps/dashboard-lite/.env.example
#
# Copy the relevant file to a real `.env` in that same app directory and fill
# it in. Never commit a real `.env` file or bot token.
32 changes: 23 additions & 9 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,40 @@
name: "🐛 Bug Report"
description: Report a problem with the AntiLink open-source bot
title: "[Bug]: "
labels: ["bug", "needs-triage"]
name: '🐛 Bug Report'
description: Report a problem with AntiLink Guard OSS
title: '[Bug]: '
labels: ['bug', 'needs-triage']
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to file a bug report! Please fill out the
sections below so we can reproduce and fix the issue quickly.

⚠️ **Do not** include your bot token, webhook URL, or any secrets.
⚠️ **Do not** include your bot token, database credentials, or any secrets.
- type: checkboxes
id: preflight
attributes:
label: Preflight checklist
options:
- label: I searched existing issues and this has not been reported.
required: true
- label: I am running a supported Node.js version (18+).
- label: I am running a supported Node.js version (20+).
required: true
- label: This is not a security vulnerability (those go to SECURITY.md).
required: true
- type: dropdown
id: package
attributes:
label: Affected package or app
options:
- '@antilink-guard/core'
- '@antilink-guard/storage'
- '@antilink-guard/discord-bot'
- '@antilink-guard/cli'
- 'apps/example-bot'
- 'apps/dashboard-lite'
- Not sure
validations:
required: true
- type: textarea
id: description
attributes:
Expand Down Expand Up @@ -55,16 +69,16 @@ body:
id: node-version
attributes:
label: Node.js version
placeholder: "e.g. 20.11.0"
placeholder: 'e.g. 20.11.0'
validations:
required: true
- type: input
id: djs-version
attributes:
label: discord.js version
placeholder: "e.g. 14.x"
placeholder: 'e.g. 14.x'
- type: input
id: os
attributes:
label: Operating system
placeholder: "e.g. Ubuntu 22.04, Windows 11"
placeholder: 'e.g. Ubuntu 22.04, Windows 11'
9 changes: 3 additions & 6 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: 💬 Community & Support (Discord)
url: https://support.antil.ink/
about: Questions, setup help, and general discussion in the AntiLink support server.
- name: 📖 Documentation
url: https://antil.ink/docs
about: Guides and configuration reference.
url: https://github.com/timeout187/antilink-guard/tree/main/docs
about: Guides and configuration reference (getting started, self-hosting, rules engine, and more).
- name: 🔒 Report a security vulnerability
url: https://github.com/timeout187/Anti-Links-Discord-Bot/security/advisories/new
url: https://github.com/timeout187/antilink-guard/security/advisories/new
about: Please report vulnerabilities privately — never in public issues.
15 changes: 7 additions & 8 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
name: "💡 Feature Request"
description: Suggest an idea or improvement for the open-source bot
title: "[Feature]: "
labels: ["enhancement", "needs-triage"]
name: '💡 Feature Request'
description: Suggest an idea or improvement for AntiLink Guard OSS
title: '[Feature]: '
labels: ['enhancement', 'needs-triage']
body:
- type: markdown
attributes:
value: |
Thanks for the suggestion! Please check the
[Roadmap](../../README.md#roadmap) first — your idea may already be planned.
Thanks for the suggestion! Please check
[ROADMAP.md](https://github.com/timeout187/antilink-guard/blob/main/ROADMAP.md)
first — your idea may already be planned.
- type: checkboxes
id: preflight
attributes:
label: Preflight checklist
options:
- label: I searched existing issues and this has not been requested.
required: true
- label: This relates to the open-source bot (not a hosted platform product).
required: true
- type: textarea
id: problem
attributes:
Expand Down
7 changes: 4 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ understand and merge your change quickly.
## Related issue

<!-- e.g. Closes #123 -->

Closes #

## Type of change
Expand All @@ -26,12 +27,12 @@ Closes #

## Checklist

- [ ] My code follows the project's style and passes `npm run lint`
- [ ] My code follows the project's style and passes `pnpm run lint` and `pnpm run typecheck`
- [ ] I have performed a self-review of my changes
- [ ] I have commented non-obvious code where needed
- [ ] I have updated the documentation where needed
- [ ] I have added/updated tests where applicable
- [ ] I did **not** commit any secrets (`.env`, tokens, webhook URLs)
- [ ] I have added/updated tests where applicable (`pnpm run test`)
- [ ] I did **not** commit any secrets (`.env`, tokens, database URLs)
- [ ] I updated `CHANGELOG.md` under **Unreleased** if this is user-facing

## Screenshots (if applicable)
Expand Down
38 changes: 24 additions & 14 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,37 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: "weekly"
interval: 'weekly'
open-pull-requests-limit: 10
labels:
- "dependencies"
- 'dependencies'
commit-message:
prefix: "chore(deps)"
prefix-development: "chore(deps-dev)"
prefix: 'chore(deps)'
prefix-development: 'chore(deps-dev)'
groups:
minor-and-patch:
update-types:
- "minor"
- "patch"
- 'minor'
- 'patch'

- package-ecosystem: "github-actions"
directory: "/"
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: "weekly"
interval: 'weekly'
labels:
- "dependencies"
- "ci"
- 'dependencies'
- 'ci'
commit-message:
prefix: "ci(deps)"
prefix: 'ci(deps)'

- package-ecosystem: 'docker'
directory: '/apps/example-bot'
schedule:
interval: 'weekly'
labels:
- 'dependencies'
- 'docker'
commit-message:
prefix: 'chore(deps-docker)'
58 changes: 48 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,71 @@ concurrency:

jobs:
build:
name: Lint & Build (Node ${{ matrix.node-version }})
name: Typecheck, lint, test & build (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [18, 20, 22]
node-version: [20, 22]

services:
postgres:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: antilink_guard_test
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 10s
--health-timeout 5s
--health-retries 5
mysql:
image: mysql:8
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: antilink_guard_test
ports:
- 3306:3306
options: >-
--health-cmd "mysqladmin ping -proot"
--health-interval 10s
--health-timeout 5s
--health-retries 5

env:
POSTGRES_TEST_URL: postgres://postgres:postgres@localhost:5432/antilink_guard_test
MYSQL_TEST_URL: mysql://root:root@localhost:3306/antilink_guard_test

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache: pnpm

- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile

- name: Build (workspace packages must build before typecheck/lint can resolve them)
run: pnpm run build

- name: Typecheck
run: pnpm run typecheck

# The steps below use `--if-present` so the workflow stays green even if a
# given script isn't defined yet. Add the scripts to package.json to enable.
- name: Lint
run: npm run lint --if-present
run: pnpm run lint

- name: Build
run: npm run build --if-present
- name: Format check
run: pnpm run format:check

- name: Test
run: npm test --if-present
run: pnpm run test
37 changes: 37 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CodeQL

on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: '17 3 * * 1'

permissions:
contents: read
security-events: write
actions: read

jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
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 }}

- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@v3
with:
category: '/language:${{ matrix.language }}'
14 changes: 12 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ node_modules/
.env.local
.env.*.local
*.token
*.pem
*.key

# Local SQLite databases
*.sqlite
*.sqlite3
*.db
data/

# Logs
logs/
Expand All @@ -23,10 +31,12 @@ pnpm-debug.log*
tmp/
coverage/
.nyc_output/
.turbo/

# Build output
dist/
build/
*.tsbuildinfo

# Editor / OS
.vscode/*
Expand All @@ -36,6 +46,6 @@ build/
.DS_Store
Thumbs.db

# Optional package manager lockfiles from other managers (keep package-lock.json)
# This project uses pnpm — keep pnpm-lock.yaml, ignore other managers' lockfiles
yarn.lock
pnpm-lock.yaml
package-lock.json
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
auto-install-peers=true
strict-peer-dependencies=false
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pnpm-lock.yaml
.claude/
**/dist/
**/coverage/
8 changes: 8 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"semi": true,
"singleQuote": true,
"printWidth": 100,
"tabWidth": 2,
"trailingComma": "all",
"arrowParens": "always"
}
Loading
Loading