Repository navigation
Conversation
- deploy token: fall back to the user id for team_id when the player has no team (CTFd individual mode). Galvanize keys per-player deployments by team_id, so null broke deploy/status/extend/terminate. - view: render connection_info one entry per line, each URL its own link. Galvanize joins several published ports with "\n"; they were shown as one code block, or as one broken link when the first entry was an HTTP URL. - view: store the JWT per challenge id + category and fetch a new one when the cached token's category no longer matches the challenge, instead of failing with 400 "Invalid challenge" after a category edit. - view: on a 404 from /status, reset the deploy button unless the message says the challenge is unique. A 404 JSON body without "unique" (or without a message) left the modal spinning or threw.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds the fixes we made to Zync while running it with Galvanize for UnitedCTF. CTFd ran in individual mode (no teams). These changes ran in production during the event.
Companion Galvanize PR: 28Pollux28/galvanize#7
🐛 Fixes
POST /api/v1/deploy/tokensigns"team_id": nullwhen the player has no team. Galvanize keys every per-player deployment byteam_id.api/deploy.py:team_idfalls back tostr(user.id)when there is no team. Team mode is unchanged.\n.view.jsonly checked whether the whole string started withhttpand wrapped all of it in a single<a>or<code>.httpbecome links, the rest become<code>. Lines are joined with<br>.category, was cached insessionStorageunderjwt_<challengeId>and reused until it expired. It kept the old category.jwt_<challengeId>_<category>, andensureTokenalso fetches a new one when the cached token'scategorydoesn't match the challenge's current one. Decoding the token payload is wrapped intry/catch./statusreturns a 404 with a JSON bodydata404.message.includes(...). That throws if there is nomessage, and if the message didn't mention "unique" the button was never reset.res.json()failures are caught.Notes
tcp:///ssh://lines for instances that only publish ports.Test plan
core-betatheme, individual mode).node --check assets/view.jsandpython -m py_compile api/deploy.pyteam.id