mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-05 19:20:12 +08:00
d997a061a91bfd1f216bb1bf0012ab752b098017
- Modify the Dockerfile in the `server/quests/helloworld` directory to add a user and change the working directory - Rename the file `server/quests/helloworld/entrypoint.sh` to `server/quests/helloworld/home/.bashrc` - Modify the `server/src/config.js` file to add the `isProduction` flag - Modify the `server/src/utils/docker.js` file to add a `HostConfig` option and bind a directory if not in production mode - Modify the Dockerfile to add an argument `DOCKER_GID` and create a group and user with the specified `DOCKER_GID` - Add a new Dockerfile.dev file with the same modifications as the Dockerfile - Add a new file `inspect.sh` - Modify the `server/src/client.js` file to use the `API_ENDPOINT` variable instead of a hardcoded URL Signed-off-by: wancat <wancat@wancat.cc>
Linux Odyssey
Requirements
- NodeJS
- Docker
- Yarn
Installation
git clone https://github.com/lancatlin/linux-odyssey.git
cd linux-odyssey
yarn install
Create database
docker compose up -d
Server
Source: server/
yarn server
# Open http://localhost:3000
App
Source: app/
yarn app
# Open http://localhost:5173/
CLI terminal client
Open server first, then create a session by POST /api/v1/sessions
curl -X 'POST' \
'http://localhost:3000/api/v1/sessions' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"quest_id": "helloworld"
}'
Then use the _id field in response
yarn cli [_id]
# example
yarn cli 64be226a39c0043cd1cdf7c2
Languages
TypeScript
64%
Vue
24.2%
Go
4.2%
Shell
2.1%
Handlebars
2.1%
Other
3.3%