Skip to content

Feature/discord activity#70

Merged
LucHeart merged 16 commits into
masterfrom
feature/discord-activity
Jul 10, 2026
Merged

Feature/discord activity#70
LucHeart merged 16 commits into
masterfrom
feature/discord-activity

Conversation

@LucHeart

@LucHeart LucHeart commented Jul 10, 2026

Copy link
Copy Markdown
Member

LucHeart and others added 11 commits July 8, 2026 22:58
Introduces a Discord Activity where users log in, link their OpenShock
account, manage shockers/whitelist, and join a shared room to shock each
other in real time under a consent model.

- Extract OpenShock.DiscordBot.Shared (EF context, entities, migrations,
  ApiUtils, generalized OpenShockBackendService); bot behavior unchanged.
- Add room-consent columns to User (AddRoomConsent migration).
- New OpenShock.Activity.Api: Discord OAuth->JWT exchange, REST endpoints
  (me/link/shockers/whitelist/consent/control) reusing the bot's logic,
  and a SignalR room hub keyed by the Discord instanceId. Discord IDs are
  serialized as strings to survive JS number precision.
- SvelteKit 5 SPA (activity/): Discord SDK + SignalR, room and settings
  routes, dark high-voltage theme.
- Deployment artifacts: cloudflared k8s manifest, API Dockerfile, and
  docs/discord-activity.md (two-host URL mappings, Cloudflare, local dev).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Directory.Build.props: shared TargetFramework, ImplicitUsings, Nullable,
  Company, Product, NeutralLanguage, and the shared UserSecretsId.
- Directory.Packages.props: central package versions (ManagePackageVersions
  Centrally); csproj PackageReferences no longer carry Version attributes.
- Slim all four csproj files down to project-specific settings.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Discord's Activity URL override only replaces the root target and the
iframe CSP blocks direct localhost calls, so serve everything from one
local origin: Vite proxies /api (and the SignalR WebSocket) to the local
API, stripping the /api prefix to match the API's root routes.

- vite.config.ts: server/preview proxy + allowedHosts for tunnel hosts.
- VITE_API_PROXY_TARGET env (default http://localhost:5199).
- Document the tunnel + URL-override flow in docs/discord-activity.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Enabling Activities adds Discord's managed "Entry Point" command. The
default bulk overwrite (deleteMissing: true) tries to remove it and fails
with error 50240 in the Ready handler. Register with deleteMissing: false.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 10, 2026

Copy link
Copy Markdown

Deploying discordbot with  Cloudflare Pages  Cloudflare Pages

Latest commit: 272a96e
Status: ✅  Deploy successful!
Preview URL: https://4a8c4fb8.discordbot-4hu.pages.dev

View logs

Comment thread .github/workflows/ci-build.yml Fixed
Comment thread OpenShock.Activity.Api/Controllers/UserController.cs Fixed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1193dce8d0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread OpenShock.Activity.Api/Dockerfile
Comment thread OpenShock.Activity.Api/Dockerfile Outdated
Comment thread DiscordBot.slnx
Comment thread deploy/cloudflared-activity-api.yaml Outdated
Comment thread .github/workflows/ci-build.yml Fixed
LucHeart and others added 4 commits July 10, 2026 18:02
…from user input'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…ntain permissions'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@LucHeart LucHeart merged commit 3de0adf into master Jul 10, 2026
6 checks passed
@LucHeart LucHeart deleted the feature/discord-activity branch July 10, 2026 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants