Bug 1478210 - Review Request: openas2 - Java implementation of EDIINT AS2
Summary: Review Request: openas2 - Java implementation of EDIINT AS2
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Robert-André Mauchin 🐧
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-08-04 00:52 UTC by Stuart D Gathman
Modified: 2018-10-09 03:08 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-07 20:58:55 UTC
Type: ---
Embargoed:
zebob.m: fedora-review+


Attachments (Terms of Use)

Description Stuart D Gathman 2017-08-04 00:52:56 UTC
Spec URL: https://gathman.org/linux/SPECS/openas2.spec
SRPM URL: https://gathman.org/linux/f25/src/openas2-2.3.0-4.fc25.src.rpm
Description: Java-based implementation of the EDIINT AS2 standard.
Fedora Account System Username: sdgathman

Comment 1 Stuart D Gathman 2017-08-04 01:02:58 UTC
The unit tests do not run in mock (something to do with java System properties working differently in mock).  I have disabled them.  I could add a build option to run the unit tests when using rpmbuild.  Or maybe compile the tests as a subpackage, which can then be run after installing.  The unit test do use localhost - which I assume is available in mock.  I can run the unit tests in a VM with no networking (just the lo interface).

There will be an additional openas2-remote subpackage, which isn't done yet (was trying to get unit tests working in mock).  I might add an openas2-src subpackage to include a copy of the source in the server dir and a classes directory - to facilitate local customizations (not sure how that works when the package is upgraded, however).

The openas2 base package has the jars and maven poms.  The openas2-server subpackage has a mostly configured server.  (Note to self: try symlinking /var/lib/openas2/config to /etc/openas2)  The openas2-javadoc subpackage has the javadocs.

Comment 2 Stuart D Gathman 2017-08-04 01:23:04 UTC
I would like to be able to build from source for EPEL-7.  But these Fedora java packages are missing in el7:

DEBUG util.py:450:  No matching package to install: 'glassfish-servlet-api'
DEBUG util.py:450:  No matching package to install: 'findbugs'
DEBUG util.py:450:  No matching package to install: 'hsqldb-lib'
DEBUG util.py:450:  No matching package to install: 'bouncycastle-mail'
DEBUG util.py:450:  No matching package to install: 'bouncycastle-pg'

For my purposes, I can comment out xmvn_subst and build on Fedora (so that the jars are included in the server lib dir).  Maybe there should be a build option for that.  Will these eventually make it to EL7?

Comment 3 Mat Booth 2017-08-08 23:07:13 UTC
> For my purposes, I can comment out xmvn_subst and build on Fedora (so that
> the jars are included in the server lib dir).  Maybe there should be a build
> option for that.

To perform different actions on RHEL, you can make use of the conditional macro like this:

%if 0%{?fedora}
# Do Fedora only stuff
%endif

%if 0%{?rhel}
# Do RHEL only stuff
%endif

This way you can have a single spec file that builds for all platforms without changes. It's pretty nasty to bundle bouncycastle though -- it's not unprecedented to have to fix security problems in that package and if you are bundling it, you will not receive any security patches that we might apply.

> Will these eventually make it to EL7?

Only if someone volunteers to maintain the el7 branch. :-)

Comment 4 Stuart D Gathman 2017-08-08 23:51:19 UTC
The conditional macro doesn't help, because it won't build on EL7 (because of the missing jars).  I am building on Fedora 25, hence the bundled bouncycastle is from Fedora 25 - with all the security patches Fedora sees fit to apply.  Because the jars are bundled (copied from /usr/share/java by xmvn), the resulting rpm installs and runs on el7 - even though it is labeled fc25.

Comment 5 Stuart D Gathman 2017-08-08 23:59:54 UTC
Spec URL: https://gathman.org/linux/SPECS/openas2.spec
SRPM URL: https://gathman.org/linux/f25/src/openas2-2.3.0-6.fc25.src.rpm

Moved logs to /var/log/openas2.  Move config files to /etc/openas2.  (Both with symlinks to keep default config working.)  Added global bundle option.

Comment 6 Stuart D Gathman 2017-08-09 00:19:53 UTC
Need to make configs readable by openas2, but not by the world (keys and passwords).  I don't see any other packages doing that with configs in /etc.  Maybe I should move configs back to /var/lib/openas2?

