SpringBoot itself has provided the SSL configuration. You can use the project test Keystore:resources/rmqcngkeystore.jks. The store is generated with the following unix keytool commands:
#Generate Keystore and add alias rmqcngKey
keytool -genkeypair -alias rmqcngKey -keyalg RSA -validity 3650 -keystore rmqcngkeystore.jks
#View keystore content
keytool -list -v -keystore rmqcngkeystore.jks
#Transfer type as official
keytool -importkeystore -srckeystore rmqcngkeystore.jks -destkeystore rmqcngkeystore.jks -deststoretype pkcs12
Uncomment the following SSL properties in resources/application.properties. restart Dashboard then access with HTTPS.
#Set https port
server.port=8443
### SSL setting
server.ssl.key-store=classpath:rmqcngkeystore.jks
server.ssl.key-store-password=rocketmq
server.ssl.keyStoreType=PKCS12
server.ssl.keyAlias=rmqcngkey
Access Dashboard with username and password and logout to leave the dashboard。To stage the function on, we need the steps below:
1.Turn on the property in resources/application.properties. ```$xslt
rocketmq.config.loginRequired=true
rocketmq.config.dataPath=/tmp/rocketmq-console/data
* 2.Make sure the directory defined in property ${rocketmq.config.dataPath} exists and the file "users.properties" is created under it.
The dashboard system will use the resources/users.properties by default if a customized file is not found。
The format in the content of users.properties:
```$xslt
# This file supports hot change, any change will be auto-reloaded without Console restarting.
# Format: a user per line, username=password[,N] #N is optional, 0 (Normal User); 1 (Admin)
# Define Admin
admin=admin,1
# Define Normal users
user1=user1
user2=user2
If the login function is enabled when a user accesses the Console, the user controls the access permission of the interface based on the login role.
1.Turn on the property in resources/application.properties. ```$xslt
rocketmq.config.loginRequired=true
rocketmq.config.dataPath=/tmp/rocketmq-console/data
* 2.Make sure the directory defined in property ${rocketmq.config.dataPath} exists and the permission control file "role-permission.yml" is created under it.
The console system will use the resources/role-permission.yml by default if a customized file is not found。
The format in the content of role-permission.yml:
```$xslt
# This file supports hot change, any change will be auto-reloaded without Console restarting.
# Format: To add or delete interface permissions, add or delete interface addresses from the list.
# the interface paths can be configured with wildcard characters.
# ?: Matches 1 characters.
# *: Matches 0 or more characters that are not /.
# **: Matches 0 or more characters.
rolePerms:
# ordinary user
ordinary:
- /rocketmq/nsaddr
- /ops/*
- /dashboard/**
- /topic/*.query
- /topic/sendTopicMessage.do
- /producer/*.query
- /message/*
- /messageTrace/*
- /monitor/*
....