mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
248355a2f5f591540147f74fddcc017c7bae5a0b
backend: * add `username` and `email` 2 unique and required field to User * use PassportJS for authentication framework * use express-session, connect-mongo as backend * use passport-local for password authentication * use passport-jwt for container authentication frontend: * combined login / sign up flow * use http-only cookie * move login page from `/` to `/login`, automatically redirect client: * remove `list` command (not useful) * add authentication functions
Linux Odyssey
Requirements
- NodeJS
- Docker
- Yarn
Installation
git clone https://github.com/lancatlin/linux-odyssey.git
cd linux-odyssey
yarn install
Development
Run everything (frontend, backend, db, swagger, quests):
docker compose build
docker compose up -d
Deployment
docker compose -f docker-compose.prod.yml build
docker compose -f docker-compose.prod.yml push
# Server side
docker compose -f docker-compose.prod.yml pull
docker compose -f docker-compose.prod.yml up -d
Standalone App (without Docker)
Source: app/
# Connect to dev server (https://odyssey.wancat.cc)
yarn app
# Connect to localhost (http://localhost:3000)
yarn app:local
# Connect to anyhost
API_ENDPOINT=http://example.com yarn app:local
Swagger
docker compose up -d swagger
Open http://localhost:8080 to open Swagger
CLI terminal client (Docker not required)
yarn cli
Usage: client [options] [command]
Options:
-s, --session <string> Session ID
-c, --create Create a new session
-h, --host <string> Server host (default: "http://localhost:3000")
--help display help for command
Commands:
list List all sessions
connet to recent session:
yarn cli
connect to new session:
yarn cli -c
connect to specific session:
yarn cli -s 64d0de0367459c13004bc83f
connect to other host:
yarn cli -h https://example.com
list sessions:
yarn cli list
Languages
TypeScript
64%
Vue
24.2%
Go
4.2%
Shell
2.1%
Handlebars
2.1%
Other
3.3%