-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Directory poller config moved to partnership XML (#269)
* Handle possible null mdn object to avoid exception being thrown * Enhance error messages to be clearer. * Support overriding the target directory for saving inbound files at partnership level. * Support replacing the %home% placeholder on load of XML doc. * Fix spelling error * Make getPartnership public * Only close if not alreadyclosed * Simple shell script to create DB table in H2 DB * Static for poller config XML element in partnerships.xml * Make looking up partnership possible from AS2 ID's * Support loading directory pollers from partnership config. Add duplicate poller checks based on AS2 ID's * Fix testing so that it does work in parallel rather than being blocked by file arrival checking * Remove redundant method * Fix comment indentation issue * Expand the classpath instead of using file globbing expansion in the java command as it seems to mess with Mailcap loading * Updated to test partnership based poller and no signed MDN response. * Set response MDN content type when not signed. * Base poller config stored in config.xml * Add cleanup of all partneship based pollers when a refresh is called * Fix weird logging method name "terminate:. * Remove obsolete jar * Add example for "store_received_file_to" attrib * Switch to using partnership pollers * Fix command for adding and storing partnership config. * Fix partnership relted commands to retain the original config of the file so it does not overwrite dynamic variables. * Update the packages to latest. * Add helper method to create a new XML doc * Windows version of the import script for certificates from another keystore. * Add information about maven testing and packaging commands. * configuration migration script * Release notes and version changes * Enhanced documentation for poller configuration. * Release note history * Make statics public * Remove redundant imports * Rules to prevent alpha/beta release candidate libs being used.
- Loading branch information
1 parent
ad5c350
commit 926e9da
Showing
57 changed files
with
2,100 additions
and
1,239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,79 @@ | ||
![logo](https://raw.githubusercontent.com/igwtech/OpenAs2App/master/docs/as2_logo.png) | ||
|
||
# As2Server | ||
The OpenAS2 application enables you to transmit and receive AS2 messages with EDI-X12, EDIFACT, XML, or binary payloads between trading partners. | ||
|
||
|
||
## Development | ||
There is a pom.xml in the Server folder to compile and create the jar and build the distribution package using Maven. | ||
The current version of the application is extracted from the POM and inserted into the MANIFEST.MF at build time. | ||
More detailed information is available in the DeveloperGuide.odt in the docs folder in Github. | ||
|
||
## Build | ||
|
||
Maven is used as a build tool. Therefore in order to build a snapshot the following command should be used: | ||
|
||
`./mvnw clean package` | ||
|
||
|
||
`./mvnw versions:set -DnewVersion=2.12.0-SNAPSHOT` | ||
|
||
## Deploy to Maven Central | ||
To deploy the released artifacts requires user ID and password for Sonatype. See developer guide for details: | ||
`./mvnw clean deploy -P release` - will require manual closing and release in Sonatype | ||
`./mvnw release:perform` | ||
`./mvnw nexus-staging:release -Ddescription="Some release comment here"` | ||
|
||
## How to create docker image | ||
|
||
To create docker image ,use the Dockerfile in the project. | ||
In terminal, open the folder where Dockerfile is located. | ||
Use below command to login to your dockerhub account through terminal. | ||
|
||
```console | ||
$ docker login | ||
``` | ||
|
||
Run below command to create image with name and tag. | ||
|
||
```console | ||
$ docker build -t openas2:latest . | ||
``` | ||
|
||
## How to use this image. | ||
|
||
Run the default OpenAS2 server: | ||
|
||
```console | ||
$ docker run -it --rm openas2:latest | ||
``` | ||
|
||
You can test it by visiting `http://container-ip:10080` in a browser or, if you need access outside the host, on port 4080: | ||
|
||
```console | ||
$ docker run -it --rm -p 10080:4080 -p 10081:4081 openas2:latest | ||
``` | ||
|
||
You can then go to `http://localhost:4080` or `http://host-ip:4080` in a browser (noting that it will return a 401 since there are no proper AS2 headers sent by the browser by default). | ||
|
||
The default OpenAS2 environment in the image is: | ||
|
||
OPENAS2_BASE: /usr/local/tomcat | ||
OPENAS2_HOME: /usr/local/tomcat | ||
OPENAS2_TMPDIR: /usr/local/tomcat/temp | ||
JAVA_HOME: /usr/local/openjdk-11 | ||
|
||
The configuration files are available in `/opt/openas2/config/`. | ||
![logo](https://raw.githubusercontent.com/igwtech/OpenAs2App/master/docs/as2_logo.png) | ||
|
||
# As2Server | ||
The OpenAS2 application enables you to transmit and receive AS2 messages with EDI-X12, EDIFACT, XML, or binary payloads between trading partners. | ||
|
||
|
||
## Development | ||
There is a pom.xml in the Server folder to compile and create the jar and build the distribution package using Maven. | ||
The current version of the application is extracted from the POM and inserted into the MANIFEST.MF at build time. | ||
More detailed information is available in the DeveloperGuide.odt in the docs folder in Github. | ||
|
||
## Test, Build and Package | ||
The following commands can be used in the build process. | ||
|
||
Checking dependency tree: | ||
`./mvnw dependency:tree` | ||
|
||
Checking dependencies against latest: | ||
`./mvnw versions:display-dependency-updates` | ||
|
||
Updating dependencies to latest: | ||
`./mvnw versions:use-latest-releases` | ||
|
||
Build a snapshot the following command should be used: | ||
`./mvnw versions:set -DnewVersion=2.12.0-SNAPSHOT` | ||
|
||
Run unit tests: | ||
`./mvnw test` | ||
|
||
Build a package | ||
`./mvnw clean package` | ||
|
||
|
||
## Deploy to Maven Central | ||
To deploy the released artifacts requires user ID and password for Sonatype. See developer guide for details: | ||
`./mvnw clean deploy -P release` - will require manual closing and release in Sonatype | ||
`./mvnw release:perform` | ||
`./mvnw nexus-staging:release -Ddescription="Some release comment here"` | ||
|
||
## How to create docker image | ||
|
||
To create docker image ,use the Dockerfile in the project. | ||
In terminal, open the folder where Dockerfile is located. | ||
Use below command to login to your dockerhub account through terminal. | ||
|
||
```console | ||
$ docker login | ||
``` | ||
|
||
Run below command to create image with name and tag. | ||
|
||
```console | ||
$ docker build -t openas2:latest . | ||
``` | ||
|
||
## How to use this image. | ||
|
||
Run the default OpenAS2 server: | ||
|
||
```console | ||
$ docker run -it --rm openas2:latest | ||
``` | ||
|
||
You can test it by visiting `http://container-ip:10080` in a browser or, if you need access outside the host, on port 4080: | ||
|
||
```console | ||
$ docker run -it --rm -p 10080:4080 -p 10081:4081 openas2:latest | ||
``` | ||
|
||
You can then go to `http://localhost:4080` or `http://host-ip:4080` in a browser (noting that it will return a 401 since there are no proper AS2 headers sent by the browser by default). | ||
|
||
The default OpenAS2 environment in the image is: | ||
|
||
OPENAS2_BASE: /usr/local/tomcat | ||
OPENAS2_HOME: /usr/local/tomcat | ||
OPENAS2_TMPDIR: /usr/local/tomcat/temp | ||
JAVA_HOME: /usr/local/openjdk-11 | ||
|
||
The configuration files are available in `/opt/openas2/config/`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
@echo off | ||
|
||
if "%~4"=="" goto :Usage | ||
set srcStore=%1% | ||
set srcAlias=%2% | ||
set tgtStore=%3% | ||
set tgtAlias=%4% | ||
set action=%5% | ||
if "%action%" == "" set action=insert | ||
rem Setup the Java Virtual Machine | ||
call "%OPENAS2_BASE_DIR%\bin\find_java.bat" | ||
if %ERRORLEVEL% NEQ 0 exit /B 1 | ||
|
||
echo Generate a certificate to a PKCS12 key store. | ||
echo Generating certificate: using alias %certAlias% to %tgtStore%" | ||
|
||
echo Executing action "%action%" on certificate from key "%srcStore%" using alias "%tgtAlias%" to: %tgtStore%" | ||
setlocal | ||
SET /P AREYOUSURE=Do you wish to execute this request (Y/[N])? | ||
IF /I "%AREYOUSURE%" NEQ "Y" EXIT /B 0 | ||
endlocal | ||
|
||
set /p srcksPwd=Enter password for source keystore:%=% | ||
set /p tgtksPwd=Enter password for destination keystore:%=% | ||
|
||
if "%action%" == "replace" ( | ||
"%JAVA_HOME%\bin\keytool" -delete -alias %tgtAlias% -keystore %tgtStore% -storepass %tgtksPwd% -storetype pkcs12 | ||
if errorlevel 1 ( | ||
echo The REPLACE option was specified. | ||
echo Failed to delete the certificate in the keystore for alias "%tgtAlias%". See errors above to correct the problem. | ||
EXIT /B 1 | ||
) | ||
) | ||
echo "%JAVA_HOME%\bin\keytool" -importkeystore -srckeystore %srcStore% -srcstoretype pkcs12 -srcstorepass "%srcksPwd%" -srcalias %srcAlias% -destalias %tgtAlias% -destkeystore %tgtStore% -deststorepass "%tgtksPwd%" -deststoretype pkcs12 | ||
"%JAVA_HOME%\bin\keytool" -importkeystore -srckeystore %srcStore% -srcstoretype pkcs12 -srcstorepass "%srcksPwd%" -srcalias %srcAlias% -destalias %tgtAlias% -destkeystore %tgtStore% -deststorepass "%tgtksPwd%" -deststoretype pkcs12 | ||
if errorlevel 1 ( | ||
echo ***** Failed to import the certificate to the keystore. See errors above to correct the problem. | ||
echo If the error shows the certificate already exists then add the "replace" option to the command line. | ||
EXIT /B 1 | ||
) | ||
echo Successfully Imported certificate from file "%srcStore%" using alias "%tgtAlias%" to: %tgtSttore% | ||
|
||
goto :END | ||
|
||
:Usage | ||
echo Import an entry in a source PKCS12 keystore identified by an alias to a target PKCS12 key store. | ||
echo You must specify the source keystore, source alias entry, target key store file name and an alias for imported certificate. | ||
echo By default the script will attempt to import the designated entries in the specified alias. | ||
echo If you wish to replace an existing entry in the target keystore then specify "replace" as a 4th argument to the script | ||
echo usage: import_alias_from_keystore.bat ^<src keystore^> ^<src alias^> ^<target keystore^> ^<target alias^> [action]s | ||
echo WHERE | ||
echo src keystore = name of the keystore containing the entry to be imported | ||
echo src alias = name of the alias in the source keystore to be imported | ||
echo target keystore = name of the target keystore file including .p12 extension | ||
echo target alias = alias name used to store the imported entry in the keystore | ||
echo action = if not provided this defaults to "import". The only other option is "replace" | ||
echo anything other than "replace" will be interpreted as "import" | ||
|
||
echo | ||
echo eg. import_alias_from_keystore.bat my_cert2.p12 my_cert as2_certs.p12 my_cert_2 | ||
echo OR | ||
echo eg. import_alias_from_keystore.bat my_cert2.p12 my_cert as2_certs.p12 my_cert_2 replace | ||
|
||
:warn | ||
|
||
:END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.