Commit Graph
1093 Commits
Author SHA1 Message Date
wancat 3cea54ce71 feat: add new API for recording executed commands
- Add the `jsonwebtoken` dependency to the server's `package.json`
- Add a new file `commandController.js` to the server's API controllers
- Add a new route `/commands` to the server's API routes
- Add a new file `commands.js` to the server's API routes
- Modify the `index.js` file in the server's API routes to import and use the `commands.js` route
- Add a `newCommand` function to the `commandController.js` file
- Add a `Command` model to the `command.js` file in the server's models
- Add the `genSessionJWT` and `verifySessionJWT` functions to the `auth.js` file in the server's utils
- Modify the `attachContainer` function in the `docker.js` file in the server's utils to include a `token` parameter
- Modify the `swagger.yaml` file to include a new route `/commands` for recording executed commands in a session

Signed-off-by: wancat <wancat@wancat.cc>
2023-07-24 16:39:04 +08:00
wancat fe3f4ddc73 fix: docker image name update 2023-07-24 16:39:04 +08:00
Lin, Hung-Shin 9ee9a8586f Merge pull request #3 from lancatlin/server-terminal-api
Server terminal api
2023-07-24 15:09:02 +08:00
wancat 5fd611ab51 docs: improve comments and remove unnecessary lines
- Add a comment about creating a session with a POST request to `/api/v1/sessions`
- Remove the line mentioning `yarn cli` command
- Add a comment about using the `_id` field in the response
- Remove the example usage of `yarn cli`

Signed-off-by: wancat <wancat@wancat.cc>
2023-07-24 15:06:48 +08:00
wancat 95fc25d0ad feat: connect to different container by sessions
Based on the file summaries provided, the best label for this commit would be "feat". This is because the commit introduces several new features to the codebase, such as adding a new ESLint rule, adding a new property to a function, adding authentication middleware, adding a query parameter, and adding a new function to handle user authentication.: update authentication and session handling

- Add `"camelcase"` rule to ESLint configuration
- Add `containerId` property to the `newSession` object in the `createSession` function
- Add authentication middleware to the socket.io connection
- Add a query parameter `session_id` to the socket.io connection in `client.js`
- Add `defaultUser` function to handle user authentication
- Update the `authMiddleware` function to use the `defaultUser` function
- Add `defaultUser` function to handle user authentication in `auth.js`
- Update `getOrCreateContainer` function to use the `id` parameter instead of `name` parameter
2023-07-24 12:21:05 +08:00
wancat 41030e246c Disable Tailscale and use SSH directly 2023-07-22 16:38:51 +08:00
wancat c83ca750e1 Connect to different shell 2023-07-22 16:35:44 +08:00
Lin, Hung-Shin 4a74127785 Merge pull request #2 from lancatlin/app-neil
Add Learning Page UI in App.vue
2023-07-21 19:38:42 +08:00
Chen, Tai-Lin 589b0736b9 merge Learning Page UI prototype into App.vue 2023-07-21 18:02:51 +08:00
Chen, Tai-Lin de47d2585a Learning Page UI prototype 2023-07-21 16:44:14 +08:00
Lin, Hung-Shin b39c5395e3 Update ci_cd.yml 2023-07-21 11:59:11 +08:00
wancat 6d8163f6a6 Add github action 2023-07-21 11:53:04 +08:00
wancat 2dffd2f74d Add config.js, dockerfile 2023-07-21 11:27:01 +08:00
Lin, Hung-Shin 4ffdb5d627 Merge pull request #1 from lancatlin/server-justin
Add Quests and Sessions API
2023-07-20 21:55:52 +08:00
wancat c4e14fa271 Update README, format script 2023-07-20 17:05:01 +08:00
wancat 5410254ee0 Finish get single and delete api for sessions 2023-07-20 16:30:58 +08:00
wancat 43f54b4f93 Create and get session list api 2023-07-20 16:25:54 +08:00
wancat 3e9e14399a Directly use folder name as _id in Quest 2023-07-20 16:25:10 +08:00
wancat 0d9b068678 Update spec to use _id 2023-07-20 16:24:39 +08:00
wancat 237d6d5797 Create session 2023-07-20 15:54:27 +08:00
wancat 5e8115be11 Add quest to API spec
+ Remove timestamps
+ Add 404 error handling
2023-07-20 15:36:51 +08:00
wancat 247c75ff84 Get quest list and quest details
+ Add timestamps to quest
2023-07-20 15:23:39 +08:00
wancat 3637d41529 Load and update quests on startup 2023-07-20 15:08:47 +08:00
wancat b2173d180d Read all quest data in the folder 2023-07-19 20:01:14 +08:00
wancat 87f5e86108 Update API spec
+ to use json as post data
+ new SessionSummary component to return as list
2023-07-19 20:00:35 +08:00
wancat da4b1b18a4 Create fake auth middleware
Work in progress
2023-07-19 16:54:32 +08:00
wancat 04edfdd0dc Define routes, controllers of sessions
Work in progress, debugging
2023-07-19 16:42:09 +08:00
wancat 50443b96e0 Connect to mongodb, define schemas 2023-07-19 15:30:36 +08:00
wancat d51a75e5bc Re-organize code 2023-07-18 20:33:08 +08:00
wancat 8901b385ad Add swagger 2023-07-18 20:11:05 +08:00
wancat 20f64e1426 Merge remote-tracking branch 'origin/main' 2023-07-15 15:46:38 +08:00
wancat 45a0aa6249 Move server back to index.js 2023-07-15 15:43:13 +08:00
wancat de637f3cf6 Turn off eslint import/extension 2023-07-15 15:30:42 +08:00
wancat df12fee39c Reuse container by name 2023-07-15 15:22:19 +08:00
wancat e3d66709e4 Connect to terminal in raw mode
Able to use VIM
2023-07-15 15:04:58 +08:00
wancat 69ef435b77 Success to execute and show output using Websocket 2023-07-15 14:36:51 +08:00
wancat f17c2a9ef5 Change to use Socket.IO 2023-07-15 12:29:54 +08:00
wancat c80a6fae6d Create a websocket server and client 2023-07-15 11:55:46 +08:00
wancat 0ca4bf0bc8 Create docker container and attach 2023-07-15 11:55:38 +08:00
Chen, Tai-Lin 4fbd5b4ada Fixed wrong link in README.md 2023-07-14 21:53:08 +08:00
wancat 14663476ae Setup Tailwind 2023-07-14 21:26:23 +08:00
wancat ad4dc6d576 Setup ESLint + Prettier, Re-setup Express 2023-07-14 21:19:53 +08:00
wancat f32fcd2508 Init project with Vue & Express monorepo 2023-07-14 20:51:39 +08:00