Supply a web terminal to manage Spring Boot app. Why?
- Access easy: not install, no env setup, just open the browser
- Use commands to manage app
- No need to us curl to call lots of REST API
- Easy to write commands by Spring Shell
Attention: You should care about security by yourself.
- Edit pom.xml and add following dependency:
<dependencies>
<dependency>
<groupId>org.mvnsearch</groupId>
<artifactId>xtermjs-spring-boot-starter</artifactId>
<version>1.3.1</version>
</dependency>
</dependencies>
- Open application.properties and add rsocket configuration.
# rsocket websocket
spring.rsocket.server.mapping-path=/rsocket
spring.rsocket.server.transport=websocket
# disable spring shell interactive mode
spring.shell.interactive.enabled=false
- Start Spring Boot app and visit http://localhost:8080/xterm
- History: arrow up/down
- Ctrl+U: clear input
- clear: clear the screen
- exit: close the window/tab
- cd, ls, tree etc. support by ZT Process Executor
- date
- curl: curl command for http operation
- threads: display threads
- classpath: display classpath
- Help: Spring Shell help
- app: display app information
- beans: display all spring beans
- bean: display bean definition
- profiles: display profile
- metrics: display metrics
- health: display health information
- spel: execute SpEL expression 'spel userService.findById(1)'
- actuator: display actuator information
- redis commands
use redis
set nick linux_china
get nick
exit
- mysql commands
use db
select * from account;
exit db
- Start Spring Boot App to supply xterm backend service
- Start "npm run start" to start Webpack dev server for JavaScript development
- Xterm.js Home: https://xtermjs.org/
- Spring Shell Docs: https://docs.spring.io/spring-shell/docs/current/reference/htmlsingle/
- xterm.js + local echo https://www.linkedin.com/pulse/xtermjs-local-echo-ioannis-charalampidis
- How to change the output color of echo in Linux: https://stackoverflow.com/questions/5947742/how-to-change-the-output-color-of-echo-in-linux
- NO_COLOR: https://no-color.org/