Skip to content

Commit

Permalink
Release 2.9.1 DB tracking, Email logger and remote connect code chang…
Browse files Browse the repository at this point in the history
…es (#156)

* support dynamic variables when directory path for error and sent are
Added to new outbound message

* Allow using parameters in the path for sentDir and errorDir

* Socket Command Processor enhancements
Allow different formats to be returned in the response to a socket
command processor
Change command to exit as being exit the local instance running command
processor remote.
Add "shutdown" as command to terminate OpenAS2 server from remote
command procesor.

* Enhanced documentation for release

* Remove mistaken  pasted text

* Make sure it returns an error message when userId/Password are
incorrect.

* Helper script to use remote socket command interface

* Remove unused import

* Support filtering based on additional conditions

* Pass throwable instead of making 2 log calls allowing decision to log
stacktrace to be made down the chain

* Pass throwable

* Support additional filters on logging

* Fix STATE field value lookup

* Use app generated timestamps
Add additional SQL stmt logging at TRACE level for debugging

* Documentation updates for logging

* Updated with remote script information.

* Final release notes for 2.9.1

* Updated POM's for 2.9.1

* Improving documentation for the remote command processor

* Update documentation around remote command processor
  • Loading branch information
uhurusurfa authored Aug 3, 2019
1 parent ca5271c commit bb250db
Show file tree
Hide file tree
Showing 22 changed files with 631 additions and 522 deletions.
2 changes: 1 addition & 1 deletion Bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>net.sf.openas2</groupId>
<artifactId>OpenAS2</artifactId>
<version>2.9.0</version>
<version>2.9.1</version>
</parent>

<artifactId>openas2-osgi</artifactId>
Expand Down
22 changes: 12 additions & 10 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
# OpenAS2 Server
# Version 2.9.0
# Version 2.9.1
# RELEASE NOTES
-----
The OpenAS2 project is pleased to announce the release of OpenAS2 2.9.0
The OpenAS2 project is pleased to announce the release of OpenAS2 2.9.1

The release download file is: OpenAS2Server-2.9.0.zip
The release download file is: OpenAS2Server-2.9.1.zip

The zip file contains a PDF document (OpenAS2HowTo.pdf) providing information on installing and using the application.

Version 2.9.0 - 2019-03-28
Version 2.9.1 - 2019-08-03
This is a an enhancement and bugfix release:
**IMPORTANT NOTE**: Please review upgrade notes if you are upgrading

1. Provide ability to dynamically set the target URL for the partner based on directory polling mopdule configuration.
2. Add tracking of sent file name to database tracking of AS2 messages (see upgrade notes for upgrading)
3. Document the mechanism for using the dynamic URL feature
4. Update documentation on database schema upgrades
5. Fix a bug in 2.8.0 release that caused DB tracking not to track messages

1. Support additional filters on logging to support reduced email logger errors flagging interface errors due to exernal access attemopts to AS2 server..
2. Fixed error where DB tracking module was not logging fields to database.
3. Documented additional logging filters.
4. Support for dynamic variables in sentDir and errorDir attributes in the config.
5. Enhanced the remote command processor to support text output format.
6. Updarted remote command processor documentation.
7. Added a script to run the remote command interface from the command line.
8. Included the remote socket command processor app jar into the release package to allow use without a separate effort to set up.

##Upgrade Notes
See the openAS2HowTo appendix for the general process on upgrading OpenAS2.
Expand Down
2 changes: 1 addition & 1 deletion Remote/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>net.sf.openas2</groupId>
<artifactId>OpenAS2</artifactId>
<version>2.9.0</version>
<version>2.9.1</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
20 changes: 17 additions & 3 deletions Remote/src/main/java/org/openas2/remote/CommandLine.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static void main(String args[]) {
String host, port, name, pwd;
if (args.length == 0) {
host = "localhost";
port = "14322";
port = "14321";
name = "userID";
pwd = "pWd";

Expand All @@ -47,8 +47,22 @@ public static void main(String args[]) {
String icmd = br.readLine().trim();
System.out.print("");
if (icmd.length() < 1) {
System.out.println("adios");
return;
System.out.println("\r\n");
continue;
}
else if ("exit".equals(icmd)) {
System.out.println("Terminating remote session.\r\n");
return;
}
else if ("shutdown".equals(icmd)) {
System.out.println("This will shutdown your OpenAS2 server. Are you sure you wish to do this? [Y/N]");
String confirm = br.readLine().trim();
if (!"Y".equalsIgnoreCase(confirm)) {
icmd = "";
System.out.println("Command cancelled.\r\n");
continue;
}
else icmd="exit";
}
s = (SSLSocket) SSLSocketFactory.getDefault().createSocket(InetAddress.getByName(host), iport);
String cipherSuites = System.getProperty("CmdProcessorSocketCipher", "TLS_DH_anon_WITH_AES_256_CBC_SHA");
Expand Down
6 changes: 5 additions & 1 deletion Server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<!-- DO NOT CHANGE THIS "groupId" WITHOUT CHANGING XMLSession.getManifestAttributes.MANIFEST_VENDOR_ID_ATTRIB -->
<groupId>net.sf.openas2</groupId>
<artifactId>OpenAS2</artifactId>
<version>2.9.0</version>
<version>2.9.1</version>
</parent>

<artifactId>openas2-server</artifactId>
Expand All @@ -22,6 +22,7 @@
<mainClass>org.openas2.app.OpenAS2Server</mainClass>
<project.dist.package.name>${project.parent.artifactId}Server-${project.version}.zip</project.dist.package.name>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<remote.connect.jar>${project.basedir}/../Remote/target/openas2-remote-${project.version}.jar</remote.connect.jar>
<help.file.src>${project.basedir}/../docs/OpenAS2HowTo.pdf</help.file.src>
<release.notes>${project.basedir}/../RELEASE-NOTES.md</release.notes>
<release.history>${project.basedir}/../changes.txt</release.history>
Expand Down Expand Up @@ -79,6 +80,9 @@
todir="${project.build.directory}/dist" verbose="true" />
<copy file="${release.history}"
todir="${project.build.directory}/dist" verbose="true" />
<!-- Add the remote jar for connecting to the server command interface -->
<copy file="${remote.connect.jar}"
todir="${project.build.directory}/dist/bin/remote" verbose="true" />
<!-- create distribution package -->
<zip
destfile="${project.basedir}/dist/${project.dist.package.name}"
Expand Down
82 changes: 82 additions & 0 deletions Server/src/bin/remote_connect.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#!/bin/bash
set -e
# purpose: runs the remote OpenAS2 connect application
x=`basename $0`

function usage() {
echo "Connect to a running instance of OpenAS2."
echo "usage: ${x} <-u user ID> <-P password> [-h host] [-p port] [-c cipher]"
echo " WHERE"
echo " user ID = the user ID configured for the socket command processor module"
echo " password = the password configured for the socket command processor module"
echo " Can be set as OPENAS2_SOCKET_PWD environment variable"
echo " host = hostname or IP address of OpenAS2 server. Defaults to \"localhost\" if not provided."
echo " port = port that the OpenAS2 socket command processor is running on. Defaults to 14321 if not provided."
echo " cipher = anonymous cipher for the OpenAS2 socket command processor connection. Defaults to whatever is in the compiled jar if not provided."
echo ""
echo " eg. $0 -u MyuserId -p MySecret"
echo " $0 -u MyuserId -p MySecret -h as2.mydomain.com"
echo " $0 -u MyuserId -p MySecret -h as2.mydomain.com -c SSL_DH_anon_WITH_RC4_128_MD5"
exit 1
}

if test $# -lt 2; then
usage
fi

HOST_NAME=localhost
HOST_PORT=14321

while getopts "u:p:h:P:" opt; do
case ${opt} in
u ) OPENAS2_SOCKET_UID=$OPTARG
;;
P ) OPENAS2_SOCKET_PWD=$OPTARG
;;
h ) HOST_NAME=$OPTARG
;;
p ) HOST_PORT=$OPTARG
;;
c ) CIPHER=$OPTARG
;;
\? ) usage
;;
esac
done

