Skip to content

Commit 01b93bc

Browse files
committed
v0.5.13 update
updated README bumped Jsch dependency to v0.2.24 disabled "Sync Operator Data" menu option lowered server status interval from 1 day to 4 hours (frontend graphic change) added ls, listtunnels, and exec commands added a cli terminal to directly run commands
1 parent 89926c7 commit 01b93bc

19 files changed

+441
-52
lines changed

LICENSE

Lines changed: 0 additions & 29 deletions
This file was deleted.

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ WebCTRL is a trademark of Automated Logic Corporation. Any other trademarks men
2323
- [Reverse Operator Sync](#reverse-operator-sync)
2424
- [Operator Blacklist](#operator-blacklist)
2525
- [Operator Blacklist Exceptions](#operator-blacklist-exceptions)
26+
- [CLI Terminal](#cli-terminal)
2627
- [Pending Commands](#pending-commands)
2728
- [Examples](#examples)
2829
- [SSH Tunnels](#ssh-tunnels)
@@ -195,7 +196,7 @@ In addition to the SFTP connection settings shown in the previous section, there
195196
| `debug` | `false` | When enabled, log messages will be more verbose. |
196197
| `log_expiration` | `60` | Specifies how many days to retain log messages in the database. |
197198
| `auto_update` | `true` | Specifies whether to attempt automatic updates for this add-on. |
198-
| `version` | `0.5.12` | When `auto_update` is enabled, any connected client whose add-on version is less than this value will be updated. |
199+
| `version` | `0.5.13` | When `auto_update` is enabled, any connected client whose add-on version is less than this value will be updated. |
199200
| `download_path` | `/webctrl/addons/PostgreSQL_Connect.addon` | When `auto_update` is enabled, this is the SFTP server path where the latest version add-on file will be retrieved. |
200201
| `license_directory` | `/webctrl/licenses` | Specifies an SFTP server directory path for where to store WebCTRL license files. |
201202
| `ftp_host` | `postgresql.domain.com` | SFTP server hostname or IP address. |
@@ -228,7 +229,7 @@ This page lists all connected servers. If a server is decomissioned or permanent
228229
| ID | `1` | Internal ID which uniquely identifies the server within the PostgreSQL database. (Read-only) |
229230
| Name | `ACES Main Building` | User-friendly display name for the server. This defaults to the display name of the root of the Geo tree. |
230231
| WebCTRL Version | `8.5.002.20230323-123687` | Full version of the WebCTRL server. (Read-only) |
231-
| Add-On Version | `0.5.12` | Installed version of the PostgreSQL_Connect add-on. (Read-only) |
232+
| Add-On Version | `0.5.13` | Installed version of the PostgreSQL_Connect add-on. (Read-only) |
232233
| IP Address | `123.45.67.89` | External IP address of the server as viewed by the PostgreSQL database. (Read-only) |
233234
| Last Sync | `2024-12-02 14:05:32` | Timestamp of the last successful synchronization. If synced within the last 24 hours, the background color is green; otherwise, the background is red. (Read-only) |
234235
| License | `WebCTRL Premium` | Click this field to download WebCTRL's license. (Read-only) |
@@ -302,6 +303,12 @@ Exceptions entered into this table through the add-on's configuration pages affe
302303
| - | - | - |
303304
| Username | `aces` | Specifies a blacklisted username which should be allowed to exist on this WebCTRL server. |
304305

306+
### CLI Terminal
307+
308+
This webpage allows you to directly run CLI commands on the WebCTRL server. Supported commands are shown in the next section. You may use **SHIFT+ENTER** for submitting multiple commands at once. The up and down arrow keys may be used to navigate command history.
309+
310+
![](./resources/cli_example.png)
311+
305312
### Pending Commands
306313

307314
Commands entered into this table are executed on servers during their next sync interval.
@@ -319,6 +326,7 @@ Commands chained together using new-lines in a single entry are fail-fast, which
319326
| Command | Description |
320327
| - | - |
321328
| `duplicate [id1,id2,...]` | When a new pending command is created, and `duplicate` is on the first line, the command is copied to all servers with the specified IDs. If no server IDs are specified, then the command is copied to all servers. You can use `%ID%` or `%NAME%` anywhere in the command after the `duplicate` statement, and it will be replaced with the server ID or name of each server the command is copied to. |
329+
| `exec <timeout> <exit_code> <args>...` | Invokes a system shell command. If the command does not complete within `timeout` milliseconds, then it is forcibly terminated. The environment's current directory for this command is set to the active WebCTRL system directory. Arguments are passed to [ProcessBuilder](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/ProcessBuilder.html). For certain command structures, you may have to prefix with `/bin/bash -c`, `cmd /c`, or `powershell -NoLogo -NonInteractive -NoProfile -Command`. This command is considered to have succeeded when the process's exit code is equal to `exit_code`. You can specify multiple allowed exit codes by delimiting them with commas. To accept all exit codes, specify `*`. |
322330
| `about` | Logs a bunch of information relevant to the WebCTRL server. This functions similarly to the `about` manual command. |
323331
| `log <message>` | Writes a message to the add-on's log file. |
324332
| `notify <message>` | Functions identically to the `notify` manual command. Logged in operators get a popup message in their web browsers. |
@@ -334,6 +342,7 @@ Commands chained together using new-lines in a single entry are fail-fast, which
334342
| `cp <src_path> <dst_path>` | Copies a file on the local file system of the WebCTRL server. |
335343
| `mv <src_path> <dst_path>` | Moves a file or directory on the local file system of the WebCTRL server. Try using `cp` and `rmdir` to move a folder if you encounter errors with this command; this command generally only works when the source and destination are on the same drive. |
336344
| `cat <file_path>` | Logs the contents of the specified file. |
345+
| `ls <folder_path>` | Logs a list of folders and files inside the specified directory. |
337346
| `exists <path>` | Asserts that the specified file or directory exists. If non-existent, then command execution is terminated. |
338347
| `!exists <path>` | Asserts that the specified file or directory does not exists. If it exists, then command execution is terminated. |
339348
| `regex <file_path> <find> [replace]` | If a replacement string is not given, then this commands logs all matches of the regular expression in the specified file. If a replacement string is given, then this command edits the specified file by replacing all matches of the regular expression. The file's contents are assumed to be UTF-8 encoded text. The [MULTILINE](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/regex/Pattern.html#MULTILINE) and [DOTALL](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/regex/Pattern.html#DOTALL) flags are used by default. |
@@ -344,6 +353,7 @@ Commands chained together using new-lines in a single entry are fail-fast, which
344353
| `updateDST` | Updates daylight savings dates stored in the WebCTRL database and marks controllers for a pending parameter download. |
345354
| `opentunnel <listen_port> <target_port> [timeout]` | Open a reverse SSH tunnel from the WebCTRL server to the SFTP server. `listen_port` is opened on the SFTP server, and connections to this port are forwarded to `target_port` on the WebCTRL server. After `timeout` expires, the tunnel will be closed at the next sync. If `timeout` is undefined, then the tunnel stays open until the next server reboot. |
346355
| `closetunnel [listen_port]` | Close a reverse SSH tunnel that was previously opened with the `opentunnel` command. If `listen_port` is unspecified, all tunnels are closed (excluding those configured in the [SSH Tunnels](#ssh-tunnels) section). |
356+
| `listtunnels` | Logs a list of all open SSH tunnels. |
347357

348358
#### Examples
349359

@@ -373,6 +383,8 @@ duplicate 14,50,42,55,36,32
373383
exists "/update_on_restart"
374384
log "Update did not install."
375385
rmdir "/update_on_restart"
386+
387+
exec 1000 * /bin/bash -c "lsb_release -a; echo $?"
376388
```
377389

378390
### SSH Tunnels
@@ -452,7 +464,7 @@ CREATE INDEX webctrl_trend_data_time ON webctrl.trend_data ("time" DESC);
452464
### Packaged Dependencies
453465

454466
- [PostgreSQL JDBC 42.7.5](https://jdbc.postgresql.org/) - Used to connect to PostgreSQL databases.
455-
- [JSch 0.2.23](https://github.com/mwiede/jsch) - Used to connect to SFTP servers.
467+
- [JSch 0.2.24](https://github.com/mwiede/jsch) - Used to connect to SFTP servers.
456468
- [JSON-java 20250107](https://github.com/stleary/JSON-java) - Used to encode and decode JSON data.
457469

458470
### Server ID Reset

config/BUILD_DETAILS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ webserver-api-9.0.002
3333
webui-9.0.002
3434

3535
Packaged Dependencies:
36-
jsch-0.2.23-sources
37-
jsch-0.2.23
36+
jsch-0.2.24-sources
37+
jsch-0.2.24
3838
json-20250107-sources
3939
json-20250107
4040
postgresql-42.7.5-sources

config/EXTERNAL_DEPS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
url:postgresql-42.7.5.jar:https://repo1.maven.org/maven2/org/postgresql/postgresql/42.7.5/postgresql-42.7.5.jar
22
url:postgresql-42.7.5-sources.jar:https://repo1.maven.org/maven2/org/postgresql/postgresql/42.7.5/postgresql-42.7.5-sources.jar
3-
url:jsch-0.2.23.jar:https://repo1.maven.org/maven2/com/github/mwiede/jsch/0.2.23/jsch-0.2.23.jar
4-
url:jsch-0.2.23-sources.jar:https://repo1.maven.org/maven2/com/github/mwiede/jsch/0.2.23/jsch-0.2.23-sources.jar
3+
url:jsch-0.2.24.jar:https://repo1.maven.org/maven2/com/github/mwiede/jsch/0.2.24/jsch-0.2.24.jar
4+
url:jsch-0.2.24-sources.jar:https://repo1.maven.org/maven2/com/github/mwiede/jsch/0.2.24/jsch-0.2.24-sources.jar
55
url:json-20250107.jar:https://repo1.maven.org/maven2/org/json/json/20250107/json-20250107.jar
66
url:json-20250107-sources.jar:https://repo1.maven.org/maven2/org/json/json/20250107/json-20250107-sources.jar

resources/cli_example.png

9.38 KB
Loading

root/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<extension version="1">
22
<name>PostgreSQL_Connect</name>
33
<description>Periodically synchronizes operators, add-ons, and specified trends with an external PostgreSQL database.</description>
4-
<version>0.5.12</version>
4+
<version>0.5.13</version>
55
<vendor>Automatic Controls Equipment Systems, Inc.</vendor>
66
<system-menu-provider>aces.webctrl.postgresql.web.SystemMenuEditor</system-menu-provider>
77
</extension>

root/webapp/WEB-INF/web.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@
3737
<url-pattern>/TableEditor</url-pattern>
3838
</servlet-mapping>
3939

40+
<servlet>
41+
<servlet-name>TerminalPage</servlet-name>
42+
<servlet-class>aces.webctrl.postgresql.web.TerminalPage</servlet-class>
43+
</servlet>
44+
<servlet-mapping>
45+
<servlet-name>TerminalPage</servlet-name>
46+
<url-pattern>/Terminal</url-pattern>
47+
</servlet-mapping>
48+
4049
<servlet>
4150
<servlet-name>InstallAddonPage</servlet-name>
4251
<servlet-class>aces.webctrl.postgresql.web.InstallAddonPage</servlet-class>

0 commit comments

Comments
 (0)