Skip to content

Conversation

zrayaz1
Copy link
Contributor

@zrayaz1 zrayaz1 commented Jul 1, 2025

No description provided.

zrayaz1 and others added 26 commits July 8, 2025 00:31
* Infrastructure: Add pgbouncer

* Update

* Fix auth type
* Add better support for all types of ssh keys without regex

* Add more info for ssh key parsing

* Update ssh_key.py

---------

Co-authored-by: Connor Nelson <[email protected]>
zardus and others added 7 commits July 28, 2025 17:36
…g loading, so that the schema can be simplified
* initial changes for user-defined surveys

* fix survey test cases

* actually tested and fixed survey test case

* fix survey css conflicting between surveys, fix form submission and csrf, tested freeresponse and thumb surveys

* remove foreign keys from survey responses table

* define survey html in separate files instead of b64

* fix better survey schema definitions

* fix surveys again

* reduce schema complexity and fix endpoint that was changed
* update nix to 25.05

* fix dumb

* switch to overlay

* fix

* fix pt2

---------

Co-authored-by: Connor Nelson <[email protected]>
@ConnorNelson
Copy link
Member

@zardus where does this test go

@ConnorNelson ConnorNelson requested a review from zardus July 29, 2025 21:28
@ConnorNelson
Copy link
Member

This is ready to go once we move the test to the new correct spot.

ConnorNelson and others added 16 commits July 29, 2025 18:01
* Implement a -M option for local-tester.sh to start up a multinode setup.

* add multinode testing

* group log output

* use local-tester.sh for single-node test

* fix caching?

* groupable logs in local-tester

* try cleaning some space

* fix caching for main node

* claude actually fixed the multinode deploy!

* Add debugging for multi-node routing in CI

- Show existing routes before/after changes
- Verify route additions succeed
- Test connectivity between nodes
- Check if nginx-proxy can reach user container networks
- Add sleep to let routes settle

This will help diagnose why tests pass locally but fail in CI.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* remove debugs

---------

Co-authored-by: Claude <[email protected]>
* Initial commit

* Pending changes exported from your codespace

---------

Co-authored-by: Connor Nelson <[email protected]>
* Workspace: Added experimental workspace page

Added workspace_exp page, accessed through /workspace

TODO:
 - workspace functionality
 - Page CSS
 - Way to hide navbar
 - Initialization to certain workspace

* Workspace: added JS for experimental workspace

Start buttons now start challenges.
 - start: starts the challenge in normal mode.
 - start-priv: starts the challenge in practice/privileged mode.
 - restart: starts the challenge in the current mode.

Todo:
 - handling challenge timeout.
 - workspace switching.

* Oops

See previous commit.

* Workspace: Added content selection

Updated select to use the value as the url for the content to show.
Added content_select_callback which sets the content when the content select value changes.

Todo:
 - Better SSH content page.
 - More advanced on-select behavior, maybe chaining multiple http requests?
 - Refine selectable content (no recursive navbar).

* Workspace: Updated workspace switching

Improved workspace switching system.
 - Workspace content options are generated as part of the python script.
    - This allows for per-challenge workspaces and restriction of default workspaces.
 - Page now can take an argument to default to a certain workspace
 - Workspace selection box is only enabled if there are multiple allowed workspaces.

TODO:
 - Storage of last-used workspace.
 - More advanced workspace-selection control.
    - i.e. allowing for other requests before loading the final url for the iframe.

* Workspace: Hidden Navbar

The navbar can now be hidden on the workspace page.
 - Argument hide-navbar hides the navbar when set to true.

TODO:
 - See if there's a better way to hide/not include the navbar.

* Workspace: Fix

Removed random ".

* Workspace: Removed Navbar

Navbar is now entirely removed instead of being hidden.

* Workspace: Hide Privileged Button

The privileged button is not added if the challenge disallows privileged mode.

* Workspace: Fix

Fixed an issue where the startup script would crash when the privileged start button was not included.
 - This resulted in the restart button not having its on-click behavior set.

* Workspace: Button CSS

Made the buttons a little prettier.
 - Added some classes for styling.
 - Added font awesome icons.

TODO:
 - Control spacing.
 - Make other things pretty.

* Workspace: Pretty

Adjusted the spacing of controls.
 - Buttons take up 10% of the width, and the flag entry box takes up 50%.
 - The controls take up 10% of the height, and the workspace content takes up the other 90%.

Removed the footer
 - This page should take up all of the room (especially for being iframed into the content page).

TODO:
 - Remove fullscreen if the navbar is already disabled
 - Have controls fill space left by removed controls.

* Workspace: Fix

Fixed alignment "issue" with workspace controls.
 - Overwrote -15px offset.

* Workspace: CSS

Styled workspace select as a button.
 - It works. IDK

TODO:
 - Style the popup for selecting the workspace.
 - Navbar still takes up space after it is murdered.

* Workspace: CSS

Set font size for workspace content selector.
 - Magic number, hope it won't burn down.
 - Looks OK for now.

* Workspace: Ghost Navbar

Ghostbusted the navbar.
 - Removed padding and margin for main, now the content starts at the top of the page!