if [ ! -z $CIPHER ]; then
SET_CIPHER="-DCmdProcessorSocketCipher=$CIPHER"
else
SET_CIPHER=""
fi
binDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# Backwards compatibility: use value from pid_file if pid_file has a value and openas2_pid has no value.
#
if [ -z $JAVA_HOME ]; then
OS=$(uname -s)

if [[ "${OS}" == *Darwin* ]]; then
# Mac OS X platform
JAVA_HOME=$(/usr/libexec/java_home)
elif [[ "${OS}" == *Linux* ]]; then
# Linux platform
JAVA_HOME=$(dirname $(dirname $(readlink -f $(which java))))
elif [[ "${OS}" == *MINGW* ]]; then
# Windows NT platform
echo "Windows not supported by this script"
fi
fi

if [ -z $JAVA_HOME ]; then
echo "ERROR: Cannot find JAVA_HOME"
exit 1
fi

CMD=`echo "${JAVA_HOME}/bin/java ${SET_CIPHER} -cp .:${binDir}/remote/* org.openas2.remote.CommandLine ${HOST_NAME} ${HOST_PORT} ${OPENAS2_SOCKET_UID} ${OPENAS2_SOCKET_PWD}"`
echo
echo Running ${CMD}
echo
${CMD}
RETVAL="$?"
exit $RETVAL
7 changes: 5 additions & 2 deletions Server/src/config/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@

<!-- Remove this comment to enable emailing of exceptions
<logger classname="org.openas2.logging.EmailLogger"
show="terminated"
only_active_msg_transfer_errors="false"
log_exception_trace="false"
javax.mail.properties.file="%home%/java.mail.properties"
from="openas2"
to="your email address"
smtpserver="your smtp server"
smtpport="your smtp server port"
smtpauth="true"
smtpuser="mySmtpUserId"
smtppwd="mySmtpPwd"
Expand All @@ -48,7 +50,8 @@
<commandProcessor classname="org.openas2.cmd.processor.SocketCommandProcessor"
portId="14321"
userid="userID"
password="pWd"/>
password="pWd"
response_format="xml"/>
</commandProcessors>
<processor classname="org.openas2.processor.DefaultProcessor"
pendingMDN="$properties.storageBaseDir$/pendingMDN3"
Expand Down
Loading

0 comments on commit bb250db

Please sign in to comment.