Commit Graph
150 Commits
Author SHA1 Message Date
Justin Lin 7b16722e55 fix: move translation button to rightmost 2026-09-26 10:51:54 +10:00
Justin Lin 156abc044a refactor: clean up unused code 2025-05-05 19:55:40 +08:00
Justin Lin 5e81db2759 feat: connect terminal service to backend
feat: put terminal service into container

refactor: separate main into terminal and websocket

feat: create zsh using commander in home

feat: pass backendUrl to container

feat: pass token to ws server to cmd-hook

feat: gen terminal access token for frontend

feat: success to connect through traefik

fix: handle invalid jwt

feat: connect to session container via traefik
2025-05-05 19:53:33 +08:00
Justin Lin 3b77d91796 Quest: remove unnecessary ls-stages (#195)
* quest: remove ls-stages in create

* feat: prevent throwing errors when failed to copy files

* feat: log new command in dev mode

* quest: copy

* quest: mv

* quest: rm

* quest: execute. Add many exceptions

* feat: pwd discovers parent folders
2025-04-30 15:01:25 +08:00
Justin Lin f0a09ac4d9 Feat filegraph (#194)
* feat: update filegraph on touch command

* feat: update filegraph on mkdir

* feat: add different parsing opts for each command

* refactor: replace axios with fetch. put handleCommand to a new file

* feat: add config for mounting cli in dev stage

* refactor: clean up unused validators

* feat: add command handler for copy files. reuse resolvePath function

* feat: add rm handler, support specific files deletion. Glob not supported yet

* feat: handle discover cases that the folder is actually empty

* feat: handle discover empty folder better and support rmdir

* feat: handle mv command

* refactor: remove unused console logs
2025-04-29 20:40:02 +08:00
Justin Lin ccbc4ff4b0 feat(rate-limiting): implement rate limiting for login attempts and enhance configuration
- Added environment variables for `RATE_LIMIT_MAX_FAILED_ATTEMPTS` and `RATE_LIMIT_LOCKOUT_TIME`
- Integrated rate limiting into the login process with a maximum of 5 failed attempts
- Refactored login attempt recording into the `authRouter`
- Removed deprecated `recordLogin` middleware and adjusted related logic
2025-04-27 16:29:03 +08:00
Vincent23412 af2f1ef707 feat(auth): add LoginAttempt schema and record login attempts with failure rate limit
- Added `LoginAttempt` Mongoose schema to store login history
- Integrated login attempt recording into login flow (success/failure)
- Created `rateLimitByAccount` middleware to block login if 10 failed attempts in 10 minutes
2025-04-27 15:57:34 +08:00
Justin Lin aeed963a75 fix: use wrong parsed command body 2025-04-26 18:43:43 +08:00
Justin Lin b86697b6db fix: validate command input in newCommand controller 2025-04-26 18:10:33 +08:00
Justin Lin 9498bb77ef fix: linting 2025-04-26 17:02:47 +08:00
Justin Lin d450613816 clean: remove unused code 2025-04-26 12:48:29 +08:00
Justin Lin f7860c6197 fix: update CLIFileExistenceChecker to accept containerId in constructor 2025-04-26 11:09:10 +08:00
Justin Lin fba92dad46 feat: integrate filegraph 2025-04-24 23:30:12 +08:00
Justin Lin 87b8ca5d04 wip: replace packages with pure files 2025-04-24 23:20:40 +08:00
Justin Lin 2d95ca382f wip: integrate filegraph into session 2025-04-24 22:05:10 +08:00
Justin Lin 7e50c8e06c refactor: remove condition tests and update file node interfaces in game session
TODO: replace "folder" with "directory"
2025-04-24 18:10:47 +08:00
Justin Lin 52e9a13645 feat: add isFinished method to GameSession and update commandController to handle session completion 2025-04-23 17:10:51 +08:00
Justin Lin 92173bb7e9 refactor: migrate session management to TRPC and remove legacy API endpoints 2025-04-23 16:37:12 +08:00
Justin Lin b4b8f8baee feat: load responses and tasks from existing session 2025-04-23 16:17:10 +08:00
Justin Lin 2fcca0c4b9 refactor: update session management to handle tasks and responses in a single update 2025-04-23 16:03:39 +08:00
Justin Lin 66434ff897 fix: save new created session 2025-04-22 19:06:57 +08:00
Justin Lin 1616f62755 wip: migrate backend to new game package 2025-04-21 22:40:11 +08:00
Justin Lin 6043226142 wip: migrating game handler 2025-04-18 14:27:36 +08:00
Justin Lin 423548804a feat: migreate get user profile to trpc 2025-04-16 16:40:03 +08:00
Justin Lin ac92950177 feat: migrate quest api to trpc 2025-04-16 16:24:29 +08:00
Justin Lin 91ebaec22c feat: update document and remove some debug logging 2024-10-14 18:32:02 +08:00
Justin Lin a6720cfe39 feat: connect through ssh 2024-10-13 15:59:01 +08:00
Justin Lin 4c292fd6ba wip: allow connection from docker container 2024-10-13 15:05:20 +08:00
wancat d577656eb1 feat: allow testing on creating new session 2024-07-28 15:14:45 +08:00
wancat ed596c245d fix: duplicate response 2024-06-28 16:17:28 +08:00
wancat d795dbd788 refactor: Remove commented out code and unused imports 2024-06-28 16:14:26 +08:00
wancat 218d433c14 fix: remove unused logging 2024-06-28 16:05:45 +08:00
wancat c64043316e feat: replace getOrCreateActive session to getActiveSession 2024-06-27 11:54:28 +08:00
wancat 1d725d82ae feat: add register-guest api 2024-06-17 19:23:30 +08:00
wancat 455fde41ab fix: OAuth flow by setting scope and cookie to 'lax' 2024-04-05 17:56:09 +08:00
wancat 817cf8c40e hotfix: redirect to map after login 2024-03-01 23:49:58 +08:00
wancat 039da53bbe feat: send status to the frontend 2024-02-29 10:54:53 +08:00
wancat 88ee8f2cc3 feat: send response to frontend 2024-02-29 10:54:53 +08:00
wancat 9f1008336d refactor: routes and index.js 2024-02-22 20:44:47 +08:00
wancat 59590639ee refactor: authController, add session types 2024-02-22 20:35:19 +08:00
wancat 885f1c5b27 refactor: leaderboard controller 2024-02-22 20:18:04 +08:00
wancat ac8e9d1cfa refactor quest controller 2024-02-22 20:16:08 +08:00
wancat fd543ed594 finish session controller 2024-02-22 20:10:03 +08:00
wancat c912319967 refactor: userController and add req user type 2024-02-19 23:51:21 +08:00
wancat 4c421b4cb3 refactor: game 2024-02-19 23:13:37 +08:00
wancat 2d05149cea refactor socket 2024-02-19 19:24:18 +08:00
wancat ad66191d88 refactor: validators 2024-02-19 19:09:32 +08:00
chreamy 7bb7ac3f00 csrf token 2024-01-20 00:14:59 -06:00
chreamy 42278ad51b csrf token 2024-01-20 00:11:48 -06:00
chreamy d45fbee647 fix: CSRF issue #51 2024-01-18 03:23:39 -06:00