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
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,25 @@ All configuration lives in `config.json` and can be updated at runtime via the `

**Escalation thresholds** are objects with: `warns` (count), `withinDays` (window), `action` ("timeout" or "ban"), `duration` (for timeout, e.g. "1h").

### Starboard (`starboard`)

| Key | Type | Description |
|-----|------|-------------|
| `enabled` | boolean | Enable the starboard feature |
| `channelId` | string | Channel ID where starred messages are reposted |
| `threshold` | number | Reaction count required to star a message (default: 3) |
| `emoji` | string | Emoji to watch for stars (default: `⭐`) |
| `selfStarAllowed` | boolean | Allow users to star their own messages |
| `ignoredChannels` | string[] | Channel IDs excluded from starboard tracking |

### Permissions (`permissions`)

| Key | Type | Description |
|-----|------|-------------|
| `enabled` | boolean | Enable permission checks |
| `adminRoleId` | string | Role ID for admin commands |
| `moderatorRoleId` | string | Role ID for moderator commands |
| `modRoles` | string[] | Additional role IDs or names that count as moderators (legacy/`modExempt` checks) |
| `botOwners` | string[] | Discord user IDs that bypass all permission checks |
| `allowedCommands` | object | Per-command permission levels (`everyone`, `moderator`, `admin`) |

Expand Down
8 changes: 8 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@
"maxContextMemories": 5,
"autoExtract": true
},
"starboard": {
"enabled": false,
"channelId": "",
"threshold": 3,
"emoji": "⭐",
"selfStarAllowed": false,
"ignoredChannels": []
},
"logging": {
"level": "info",
"fileOutput": true,
Expand Down
13 changes: 11 additions & 2 deletions src/api/utils/configAllowlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,18 @@
* can be read or written via the API.
*/

export const SAFE_CONFIG_KEYS = new Set(['ai', 'welcome', 'spam', 'moderation', 'triage']);
export const SAFE_CONFIG_KEYS = new Set([
'ai',
'welcome',
'spam',
'moderation',
'triage',
'starboard',
'permissions',
'memory',
]);

export const READABLE_CONFIG_KEYS = [...SAFE_CONFIG_KEYS, 'logging', 'memory', 'permissions'];
export const READABLE_CONFIG_KEYS = [...SAFE_CONFIG_KEYS, 'logging'];

/**
* Dot-notation paths to config values that contain secrets (e.g. API keys).
Expand Down
4 changes: 4 additions & 0 deletions tests/api/utils/configAllowlist.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ describe('configAllowlist', () => {
expect(SAFE_CONFIG_KEYS.has('spam')).toBe(true);
expect(SAFE_CONFIG_KEYS.has('moderation')).toBe(true);
expect(SAFE_CONFIG_KEYS.has('triage')).toBe(true);
expect(SAFE_CONFIG_KEYS.has('starboard')).toBe(true);
expect(SAFE_CONFIG_KEYS.has('permissions')).toBe(true);
expect(SAFE_CONFIG_KEYS.has('memory')).toBe(true);
});
});

Expand All @@ -31,6 +34,7 @@ describe('configAllowlist', () => {
expect(READABLE_CONFIG_KEYS).toContain('logging');
expect(READABLE_CONFIG_KEYS).toContain('memory');
expect(READABLE_CONFIG_KEYS).toContain('permissions');
expect(READABLE_CONFIG_KEYS).toContain('starboard');
});
});

Expand Down
Loading
Loading