* Workspace: Flag Input

Refactored flag input to get its width from a CSS class.
 - Workspace controls section is far more readable.

* Workspace: Flag submission.

Added flag auto-submission when there is input matching the regex for a pwncollege flag.
 - Flag regex is /pwn.college{.*}/ (Will this need to change if flags change?)
 - Challenge ID is set when the workspace is first loaded.
 - Input background changes based on the result of submitting the flag.

TODO:
 - Fix the navbar again (hate).
 - Pick colors that don't stab out my eyes as much.

* Workspace: Refactor

Removed unused CSS class.

* Workspace: Navbar again

Fixed the navbar not taking up space when it is present.

* Workspace: Fix

Fixed an issue where if the workspace content was not selectable, then the flag entry field would not fill the entire remaining width.

* Workspace: Advanced Content Operations

Added framework for more advanced operations when loading.
 - Content options can chain GET requests and RENDER to the content iframe.

TODO:
 - Support POST requests.
 - Requests based on results of a previous operation.

* Workspace: Fix

Fixed the operation set for loading VSCode.
 - Now GETs from the proper pwncollege API.

TODO:
 - Fix Desktop operation set.
   - Requires pulling the URL from the previous GET.

* Workspace: Updated Content Commands

Added GET&RENDER oparation.
 - Will GET to a url and render a property of the response to the content iframe.

Updated VSCode and Desktop content values.
 - Now uses the GET&RENDER operation with the pwncollege_api/v1/workspace? endpoint.

