Add Discord guild ID configuration and enhance event announcement options
This commit introduces the `DISCORD_GUILD_ID` environment variable to the configuration files, allowing for better integration with Discord for role synchronization. The event announcement functionality has been updated to include an option for the `@everyone` mention, which can be toggled during event creation. The backend logic has been modified to handle this new option, and corresponding updates have been made to the frontend to allow users to control the mention behavior. Additionally, tests have been added to ensure the correct functionality of these features.
This commit is contained in:
@@ -22,6 +22,7 @@ Set these as production variables in Coolify:
|
||||
- `DISCORD_BOT_TOKEN` — bot token from the Developer Portal; never expose it to the frontend
|
||||
- `DISCORD_ANNOUNCEMENT_CHANNEL_ID` — numeric ID of the text channel for new mix announcements
|
||||
- `DISCORD_ANNOUNCEMENT_LOCALE=ru` — announcement language, `ru` or `en`
|
||||
- `DISCORD_GUILD_ID` — numeric ID of the server where roster roles are synchronized
|
||||
|
||||
Do not copy production values into `.env` in the repository.
|
||||
|
||||
@@ -36,6 +37,8 @@ In the Discord Developer Portal:
|
||||
|
||||
For event announcements, add the bot to the server with the `bot` scope. In the announcement channel grant only `View Channel`, `Send Messages`, `Embed Links`, and `Mention Everyone`. Copy the channel ID with Discord Developer Mode and store it in `DISCORD_ANNOUNCEMENT_CHANNEL_ID`. The bot token is separate from the OAuth client secret and must also remain only in Coolify. If either the token or channel ID is omitted, announcements stay disabled.
|
||||
|
||||
For roster synchronization, grant the bot `Manage Roles`, copy the server ID to `DISCORD_GUILD_ID`, and place the bot's own role above all roles it creates. The bot creates global `Tank`, `Damage`, and `Support` roles plus temporary team and team-captain roles after roster confirmation. It does not need `Administrator` or privileged Gateway intents. Role synchronization stays disabled when `DISCORD_GUILD_ID` is empty.
|
||||
|
||||
## Storage and backups
|
||||
|
||||
PostgreSQL uses the `postgres_data` named volume. Confirm that Coolify recognizes it as persistent storage before accepting users.
|
||||
@@ -50,7 +53,10 @@ Persistent storage is not a backup. Schedule an encrypted `pg_dump` to storage o
|
||||
4. Complete Discord login and verify the admin role.
|
||||
5. Create a test event and RSVP.
|
||||
6. Confirm the bot posts one announcement with an `@everyone` mention and a working registration button.
|
||||
7. Restart/redeploy and confirm the event remains.
|
||||
8. Verify SSE remains connected through the proxy.
|
||||
7. Confirm test rosters and verify dynamic team, captain, and slot roles in Discord.
|
||||
8. Rename a live team and verify both managed role names change.
|
||||
9. Complete or cancel the test event and verify temporary roles are removed.
|
||||
10. Restart/redeploy and confirm the event remains.
|
||||
11. Verify SSE remains connected through the proxy.
|
||||
|
||||
Rollback application images only when the database migration is backward-compatible. Otherwise restore the matching database backup.
|
||||
|
||||
Reference in New Issue
Block a user