Skip to content

Commit

Permalink
minor/cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
zpgu committed Feb 6, 2024
1 parent ada1531 commit 95f3569
Show file tree
Hide file tree
Showing 10 changed files with 1,071 additions and 1,031 deletions.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@

Why another tool for terminal access? Plenty already available (in nodejs/python/...):
* good to have choices, not many with Java backend anyway
* some unique features (session/screen sharing/suspend/resume)
* some unique features (session sharing/suspend/resume, screen size propagation)

This application provides **terminal** access to any device that it can reach, presenting it in your browser (w/ xterm.js),
This application provides **terminal** access to any device that it can reach, presenting it in your browser (w/ xterm.js),
features include session sharing, suspend/resume sessions, multiple modes of access (ssh/telnet/tn3270) to various types of target
devices, maximum compatibility using pty access to some difficult/crusty old telnet devices, such as terminal/console servers that
convert serial ports for legacy servers/network elements. It even provides a way to access TN3270 mainframe hosts: you read it right,
mainframes are still around.
convert serial ports for legacy servers/network elements. It even provides a way to access TN3270 mainframe hosts in pty/c3270 mode.

### Spring boot with xterm.js, websocket for bidirectional data flow, pty for compatibility/flexibility

Expand All @@ -25,7 +24,7 @@ Requirements:
- git clone https://github.com/zpgu/WebTerminal
- cd WebTerminal
- mvn clean install
- java -jar target/WebTerminal-0.9-SNAPSHOT.jar
- java -jar target/WebTerminal-0.9-SNAPSHOT.jar (add --debug for debug output)
```

Now navigate your browser to:
Expand Down Expand Up @@ -57,14 +56,14 @@ When starting new sessions, you have the option to make them visible to everyone

While viewing the list of sessions, anyone can get into a visible session, either watch (read only), or join (read/write). Also
one can take over a visible session if so desired, and become the new owner. Owner can kill a session. Obviously anyone doing
an exit/logout on a session will terminate the session, as well as if the destination side disconnects for whatever reason.
an exit/logout on a session will terminate the underlying network connection/session, as well as if the destination side disconnects for whatever reason.

Session owner can suspend the session (temporarily detach xterm.js front end, and resume later at different time/location) by click on
'Suspend' button, or navigating away via broswer "beforeunload" hook if supported.

Everyone on the same session will be updated with current list of participants at all time.

Terminal size propagation from session owner to all joined sessions whenever terminal is resized by owner.
Terminal size propagation from session owner to all joined sessions whenever terminal is resized by owner (websocket bidirectional dataflow).

Session interaction can be logged to a file on the server (default in /tmp directory on server, for review/audit later for example).

Expand Down
152 changes: 81 additions & 71 deletions nbactions.xml
Original file line number Diff line number Diff line change
@@ -1,71 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<actions>
<action>
<actionName>CUSTOM-SpringBoot</actionName>
<displayName>SpringBoot</displayName>
<goals>
<goal>spring-boot:run</goal>
<goal>-Dspring-boot.run.arguments="--logging.level.org.webterminal=debug"</goal>
</goals>
</action>
<action>
<actionName>CUSTOM-SpringBoot-TRACE</actionName>
<displayName>SpringBoot-TRACE</displayName>
<goals>
<goal>spring-boot:run</goal>
<goal>-Dspring-boot.run.arguments="--logging.level.org.webterminal=trace"</goal>
</goals>
</action>
<action>
<actionName>run</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:3.0.0:exec</goal>
</goals>
<properties>
<exec.vmArgs></exec.vmArgs>
<exec.args>${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args>
<exec.appArgs>--logging.level.org.webterminal=debug</exec.appArgs>
<exec.mainClass>org.webterminal.WebTerminal</exec.mainClass>
<exec.executable>java</exec.executable>
</properties>
</action>
<action>
<actionName>debug</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:3.0.0:exec</goal>
</goals>
<properties>
<exec.vmArgs>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address}</exec.vmArgs>
<exec.args>${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args>
<exec.appArgs>--logging.level.org.webterminal=debug</exec.appArgs>
<exec.mainClass>org.webterminal.WebTerminal</exec.mainClass>
<exec.executable>java</exec.executable>
<jpda.listen>true</jpda.listen>
</properties>
</action>
<action>
<actionName>profile</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:3.0.0:exec</goal>
</goals>
<properties>
<exec.vmArgs></exec.vmArgs>
<exec.args>${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args>
<exec.mainClass>org.webterminal.WebTerminal</exec.mainClass>
<exec.executable>java</exec.executable>
<exec.appArgs>--logging.level.org.webterminal=debug</exec.appArgs>
</properties>
</action>
</actions>
<?xml version="1.0" encoding="UTF-8"?>
<actions>
<action>
<actionName>CUSTOM-SpringBoot</actionName>
<displayName>SpringBoot</displayName>
<goals>
<goal>spring-boot:run</goal>
<goal>-Dspring-boot.run.arguments="--logging.level.org.webterminal=debug"</goal>
</goals>
</action>
<action>
<actionName>CUSTOM-SpringBoot-TRACE</actionName>
<displayName>SpringBoot-TRACE</displayName>
<goals>
<goal>spring-boot:run</goal>
<goal>-Dspring-boot.run.arguments="--logging.level.org.webterminal=trace"</goal>
</goals>
</action>
<action>
<actionName>run</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:3.0.0:exec</goal>
</goals>
<properties>
<exec.vmArgs></exec.vmArgs>
<exec.args>${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args>
<exec.appArgs>--logging.level.org.webterminal=debug</exec.appArgs>
<exec.mainClass>org.webterminal.WebTerminal</exec.mainClass>
<exec.executable>java</exec.executable>
</properties>
</action>
<action>
<actionName>debug</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:3.0.0:exec</goal>
</goals>
<properties>
<exec.vmArgs>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address}</exec.vmArgs>
<exec.args>${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args>
<exec.appArgs>--logging.level.org.webterminal=debug</exec.appArgs>
<exec.mainClass>org.webterminal.WebTerminal</exec.mainClass>
<exec.executable>java</exec.executable>
<jpda.listen>true</jpda.listen>
</properties>
</action>
<action>
<actionName>profile</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:3.0.0:exec</goal>
</goals>
<properties>
<exec.vmArgs></exec.vmArgs>
<exec.args>${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args>
<exec.mainClass>org.webterminal.WebTerminal</exec.mainClass>
<exec.executable>java</exec.executable>
<exec.appArgs>--logging.level.org.webterminal=debug</exec.appArgs>
</properties>
</action>
<action>
<actionName>CUSTOM-SpotBugs GUI</actionName>
<displayName>SpotBugs GUI</displayName>
<goals>
<goal>clean</goal>
<goal>compile</goal>
<goal>spotbugs:spotbugs</goal>
<goal>spotbugs:gui</goal>
</goals>
</action>
</actions>
36 changes: 30 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.8</version>
<version>2.7.18</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<properties>
Expand Down Expand Up @@ -53,7 +53,7 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.11.0</version>
<version>2.13.0</version>
</dependency>
<dependency>
<groupId>commons-net</groupId>
Expand All @@ -77,12 +77,12 @@
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.12.2</version>
<version>2.12.5</version>
</dependency>
<dependency>
<groupId>com.fasterxml.uuid</groupId>
<artifactId>java-uuid-generator</artifactId>
<version>4.1.0</version>
<version>4.2.0</version>
<type>jar</type>
</dependency>
<dependency>
Expand All @@ -99,7 +99,7 @@
<dependency>
<groupId>org.jetbrains.pty4j</groupId>
<artifactId>pty4j</artifactId>
<version>0.12.10</version>
<version>0.12.13</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
Expand Down Expand Up @@ -139,12 +139,36 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<version>3.11.0</version>
<configuration>
<showDeprecation>true</showDeprecation>
<compilerArgument>-Xlint:unchecked</compilerArgument>
</configuration>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>4.8.3.0</version>
<!-- configuration>
<includeFilterFile>spotbugs-security-include.xml</includeFilterFile>
<excludeFilterFile>spotbugs-security-exclude.xml</excludeFilterFile>
<plugins>
<plugin>
<groupId>com.h3xstream.findsecbugs</groupId>
<artifactId>findsecbugs-plugin</artifactId>
<version>1.12.0</version>
</plugin>
</plugins>
</configuration -->
<dependencies>
<!-- overwrite dependency on spotbugs if you want to specify the version of spotbugs -->
<dependency>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs</artifactId>
<version>4.8.3</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
Loading

0 comments on commit 95f3569

Please sign in to comment.