Comment 7 Stuart D Gathman 2017-08-09 02:45:10 UTC
jabberd seems to be a good package to emulate.

Comment 8 Mat Booth 2017-08-09 08:47:56 UTC
(In reply to Stuart D Gathman from comment #4)
> The conditional macro doesn't help, because it won't build on EL7 (because
> of the missing jars).  I am building on Fedora 25, hence the bundled
> bouncycastle is from Fedora 25 - with all the security patches Fedora sees
> fit to apply.

But missing any patches applied after your build... :-/

> Because the jars are bundled (copied from /usr/share/java by
> xmvn), the resulting rpm installs and runs on el7 - even though it is
> labeled fc25.

For such EL7 builds you could use a COPR repo, which is not subject to the packaging guidelines as strictly: https://copr.fedorainfracloud.org/

Comment 9 Stuart D Gathman 2017-08-16 04:00:41 UTC
Spec URL: https://gathman.org/linux/SPECS/openas2.spec
SRPM URL: https://gathman.org/linux/f25/src/openas2-2.3.1-1.fc25.src.rpm

Updated to new upstream release.  Moved data (spool files) to /var/spool/openas2 - again with a symlink so upstream config still works.  Fix some rpmlint issues.

Comment 10 Stuart D Gathman 2018-09-13 23:30:21 UTC
Spec URL: https://gathman.org/linux/SPECS/openas2.spec
SRPM URL: https://gathman.org/linux/f27-testing/src/openas2-2.6.1-1.fc27.src.rpm

Updated to new upstream release.

Comment 11 Stuart D Gathman 2018-09-14 02:31:38 UTC
Spec URL: https://gathman.org/linux/SPECS/openas2.spec
SRPM URL: https://gathman.org/linux/f27/src/openas2-2.6.1-2.fc27.src.rpm

- Fix some rpmlint issues
- Make hsqldb optional, since h2 is now sufficiently supported in Fedora

Comment 12 Robert-André Mauchin 🐧 2018-09-16 21:09:59 UTC
 - Make use of bcond_with/%bcond_without for conditionals

 - Group: us not used in Fedora

 - Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd

→ Use %{?systemd_requires}

 - Not useful in the description:

Version 2.3.1 was released on 6th Aug 2017.

 - Build fails:

[INFO] Executed tasks
[INFO] 
[INFO] --------------------< net.sf.openas2:openas2-osgi >---------------------
[INFO] Building OpenAS2 OSGi Bundle 2.6.1                                 [4/4]
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for org.osgi:org.osgi.core:jar:4.3.1 is missing, no dependency information available
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Skipping OpenAS2
[INFO] This project has been banned from the build due to previous failures.
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] OpenAS2 2.6.1 ...................................... SUCCESS [  0.004 s]
[INFO] OpenAS2 Server ..................................... SUCCESS [  4.686 s]
[INFO] OpenAS2 Remote ..................................... SUCCESS [  0.162 s]
[INFO] OpenAS2 OSGi Bundle 2.6.1 .......................... FAILURE [  0.009 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.278 s
[INFO] Finished at: 2018-09-16T22:47:09+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project openas2-osgi: Could not resolve dependencies for project net.sf.openas2:openas2-osgi:jar:2.6.1: Cannot access central (https://repo.maven.apache.org/maven2) in offline mode and the artifact org.osgi:org.osgi.core:jar:4.3.1 has not been downloaded from it before. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :openas2-osgi

 → Need to add:

BuildRequires:  mvn(org.osgi:org.osgi.core)

 - openas2-server.noarch: E: dir-or-file-in-var-run /var/run/openas2

It is verboten to install hiles in /var/run

 - %attr(0750,root,openas2) %dir %{_sysconfdir}/%{name}
%attr(0640,root,openas2) %config(noreplace) %{_sysconfdir}/%{name}/*

openas2-server.noarch: E: non-standard-dir-perm /etc/openas2 750
openas2-server.noarch: W: non-standard-gid /etc/openas2/as2_certs.p12 openas2
openas2-server.noarch: E: non-readable /etc/openas2/as2_certs.p12 640
openas2-server.noarch: W: non-standard-gid /etc/openas2/commands.xml openas2
openas2-server.noarch: E: non-readable /etc/openas2/commands.xml 640
openas2-server.noarch: W: non-standard-gid /etc/openas2/config.xml openas2
openas2-server.noarch: E: non-readable /etc/openas2/config.xml 640
openas2-server.noarch: W: non-standard-gid /etc/openas2/db_ddl.sql openas2
openas2-server.noarch: E: non-readable /etc/openas2/db_ddl.sql 640
openas2-server.noarch: W: non-standard-gid /etc/openas2/emailtemplate.txt openas2
openas2-server.noarch: E: non-readable /etc/openas2/emailtemplate.txt 640
openas2-server.noarch: W: non-standard-gid /etc/openas2/partnerships.xml openas2
openas2-server.noarch: E: non-readable /etc/openas2/partnerships.xml 640
openas2-server.noarch: W: non-standard-gid /etc/openas2/ssl_certs.jks openas2
openas2-server.noarch: E: non-readable /etc/openas2/ssl_certs.jks 640

Perms should be 0644/0755

 - openas2-server.noarch: W: log-files-without-logrotate ['/var/log/openas2']

Install a logrotate file. See https://fedoraproject.org/wiki/Packaging:Guidelines#Logrotate_config_file

 - Add  aversion for theses provides:

openas2.src:97: W: unversioned-explicit-provides mvn(org.hsqldb:hsqldb)
openas2.src:99: W: unversioned-explicit-provides mvn(com.h2database:h2)
openas2.src:101: W: unversioned-explicit-provides mvn(org.bouncycastle:bcpg-jdk15on)
openas2.src:102: W: unversioned-explicit-provides mvn(org.bouncycastle:bcmail-jdk15on)

 - See if you can do something about this:

openas2.noarch: W: class-path-in-manifest /usr/share/java/openas2/openas2-osgi.jar
openas2.noarch: W: class-path-in-manifest /usr/share/java/openas2/openas2-remote.jar
openas2.noarch: W: class-path-in-manifest /usr/share/java/openas2/openas2-server.jar

class-path-in-manifest:
The META-INF/MANIFEST.MF file in the jar contains a hardcoded Class-Path.
These entries do not work with older Java versions and even if they do work,
they are inflexible and usually cause nasty surprises.

Comment 13 Stuart D Gathman 2018-09-19 04:44:19 UTC
Spec URL: https://gathman.org/linux/SPECS/openas2.spec
SRPM URL: https://gathman.org/linux/f27/src/openas2-2.6.1-3.fc27.src.rpm

It builds for me in mock for f27, so I don't know what is up with osgi for you.  What Fedora release?  It is only used when trying to run tests in mock - which don't work for other reasons.  I've been working on suggestions from #fedora-java, so maybe something got out of sync and I published a src.rpm with tests enabled.

Verboten or not, the /var/run/openas2 directory is required on el6 for PID.  I have removed it since I don't plan to support el6.  (No PID file required with systemd.)

Perms in /etc/openas2 must NOT be 644 because the config files contain passwords and keys.

I removed the Provides, because they are not truly provided - just copies of the jars from Fedora when using the bundled option.

I'm leaving the class-path-in-manifest for another pass, because I don't understand maven enough at present to know how to fix it.  I think I probably need to edit META-INF/MANIFEST.MF.  What is the classpath in jar used for?  

Logging also happens to journald - and the openas2 server rotates it's own logs, but doesn't remove older ones.

Comment 14 Robert-André Mauchin 🐧 2018-09-19 13:02:27 UTC
> What Fedora release?

All reviews are made with Rawhide. Do your own mockbuild:

fedpkg --release f30 mockbuild --mock-config fedora-rawhide-x86_64 --no-cleanup-after


I still have the same error:

[WARNING] The POM for org.osgi:org.osgi.core:jar:4.3.1 is missing, no dependency information available

Comment 15 Stuart D Gathman 2018-09-19 18:28:00 UTC
Spec URL: https://gathman.org/linux/SPECS/openas2.spec
SRPM URL: https://gathman.org/linux/f27/src/openas2-2.6.1-4.fc30.src.rpm

Built for rawhide.

Comment 16 Stuart D Gathman 2018-09-19 18:56:43 UTC
Built for el7 (using --with=bundled) and testing that it still seems to work with real EDI partners.

Comment 17 Robert-André Mauchin 🐧 2018-09-19 19:23:20 UTC
Package approved.

Comment 18 Stuart D Gathman 2018-09-19 21:37:43 UTC
As I understand it, I will not be able to create an official EL7 package due to the bundling requirement.  Or is there a procedure for doing so?  For my own use, I build with:

  rpmbuild -ba --with=bundled -Ddist'.el7' openas2.spec 

from an f28 system (e.g. in mock --shell after a mockbuild). 

In any case, I will go ahead and request the Fedora package.

Comment 19 Gwyn Ciesla 2018-09-20 13:31:35 UTC
(fedscm-admin):  The Pagure repository was created at https://src.fedoraproject.org/rpms/openas2

Comment 20 Fedora Update System 2018-09-20 15:57:09 UTC
openas2-2.6.1-4.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-9f4dc70c94

Comment 21 Fedora Update System 2018-09-20 15:57:15 UTC
openas2-2.6.1-4.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-e7055e367d

Comment 22 Fedora Update System 2018-09-20 15:57:21 UTC
openas2-2.6.1-4.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-c1754a58aa

Comment 23 Fedora Update System 2018-09-21 07:59:24 UTC
openas2-2.6.1-4.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-9f4dc70c94

Comment 24 Fedora Update System 2018-09-21 08:33:36 UTC
openas2-2.6.1-4.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-e7055e367d

Comment 25 Fedora Update System 2018-09-21 08:47:32 UTC
openas2-2.6.1-4.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-c1754a58aa

Comment 26 Stuart D Gathman 2018-09-21 21:04:51 UTC
In field testing, fixed name of logrotate config, and initial h2 database is missing.  There will need to be a release 5 to fix at least those problems.

Comment 27 Stuart D Gathman 2018-09-22 00:44:39 UTC
There should be a way to copy the starter database to /var/lib/openas2/db at startup, *only* if it doesn't already exist - maybe in ExecStartPre.  Alternatively, I could patch the code to server.runScript('db_ddl.sql') when the table is missing - that would work with any database configured (but would it be safe?  I'd hate to DROP a production table it mistakenly thought was missing).  Or have a Readme_Fedora.md that talks about doing so manually.

Comment 28 Fedora Update System 2018-09-25 00:58:14 UTC
openas2-2.6.1-6.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-9f4dc70c94

Comment 29 Fedora Update System 2018-09-25 00:59:05 UTC
openas2-2.6.1-6.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-c1754a58aa

Comment 30 Fedora Update System 2018-09-25 00:59:47 UTC
openas2-2.6.1-6.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-e7055e367d

Comment 31 Fedora Update System 2018-09-27 02:08:00 UTC
openas2-2.6.1-7.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-9f4dc70c94

Comment 32 Fedora Update System 2018-09-27 03:37:33 UTC
openas2-2.6.1-7.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-e7055e367d

Comment 33 Fedora Update System 2018-09-27 04:46:20 UTC
openas2-2.6.1-7.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-c1754a58aa

Comment 34 Fedora Update System 2018-09-28 23:13:23 UTC
openas2-2.6.2-2.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-c8320b564e

Comment 35 Fedora Update System 2018-09-28 23:15:33 UTC
openas2-2.6.2-2.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-2807a71a57

Comment 36 Fedora Update System 2018-09-28 23:16:22 UTC
openas2-2.6.2-2.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-cce9180096

Comment 37 Fedora Update System 2018-09-30 00:24:38 UTC
openas2-2.6.2-2.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-c8320b564e

Comment 38 Fedora Update System 2018-09-30 00:47:29 UTC
openas2-2.6.2-2.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-cce9180096

Comment 39 Fedora Update System 2018-09-30 03:03:12 UTC
openas2-2.6.2-2.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-2807a71a57

Comment 40 Fedora Update System 2018-10-07 20:58:55 UTC
openas2-2.6.2-2.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.

Comment 41 Fedora Update System 2018-10-09 03:01:12 UTC
openas2-2.6.2-2.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 42 Fedora Update System 2018-10-09 03:08:05 UTC
openas2-2.6.2-2.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.