TODO:
 - Challenge ID is not being set correctly :(

* Workspace: Fix

Fixed an issue where the incorrect challenge ID was used for flag submission.
 - The navbar also stores a challenge id with the same html id, use a different id.

* Workspace: CSS

Spaced out the workspace controls to be more in-line with the rest of the pwn.college website.

* Workspace: CSS

Changed the colors to stab my eyes a little less.

* Workspace: Navbar again (again)

Fullscreen button now hides/reveals the navbar.
 - Icon changes from expand to contract when hiding the navbar.
 - Page removes default navbar controls on load.

TODO:
 - Default navbar controls briefly flicker when page is loaded, see if the controls can be removed on the server side.

* Workspace: Buttons

Buttons are now disabled while the challenge start callback processes.

* Workspace: Fix

Fixed the disabling of the buttons.

* Workspace: Content

Removed the border around the workspace content.

* Workspace: Fullscreen

Updated the fullscreen callback to (hopefully) work with being iframed.
 - Now calls a callback function from the parent.

* Workspace: Refactor

Cleaned up logic for flag field width. (no more moon runes!)
 - Width is now calculated server side and set in the template.

Cleaned up processing of arguments.
 - All arguments are now initialized to default values.
 - Better conversion from strings to booleans for boolean arguments.

Cleaned up unnecessary comments.
 - vscode means use vscode! Shocker.

* Workspace: Fix

Used a JQuery selector to more cleanly apply the button onclick callback for starting challenges.

Fixed an issue where buttons would not work when clicking the icon.
 - Now checks if the event target is contained by the start, start-priv, and restart buttons.

* Workspace: cleanup

Removed old debug info, alert.

* Workspace: Fix

Fixed an issue where buttons could become permanently disabled when a challenge did not allow practice mode.

* Workspace: In-module Workspace

Added the new workspace to the challenge browser.
 - Iframe is created when the challenge is started.
 - The start and flag submission fields are hidden when the challenge is started.
 - Flag submission is now automatic when the contents of the field match the flag regex.

Fixed an issue where the workspace slightly exceeded the page.
 - Positioned content and controls absolutely.
 - Created an issue where the navbar covers some of the content.
 - There appears to be a small gap between the content and controls otherwise. Not sure where this comes from.

TODO:
 - Fullscreen.
 - Better workspace scroll fix.

* Workspace: Fix

Fixed the fullscreen callback for the modules page.

* Workspace: Fullscreen

Migrated the changing of the fullscreen icon.
 - The icon is now always changed by the callback, regardless of which do_fullscreen function is called.

* Workspace: Fullscreen

Implemented a crude fullscreen system.
 - Better CSS is needed.
 - Might need to modify the rest of the page.

* Workspace: Fullscreen

Improved fullscreen functionality.
 - User no longer has the option to scroll the background while in fullscreen.
 - Scroll position is properly restored when exiting fullscreen.

TODO:
 - Fix some UI elements rendering over the challenge iframe.
 - Fix the iframe clipping out of the bottom (unlock aspect ratio).
 - Navbar again :D

* Workspace: Fullscreen

Fixed challenge iframe sizing and alignment issues
 - Aspect ratio is unset.
 - Workspace padding is now accounted for in the position of the fullscreen workspace.

* Workspace: Fullscreen {also navbar again [again (again)]}

Fullscreen now disables additional html elements.
 - Navbar is hidden.
 - Scoreboard elements are hidden.
 - Notifications are hidden.

TODO:
 - Adjust font size of Workspace selection text.

* Workspace: Controls

Increased width of the workspace content selector.
-	Added new class for content selector frame.
-	Reduced initial width of the flag field.

* Module: Workspace

Added resize callback to better fit the workspace to the current window.
-	Workspace iframe now uses the same aspect ratio as the window.

* Workspace: Persistent Workspace

Changed workspace initialization logic:
-	Simplified selection process by removing hardcoded cases for VSCode and Desktop.
-	Removed 404 on unknown content selection, now defaults to the challenge default.
-	Added cookie for persistent workspace. Users will now be loaded into the same workspace they were using previously.

* Workspace: Init

Changed default content choice from default to none.
-	When service arg is not provided, previous workspace will be used.

* Navbar: New Workspace

Updated the navbar to link to the new workspace.
-	Removed link to desktop.
-	Workspace now links to workspace_exp instead of vscode.

TODO:
1.	Adjust spacing?
2.	Remove challenge navigation dropdown.

* Navbar: Removed Challenge Navigation

Removed challenge navigation dropdown.
-	With the new workspace being part of the module page, challenge selection from the navbar is not required.
-	Cleaned up navigation js functions.
-	I feel bad for the author of the work I just nuked :(

* Module: Workspace Sizing Fix

Fixed some edge cases where the workspace iframe would be improperly sized.
-	When first loading the page, the iframe defaults to a 16:9 aspect ratio.
-	When starting a new challenge, the iframe defaults to a 16:9 aspect ratio.
-	The challenge iframe will now grab the window aspect ratio in both cases.

* Workspace: Privileged Indicator

Added an indicator for if the workspace is currently in privileged mode or not.
-	The active mode (start or start-priv) is highlighted in --brand-green.

* Workspace: Privileged Indicator

Privileged mode indicator is only shown when the challenge allows privileged mode.

* Updated Workspace Tests

Updated workspace test cases to work with new workspace.

* Test Fixed Now?

* Workspace: Tests

Switched back to dumping flag in the hidden field.

* Tests?

* Iframe find fix

* Run the test please

* Work

* Please

* Test

* Test

* No Test

* Test

Murdered another test case

* Tests

Added iframe param to challenge_start to allow starting a challenge again.

* No Tests

Turned off another test.

I can't check test logs because github is being bad, and it also isn't saying what's failing.

* Changed Message

Changed the challenge start message to not mention the desktop or vscode.
-	You WILL use the new workspace and you WILL like it.

* SSHnt

Removed SSH option, will be restored in the future with a proper SSH tutorial page.

* Workspace: Fix

Fixed an issue where the workspace would be loaded even if starting a challenge failed.

* Workspace: New Tests

Moddified tests to (hopefully) work with the new workspace.
-	Submission now goes into the iframe as well.

* Workspace: Tests

Switched getAttribute for get_attribute (Thanks Google).

Wishing running tests locally didn't blow up my storage...

* Workspace: Tests

Changed secret input method, maybe it will work this time :)

* Workspace: Tests

Added sleep before challenge_start returns.

* Workspace: Tests

Restoring old method of inputing secret to see if my VSCode issues magically disappear.

* Workspace: Tests

IDK at this point...

* Workspace: Tests

Trying another thing, see you in 10 minutes.

* Workspace: Tests

Mixing vscode and the desktop because why not.

* Oops

* Workspace: Tests

Only the desktop, now with the correct id.

* Workspace: Tests

Try stuffing the output in the home directory instead?

* Workspace: Tests

Increased delay before checking for the flag.

* Workspace: Test

Redirect stderr to hopefully catch some extra info.

* Workspace: Test

We have come full circle.

* Workspace: Test

Capture stderr correctly.

* Workspace: Test

* Workspace: Test

Debug

* Workspace: Test

Don't abuse formatting.

* Workspace: Test

Timeout for challenge submission

* Workspace: Test

Assert we did not timeout.

* Workspace: Test

Wait for a while when starting in practice mode.

* Workspace: Test

Reduced delay (For some reason the last change blew up the build process).

* Workspace: Test

Debug again

* Workspace: Test

10 more minutes for debug.

* Workspace: Test

Give the IFrame some time to load?

* Workspace: Test

Undo that.

* Workspace: Test

Reduced delays.

* Workspace: Test

Removed practice test, seems to have issues with timing interactions with the workspace iframe.

* Workspace: Test

Removed some debug prints.

Who knows, maybe this will randomly pass the tests.

* Workspace: Cleanup

Cleaned up some development artifacts.

* Workspace: Fix

Corrected no_challenge parameter when rendering the workspace.

* Remove tabs

* Improve names

* Simplify

* Improve UI

* More

* More

---------

Co-authored-by: Connor Nelson <[email protected]>
Added a button to challenges which allow privileged/practice mode which starts the challenge in privileged mode.
@zardus
Copy link
Member

zardus commented Aug 5, 2025

what have i done

@zardus zardus merged commit d0a5ed3 into pwncollege:master Aug 5, 2025
2 checks passed
@zardus
Copy link
Member

zardus commented Aug 5, 2025

just gonna yolo this!

@zardus
Copy link
Member

zardus commented Aug 5, 2025

thanks!

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.

9 participants