commits
Update dependencies to address security vulnerabilities and improve
overall project health. This includes updates for eslint,
eslint-plugin-import, and others.
Move the `LINK_SHORTENER` constant from `rules/posts.ts` to
`rules/constants.ts` and remove the now duplicate declaration.
This constant will hold a list of allowed link shorteners.
Adds example configuration files for account age, account threshold,
global allowlist, handle checks, post checks, and profile checks. These
files contain example values and instructions for configuration.
The example config files are no longer needed. The CI setup previously
copied the example files to the main config files. This is no longer
necessary, as the user will be expected to create the config files from
scratch.
- Added example configuration files for account age, account threshold,
global constants, handles, posts, and profiles. - Updated the CI build
to copy the example configuration files. - Removed the now redundant
rules/README.md. - Updated .gitignore to exclude all rules.
Rate limit improvements
- Stores and restores session for persistent login - Implements dynamic
rate limiting from ATP headers - Adds Prometheus metrics for rate limit
state and waits - Refactors authentication flow for session persistence
This commit introduces Redis caching to prevent redundant moderation
actions, reducing the load on the Bluesky API.
- Added the `redis` package as a dependency. - Implemented
`connectRedis` and `disconnectRedis` functions to manage the Redis
connection. - Added `tryClaimPostLabel`, `tryClaimAccountLabel`, and
`tryClaimAccountComment` functions to manage and claim resources for
caching purposes. - Modified `src/config.ts` to include the `REDIS_URL`
environment variable. - Added `src/redis.ts` which contains the Redis
client and connection management. - Integrated the caching logic into
moderation functions to ensure that actions are performed only once per
resource. - Added Redis healthcheck to compose.yaml. - Updated
package.json and bun.lock.
feat: Add Redis caching and connection
This commit introduces Redis caching to prevent redundant moderation
actions, reducing the load on the Bluesky API.
- Added the `redis` package as a dependency. - Implemented
`connectRedis` and `disconnectRedis` functions to manage the Redis
connection. - Added `tryClaimPostLabel`, `tryClaimAccountLabel`, and
`tryClaimAccountComment` functions to manage and claim resources for
caching purposes. - Modified `src/config.ts` to include the `REDIS_URL`
environment variable. - Added `src/redis.ts` which contains the Redis
client and connection management. - Integrated the caching logic into
moderation functions to ensure that actions are performed only once per
resource. - Added Redis healthcheck to compose.yaml. - Updated
package.json and bun.lock.
This commit upgrades project dependencies, including: - @types/node to
v22.18.0 - @vitest/coverage-v8 to v1.6.0 - Other dependencies for bug
fixes and improvements
Provides examples of checks for spam and promotional content, including
regular expressions and actions to take when matches are found.
Use Bun to run the type check, tests, and coverage.
This commit moves the account age related checks into the
`rules/account` folder, organizing the project structure.
feat: Add Prettier config and plugins
feat: Add ESLint config and plugins
fix: Fix missing import for Agent
feat: Implement metrics endpoint
refactor: Improve test organization
fix: Mock fetch in age.test.ts
fix: Add tests for countStarterPacks
refactor: Move account age checks to rules folder
feat: Add tests for facet spam detection
Adds a type-checking script to package.json and updates tsconfig.json to
improve type checking and skip library checks.
feat: Add type checking and update tsconfig
Adds a type-check script to `package.json` and a pre-push hook to run
type checks before pushing. Updates the `tsconfig.json` to include
`vitest/globals` and `skipLibCheck`. Also, updates imports in test files
to include the `.js` extension.
This commit adds eslint-config-prettier to the project.
- Removed an unused import statement in `src/tests/moderation.test.ts` -
Standardized formatting across several files to improve readability.
Fix: Remove unused imports and formatting
This commit removes an unused import and applies minor formatting
changes for improved code readability.
File reorganization
This commit adds tests for the `countStarterPacks`, `checkPosts`, and
`checkProfiles` functions. These tests cover various scenarios,
including whitelisting, language filtering, URL resolution, and
moderation actions.
The URL regex was updated to be case-insensitive to ensure that
shortened URLs are correctly resolved. Also added more logging for
debugging purposes.
Allowlists are now checked via an array. Added more logging. Improved
error handling.
Refactor countStarterPacks rule
Use a whitelist for allowed DIDs and improve logging.
- Use HEAD requests first, falling back to GET - Add a user agent to the
request headers - Improve error logging - Increase the timeout to 15
seconds
This commit splits the `utils.ts` file into three separate files: -
`utils/utils.ts`: Contains the `normalizeUnicode` function. -
`utils/getFinalUrl.ts`: Contains the `getFinalUrl` function. -
`utils/getLanguage.ts`: Contains the `getLanguage` function. This
improves code organization and readability.
feat: Split utils into separate files
Move rule-related files into dedicated subdirectories to improve
organization.
1. line 124: changed replyingDid → actorDid (this was causing your
error) 2. line 126: added replyToPostURI to capture the full parent
URI 3. lines 133-158: added quote post monitoring - now detects when
someone quotes a monitored DID or post
the error should be gone now. the system will now: - monitor replies
to your configured government DIDs - monitor quote posts of those same
DIDs - monitor specific post URIs if you add them to monitoredPostURIs
Use the correct PLC URL.
Improve account age lookup by fetching the audit log from the PLC and
using `createdAt` instead of `indexedAt` from the profile.
This commit adds a check to the `checkAccountAge` function to prevent
duplicate labels from being applied to the same account. It uses the
`checkAccountLabels` function to determine if a label already exists
before attempting to create a new one. This prevents redundant labeling
and improves efficiency. Also includes unit tests for the
`checkAccountLabels` function to ensure correct behavior.
This change updates the account age check to use a date window defined
by the anchor date and max age days. Instead of calculating the age, it
now checks if the account creation date falls within the specified
window. This simplifies the logic and makes it more readable.
Additionally, the test suite has been updated to reflect the new
behavior, and a more descriptive comment has been added.
- Renamed files and directories to the `rules` structure. - Added global
allowlist check.
This adds a global allowlist to bypass moderation checks for specified
DIDs. This is to allow certain accounts to bypass checks for testing and
other use cases.
The allowlist is checked in checkHandles, checkPosts, checkProfiles, and
checkDisplayName functions.
Update dependencies to address security vulnerabilities and improve
overall project health. This includes updates for eslint,
eslint-plugin-import, and others.
This commit introduces Redis caching to prevent redundant moderation
actions, reducing the load on the Bluesky API.
- Added the `redis` package as a dependency. - Implemented
`connectRedis` and `disconnectRedis` functions to manage the Redis
connection. - Added `tryClaimPostLabel`, `tryClaimAccountLabel`, and
`tryClaimAccountComment` functions to manage and claim resources for
caching purposes. - Modified `src/config.ts` to include the `REDIS_URL`
environment variable. - Added `src/redis.ts` which contains the Redis
client and connection management. - Integrated the caching logic into
moderation functions to ensure that actions are performed only once per
resource. - Added Redis healthcheck to compose.yaml. - Updated
package.json and bun.lock.
This commit introduces Redis caching to prevent redundant moderation
actions, reducing the load on the Bluesky API.
- Added the `redis` package as a dependency. - Implemented
`connectRedis` and `disconnectRedis` functions to manage the Redis
connection. - Added `tryClaimPostLabel`, `tryClaimAccountLabel`, and
`tryClaimAccountComment` functions to manage and claim resources for
caching purposes. - Modified `src/config.ts` to include the `REDIS_URL`
environment variable. - Added `src/redis.ts` which contains the Redis
client and connection management. - Integrated the caching logic into
moderation functions to ensure that actions are performed only once per
resource. - Added Redis healthcheck to compose.yaml. - Updated
package.json and bun.lock.
This commit moves the account age related checks into the
`rules/account` folder, organizing the project structure.
feat: Add Prettier config and plugins
feat: Add ESLint config and plugins
fix: Fix missing import for Agent
feat: Implement metrics endpoint
refactor: Improve test organization
fix: Mock fetch in age.test.ts
fix: Add tests for countStarterPacks
refactor: Move account age checks to rules folder
feat: Add tests for facet spam detection
Adds a type-checking script to package.json and updates tsconfig.json to
improve type checking and skip library checks.
feat: Add type checking and update tsconfig
Adds a type-check script to `package.json` and a pre-push hook to run
type checks before pushing. Updates the `tsconfig.json` to include
`vitest/globals` and `skipLibCheck`. Also, updates imports in test files
to include the `.js` extension.
This commit splits the `utils.ts` file into three separate files: -
`utils/utils.ts`: Contains the `normalizeUnicode` function. -
`utils/getFinalUrl.ts`: Contains the `getFinalUrl` function. -
`utils/getLanguage.ts`: Contains the `getLanguage` function. This
improves code organization and readability.
feat: Split utils into separate files
1. line 124: changed replyingDid → actorDid (this was causing your
error) 2. line 126: added replyToPostURI to capture the full parent
URI 3. lines 133-158: added quote post monitoring - now detects when
someone quotes a monitored DID or post
the error should be gone now. the system will now: - monitor replies
to your configured government DIDs - monitor quote posts of those same
DIDs - monitor specific post URIs if you add them to monitoredPostURIs
This commit adds a check to the `checkAccountAge` function to prevent
duplicate labels from being applied to the same account. It uses the
`checkAccountLabels` function to determine if a label already exists
before attempting to create a new one. This prevents redundant labeling
and improves efficiency. Also includes unit tests for the
`checkAccountLabels` function to ensure correct behavior.
This change updates the account age check to use a date window defined
by the anchor date and max age days. Instead of calculating the age, it
now checks if the account creation date falls within the specified
window. This simplifies the logic and makes it more readable.
Additionally, the test suite has been updated to reflect the new
behavior, and a more descriptive comment has been added.