Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 15 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ For frontend module, nodejs, npm/yarn/pnpm is needed, pnpm is recommended.
To install the backend dependencies, you need to have Go installed. You can use the following command to install the dependencies:

```bash
cd module
cd modules
go mod download
```

Expand All @@ -33,19 +33,19 @@ go mod download
To install the frontend dependencies, you can use npm, yarn, or pnpm. Choose one of the following commands based on your preference:

```bash with npm
cd module/web
cd modules/web
npm install
```

```bash with yarn
cd module/web
cd modules/web
yarn install
```

or

```bash with pnpm
cd module/web
cd modules/web
pnpm install
```

Expand All @@ -56,7 +56,7 @@ pnpm install
You can start the backend server by running the following command:

```bash
cd module/api
cd modules/api
go run main.go --apiserver-host=https://192.168.33.129:6443
```

Expand All @@ -65,26 +65,23 @@ If your API server is running with self-signed certificate, you can set `--apise
### Frontend

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The pull request description mentions adding a Windows PowerShell example for setting the API_SERVER environment variable, but it seems to be missing from the changes. It would be great to include it for Windows users.

For example:

$env:API_SERVER="http://127.0.0.1:8080"; npm run dev


```bash with npm
cd module/web
cd modules/web
npm run build
API_SERVER={api module address} npm run start
Example: API_SERVER=http://127.0.0.1:8080 npm run dev
API_SERVER=http://127.0.0.1:8080 npm run dev
Comment on lines 69 to +70

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The npm run build command is typically used for creating a production build, which is then served using npm run start. The npm run dev command is for development and doesn't require a separate build step, as it compiles and serves assets on the fly. Including npm run build here could be confusing for developers.

For a development setup, you should only need to run the dev script. If you want to document both development and production startup, it would be clearer to separate them.

For example:

Development

API_SERVER=http://127.0.0.1:8080 npm run dev

Production

npm run build
API_SERVER=http://127.0.0.1:8080 npm run start

This comment also applies to the yarn and pnpm instructions.

Suggested change
npm run build
API_SERVER={api module address} npm run start
Example: API_SERVER=http://127.0.0.1:8080 npm run dev
API_SERVER=http://127.0.0.1:8080 npm run dev
API_SERVER=http://127.0.0.1:8080 npm run dev

```
or

```bash with yarn
cd module/web
cd modules/web
yarn build
API_SERVER={api module address} yarn start
Example: API_SERVER=http://127.0.0.1:8080 yarn dev
API_SERVER=http://127.0.0.1:8080 yarn dev
```
or

```bash with pnpm
cd module/web
cd modules/web
pnpm run build
API_SERVER={api module address} pnpm run start
Example: API_SERVER=http://127.0.0.1:8080 pnpm run dev
API_SERVER=http://127.0.0.1:8080 pnpm run dev
```

### Login with token

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The pull request description mentions adding notes on token expiry and the importance of least-privilege RBAC for production environments. These notes seem to be missing. Adding them would provide valuable security context for users.

For example, you could add a note that the cluster-admin role used in the example is for demonstration purposes only and a more restrictive, least-privilege role should be created for production use. You could also mention that tokens generated with kubectl create token are short-lived by default.

Expand All @@ -93,10 +90,12 @@ Example: API_SERVER=http://127.0.0.1:8080 pnpm run dev
kubectl create serviceaccount curl-user -n kube-system
kubectl create clusterrolebinding curl-user-binding --clusterrole=cluster-admin --serviceaccount=kube-system:curl-user -n kube-system

# For Kubernetes 1.23 and earlier:
kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep curl-user | awk '{print $1}')
# For Kubernetes 1.24 and later:
kubectl create token curl-user -n kube-system
# For Kubernetes 1.23 and earlier:
kubectl -n kube-system describe secret $(
kubectl -n kube-system get secret | grep curl-user | awk '{print $1}'
)
```

## Contributing
Expand Down