fanla2021 commented on a change in pull request #13665:
URL: https://github.com/apache/pulsar/pull/13665#discussion_r800466727



##########
File path: site2/docs/administration-pulsar-manager.md
##########
@@ -21,89 +22,42 @@ docker run -it \
     -e 
SPRING_CONFIGURATION_FILE=/pulsar-manager/pulsar-manager/application.properties 
\
     apachepulsar/pulsar-manager:v0.2.0
 ```
-
+* Pulsar Manager is divided into front-end and back-end, the front-end service 
port is `9527` and the back-end service port is `7750`.
 * `SPRING_CONFIGURATION_FILE`: Default configuration file for spring.
+* By default, Pulsar Manager uses the `herddb` database. HerdDB is a SQL 
distributed database implemented in Java and can be found at 
[herddb.org](https://herddb.org/) for more information.
 
-### Set administrator account and password
-
- ```shell
-CSRF_TOKEN=$(curl http://localhost:7750/pulsar-manager/csrf-token)
-curl \
-    -H 'X-XSRF-TOKEN: $CSRF_TOKEN' \
-    -H 'Cookie: XSRF-TOKEN=$CSRF_TOKEN;' \
-    -H "Content-Type: application/json" \
-    -X PUT http://localhost:7750/pulsar-manager/users/superuser \
-    -d '{"name": "admin", "password": "apachepulsar", "description": "test", 
"email": "[email protected]"}'
-```
-
-You can find the docker image in the [Docker 
Hub](https://github.com/apache/pulsar-manager/tree/master/docker) directory and 
build an image from the source code as well:
-
-```
-git clone https://github.com/apache/pulsar-manager
-cd pulsar-manager/front-end
-npm install --save
-npm run build:prod
-cd ..
-./gradlew build -x test
-cd ..
-docker build -f docker/Dockerfile --build-arg BUILD_DATE=`date -u 
+"%Y-%m-%dT%H:%M:%SZ"` --build-arg VCS_REF=`latest` --build-arg 
VERSION=`latest` -t apachepulsar/pulsar-manager .
-```
-
-### Use custom databases
+### Configure Database or JWT authentication
+####  Configure Database  
 
-If you have a large amount of data, you can use a custom database. The 
following is an example of PostgreSQL.   
+If you have a large amount of data, you can use a custom database. 
 
-1. Initialize database and table structures using the 
[file](https://github.com/apache/pulsar-manager/tree/master/src/main/resources/META-INF/sql/postgresql-schema.sql).
+The following is an example of PostgreSQL.
 
-2. Modify the [configuration 
file](https://github.com/apache/pulsar-manager/blob/master/src/main/resources/application.properties)
 and add PostgreSQL configuration.
-
-```
+  1. Initialize database and table structures using the 
[file](https://github.com/apache/pulsar-manager/blob/master/src/main/resources/META-INF/sql/postgresql-schema.sql).
+  2. Download and modify the [configuration 
file](https://github.com/apache/pulsar-manager/blob/master/src/main/resources/application.properties),
 then add the PostgreSQL configuration.
+```properties
 spring.datasource.driver-class-name=org.postgresql.Driver
 spring.datasource.url=jdbc:postgresql://127.0.0.1:5432/pulsar_manager
 spring.datasource.username=postgres
 spring.datasource.password=postgres
 ```
 
-3. Compile to generate a new executable jar package.
-
-```
-./gradlew build -x test
-```
-
-### Enable JWT authentication
-
-If you want to turn on JWT authentication, configure the following parameters:
-
-* `backend.jwt.token`: token for the superuser. You need to configure this 
parameter during cluster initialization.
-* `jwt.broker.token.mode`: multiple modes of generating token, including 
PUBLIC, PRIVATE, and SECRET.
-* `jwt.broker.public.key`: configure this option if you use the PUBLIC mode.
-* `jwt.broker.private.key`: configure this option if you use the PRIVATE mode.
-* `jwt.broker.secret.key`: configure this option if you use the SECRET mode.
-
-For more information, see [Token Authentication Admin of 
Pulsar](http://pulsar.apache.org/docs/en/security-token-admin/).
-
-
-If you want to enable JWT authentication, use one of the following methods.
-
-
-* Method 1: use command-line tool
-
-```
-wget 
https://dist.apache.org/repos/dist/release/pulsar/pulsar-manager/apache-pulsar-manager-0.2.0/apache-pulsar-manager-0.2.0-bin.tar.gz
-tar -zxvf apache-pulsar-manager-0.2.0-bin.tar.gz
-cd pulsar-manager
-tar -zxvf pulsar-manager.tar
-cd pulsar-manager
-cp -r ../dist ui
-./bin/pulsar-manager --redirect.host=http://localhost --redirect.port=9527 
insert.stats.interval=600000 --backend.jwt.token=token 
--jwt.broker.token.mode=PRIVATE 
--jwt.broker.private.key=file:///path/broker-private.key 
--jwt.broker.public.key=file:///path/broker-public.key 
+  3. Add a configuration mount and start with a docker image.
+```bash
+docker pull apachepulsar/pulsar-manager:v0.2.0
+docker run -it \
+    -p 9527:9527 -p 7750:7750 \
+    -v /your-path/application.properties:/pulsar-manager/pulsar-
+manager/application.properties
+    -e 
SPRING_CONFIGURATION_FILE=/pulsar-manager/pulsar-manager/application.properties 
\
+    apachepulsar/pulsar-manager:v0.2.0

Review comment:
       That's it. I've simplified the Quick Start command, if you need to set 
environment variables, you can refer to the detailed parameters below.

##########
File path: site2/docs/administration-pulsar-manager.md
##########
@@ -114,69 +68,116 @@ or
 jwt.broker.token.mode=SECRET
 jwt.broker.secret.key=file:///path/broker-secret.key
 ```
+•      `backend.jwt.token`: token for the superuser. You need to configure 
this parameter during cluster initialization.   
+•      `jwt.broker.token.mode`: multiple modes of generating token, including 
PUBLIC, PRIVATE, and SECRET.  
+•      `jwt.broker.public.key`: configure this option if you use the PUBLIC 
mode.  
+•      `jwt.broker.private.key`: configure this option if you use the PRIVATE 
mode.  
+•      `jwt.broker.secret.key`: configure this option if you use the SECRET 
mode.  
+For more information, see [Token Authentication Admin of 
Pulsar](https://pulsar.apache.org/docs/en/security-token-admin/). 
 
-* Method 3: use Docker and enable token authentication.
+Docker command to add profile and key files mount.
 
-```
-export JWT_TOKEN="your-token"
-docker run -it -p 9527:9527 -p 7750:7750 -e REDIRECT_HOST=http://localhost -e 
REDIRECT_PORT=9527 -e DRIVER_CLASS_NAME=org.postgresql.Driver -e 
URL='jdbc:postgresql://127.0.0.1:5432/pulsar_manager' -e USERNAME=pulsar -e 
PASSWORD=pulsar -e LOG_LEVEL=DEBUG -e JWT_TOKEN=$JWT_TOKEN -v $PWD:/data 
apachepulsar/pulsar-manager:v0.2.0 /bin/sh
+```bash
+docker pull apachepulsar/pulsar-manager:v0.2.0
+docker run -it \
+    -p 9527:9527 -p 7750:7750 \
+    -v /your-path/application.properties:/pulsar-manager/pulsar-
+manager/application.properties
+    -v /your-path/private.key:/pulsar-manager/private.key
+    -e 
SPRING_CONFIGURATION_FILE=/pulsar-manager/pulsar-manager/application.properties 
\
+    apachepulsar/pulsar-manager:v0.2.0

Review comment:
       That's it. I've simplified the Quick Start command, if you need to set 
environment variables, you can refer to the detailed parameters below.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to