OpenSRF.git
4 years agoLP#1704116: fix intermittant failure of parallel building rel_2_4
Graham Billiau [Thu, 13 Jul 2017 15:29:43 +0000 (11:29 -0400)]
LP#1704116: fix intermittant failure of parallel building

Running make to do a parallel build (e.g., 'make -j 4' or
the like) could fail because of an undeclared dependency; this
patch fixes the issue.

The issue can be reproduced by repeating "make clean; make -j 4"
until the build fails.

Signed-off-by: Graham Billiau <graham@geeksinthegong.net>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
5 years agoupdate version number for 2.4.2 osrf_rel_2_4_2
Galen Charlton [Thu, 16 Feb 2017 20:34:49 +0000 (15:34 -0500)]
update version number for 2.4.2

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
5 years agoupdate changelog for OpenSRF 2.4.2
Galen Charlton [Thu, 16 Feb 2017 20:33:00 +0000 (15:33 -0500)]
update changelog for OpenSRF 2.4.2

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
5 years agoadd release notes for OpenSRF 2.4.2
Galen Charlton [Thu, 16 Feb 2017 20:32:13 +0000 (15:32 -0500)]
add release notes for OpenSRF 2.4.2

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
5 years agoLP#1652382: more improvements to cache key munging
Galen Charlton [Wed, 15 Feb 2017 21:58:06 +0000 (16:58 -0500)]
LP#1652382: more improvements to cache key munging

- teach osrfCacheRemove to clean keys
- fix implict declaration compilation warning
- account for fact that iscntrl('\0') returns true

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
5 years agoLP#1652382: handle cases where supplied key is longer than 250 bytes
Galen Charlton [Wed, 15 Feb 2017 19:12:34 +0000 (14:12 -0500)]
LP#1652382: handle cases where supplied key is longer than 250 bytes

With this patch, if cache clients want to use a key longer
than the memcached text protocol limit of 250 bytes, the
key is normalized to 'shortened_' + md5_hex(normalized_key).

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
5 years agoLP#1652382: Make use of the clean key just created
Mike Rylander [Mon, 30 Jan 2017 17:54:10 +0000 (12:54 -0500)]
LP#1652382: Make use of the clean key just created

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
5 years agoLP#1652382: normalization of memcache keys in C code
Mike Rylander [Fri, 27 Jan 2017 20:25:05 +0000 (15:25 -0500)]
LP#1652382: normalization of memcache keys in C code

Memcache does not allow spaces in keys, so here we will actively strip them
from any key we get from a caller.  Some callers are not very proactive about
sending clean keys, and this patch prevents issues that can poison C-based
OpenSRF service backends.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
5 years agoLP#1652122: fix infinite recursion in opensrf.system.method.all
Galen Charlton [Thu, 22 Dec 2016 10:53:12 +0000 (15:53 +0500)]
LP#1652122: fix infinite recursion in opensrf.system.method.all

Under certain circumstances, calling opensrf.system.method.all on a
Perl service can result in an infinite recursion when attempting to
serialize an OpenSRF::Application object to JSON.  In particular,
this was observed to happen when doing an introspection of
the opensrf.settings service.

This patch avoids the infinite recursion (and consequent memory
leak) by ensuring that the 'session' key is slated for exclusion
from serialization from OpenSRF::Application objects during
bootstrapping.

Note that the problem does not affect all Perl services; if a
Perl service declares at least one streaming method, the auto-registration
of the .atomic method will result in 'session'-stripping.

This patch fixes a regression introduced in bug 1350457.

To test
-------
[1] Run 'introspect opensrf.settings' via srfsh; observe
    that it never returns and that the opensrf.settings drone
    will grow in memory sized until killed.
[2] Apply the patch, then repeat step 1. This time, the
    request should succeed.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
6 years agoLP#1559121: remove Debian Squeeze support
Galen Charlton [Fri, 18 Mar 2016 14:59:11 +0000 (10:59 -0400)]
LP#1559121: remove Debian Squeeze support

Now that Debian Squeeze's LTS (long-term support) period
has ended, Evergreen no longer offers community support
for that distribution. This patch removes references
to Squeeze from the installation scripts and documentation.

To test:

[1] Verify that Debian Squeeze is no longer referenced in
    the installation documentation.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
6 years agoLP#1350457: add test case for perl2JSONObject change
Galen Charlton [Thu, 4 Feb 2016 18:09:48 +0000 (13:09 -0500)]
LP#1350457: add test case for perl2JSONObject change

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
6 years agoLP#1350457: Pass caller's session to subrequests called via method_lookup
Mike Rylander [Wed, 30 Jul 2014 17:29:46 +0000 (13:29 -0400)]
LP#1350457: Pass caller's session to subrequests called via method_lookup

In the process of looking up a method for an internal subrequest, we lose
session info. This is a problem when the subrequest makes a remote request,
because then the subrequest can't look up the proper locale, among other
things. The forthcoming branch passes the caller's session to the subrequest.

This patch also teaches OpenSRF object registration how to strip certain
object members -- in particular, the session -- so that introspection
continues to work.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
6 years agoLP#1474507: fix interval_to_seconds for weeks and seconds
Jason Etheridge [Tue, 14 Jul 2015 18:54:27 +0000 (14:54 -0400)]
LP#1474507: fix interval_to_seconds for weeks and seconds

This patch fixes an issue where OpenSRF::Utils::interval_to_seconds()
was not recognizing intervals expressed as seconds or weeks.

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
6 years agoLP#1474507: tests for interval_to_seconds
Jason Etheridge [Tue, 14 Jul 2015 19:10:15 +0000 (15:10 -0400)]
LP#1474507: tests for interval_to_seconds

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
6 years agoLP#1494486: Limit damage caused by dropped drone XMPP sockets
Mike Rylander [Thu, 10 Sep 2015 20:56:13 +0000 (16:56 -0400)]
LP#1494486: Limit damage caused by dropped drone XMPP sockets

It is apparently possible for drones to get into a state where their XMPP
socket is closed but they don't notice. This is bad because the drone can
continue to receive requests from its listener but can no longer respond
to them. To limit the pain this can cause, we should kill the drone as soon
as we notice this condition.

To avoid overhead, this commit notices when the socket returns an error (or
raises a signal, in Perl) upon write, and exits immediately.  One message
will be lost, but the drone will no longer be a black hole that does nothing
but absorb requests it can never fill.

To test
-------
[1] Start an OpenSRF stack and look for a drone process.
[2] Use lsof to identify which socket that drone is using
    to talk to XMPP.
[3] Use gdb to attach to the process and close the socket, e.g.,

    $ gdb -p $PID
    (gdb) p close(11) # or whatever the socket number was
    (gdb) c

[4] Use srfsh to make requests of that service. Eventually, one
    of them will hit the drone.
[5] Sans patch, the request will get handled by the drone, but
    the results will never get sent, and the drone will remain
    available to handle other requests.
[6] With the patch, the drone will exit when it discovers that it
    can no longer write to the XMPP socket.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
6 years agobump up version number in one more place osrf_rel_2_4_1
Galen Charlton [Wed, 24 Jun 2015 17:13:55 +0000 (17:13 +0000)]
bump up version number in one more place

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
6 years agoupdate release notes for 2.4.1
Galen Charlton [Wed, 24 Jun 2015 16:59:53 +0000 (16:59 +0000)]
update release notes for 2.4.1

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
6 years agoupdate ChangeLog for 2.4.1
Galen Charlton [Wed, 24 Jun 2015 16:23:31 +0000 (16:23 +0000)]
update ChangeLog for 2.4.1

Note that did a bit of hackery involving a
temporary branch rebased against osrf_rel_2_4_0
to come up with a cleaner result.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
6 years agoset stage for point release notes, à la Evergreen
Galen Charlton [Wed, 24 Jun 2015 16:07:58 +0000 (16:07 +0000)]
set stage for point release notes, à la Evergreen

Also fix a couple typos.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
6 years agoincrement version number for 2.4.1 release
Galen Charlton [Wed, 24 Jun 2015 16:01:26 +0000 (16:01 +0000)]
increment version number for 2.4.1 release

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
6 years agoLP#1152272: do not log batch invocation of srfsh in .srfsh_history
Galen Charlton [Wed, 3 Jun 2015 18:35:35 +0000 (18:35 +0000)]
LP#1152272: do not log batch invocation of srfsh in .srfsh_history

When running srfsh to process a script, do not log
the requests in .srfsh_history.

To test
-------
[1] Run the following command:

    echo 'request opensrf.math opensrf.system.echo "foo"' | srfsh

[2] Note that the last line of ~/.srfsh_history should be
    'request opensrf.math opensrf.system.echo "foo"'

[3] Apply the patch, compile, and run

    echo 'request opensrf.math opensrf.system.echo "bar"' | srfsh

[4] This time, no additional line should have been added to
    ~/.srfsh_history

[5] Another variation to try:

    srfsh test.srfsh

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
6 years agoLP#1461625: ensure srfsh doesn't close STDOUT prematurely
Galen Charlton [Wed, 3 Jun 2015 17:42:06 +0000 (17:42 +0000)]
LP#1461625: ensure srfsh doesn't close STDOUT prematurely

Ensure that when running srfsh in non-interactive mode
that reads commands directly from a file, (i.e.,
"srfsh script.srfsh" or as a shebang script), it does
not close STDOUT after handling the first request.

To test
-------
[1] Create a srfsh script containing:

    request opensrf.math opensrf.system.echo "foo"
    request opensrf.math opensrf.system.echo "bar"

[2] Run "srfsh script.srfsh". Note that only the
    results of the first echo request are output.
[3] Apply the patch and recompile, then run
    "srfsh script.srfsh" again.  This time, the
    output of both requests is displayed.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
6 years agoLP#1409055 Support specific protocols for OpenSRF gateway requests
Dan Scott [Thu, 18 Jun 2015 15:52:00 +0000 (11:52 -0400)]
LP#1409055 Support specific protocols for OpenSRF gateway requests

If the user passes in a gateway hostname that contains a specific HTTP or HTTPS
protocol, let's just use that.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
6 years agoRevert "Merge remote-tracking branch 'working/user/berick/lp1409055-python-https...
Dan Scott [Fri, 19 Jun 2015 18:55:48 +0000 (14:55 -0400)]
Revert "Merge remote-tracking branch 'working/user/berick/lp1409055-python-https-via-dbs' into https_is_good_24"

This reverts commit 530220a8524bed925dacf63a92c6d8a7e4ca7652, reversing
changes made to a8ea7468ed180c7c4cc2da3511a61949312ee5bf.

6 years agoMerge remote-tracking branch 'working/user/berick/lp1409055-python-https-via-dbs...
Dan Scott [Fri, 19 Jun 2015 18:34:53 +0000 (14:34 -0400)]
Merge remote-tracking branch 'working/user/berick/lp1409055-python-https-via-dbs' into https_is_good_24

6 years agoLP#1409055 Support specific protocols for OpenSRF gateway requests
Dan Scott [Thu, 18 Jun 2015 15:52:00 +0000 (11:52 -0400)]
LP#1409055 Support specific protocols for OpenSRF gateway requests

If the user passes in a gateway hostname that contains a specific HTTP or HTTPS
protocol, let's just use that.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
6 years agoLP#1436047: make srfsh --safe act as if "! command" doesn't exist
Galen Charlton [Tue, 24 Mar 2015 21:00:57 +0000 (21:00 +0000)]
LP#1436047: make srfsh --safe act as if "! command" doesn't exist

This patch make srfsh treat attempting to run an external
command via "! command" as a parsing error if --safe is
supplied.  It also suppress mention of "! commands" from
the internal help.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
6 years agoLP#1436047: Allow disabling of "bang commands" in srfsh
Mike Rylander [Tue, 24 Mar 2015 20:22:16 +0000 (16:22 -0400)]
LP#1436047: Allow disabling of "bang commands" in srfsh

srfsh has the ability to execute commands via system() calls using
the common "!command" syntax.  This is very useful, but it would
be nice to be able to turn that functionality off in some cases.

This branch adds argument parsing to detect a new '--safe' command
line parameter, which disables the "!command" syntax.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
6 years agoLP#1436047: make srfsh --safe act as if "! command" doesn't exist
Galen Charlton [Tue, 24 Mar 2015 21:00:57 +0000 (21:00 +0000)]
LP#1436047: make srfsh --safe act as if "! command" doesn't exist

This patch make srfsh treat attempting to run an external
command via "! command" as a parsing error if --safe is
supplied.  It also suppress mention of "! commands" from
the internal help.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
6 years agoLP#1436047: Allow disabling of "bang commands" in srfsh
Mike Rylander [Tue, 24 Mar 2015 20:22:16 +0000 (16:22 -0400)]
LP#1436047: Allow disabling of "bang commands" in srfsh

srfsh has the ability to execute commands via system() calls using
the common "!command" syntax.  This is very useful, but it would
be nice to be able to turn that functionality off in some cases.

This branch adds argument parsing to detect a new '--safe' command
line parameter, which disables the "!command" syntax.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agoDocs: Fix mailing list link for help in README
Ben Shum [Mon, 4 May 2015 21:16:29 +0000 (17:16 -0400)]
Docs: Fix mailing list link for help in README

Signed-off-by: Ben Shum <bshum@biblio.org>
7 years agoDocs: Fix mailing list link for help in README
Ben Shum [Mon, 4 May 2015 21:16:29 +0000 (17:16 -0400)]
Docs: Fix mailing list link for help in README

Signed-off-by: Ben Shum <bshum@biblio.org>
7 years agoLP#1445503 - Updated Ejabberd setup steps for Ejabberd 14.x for Debian Jessie
Josh Stompro [Tue, 21 Apr 2015 14:50:49 +0000 (09:50 -0500)]
LP#1445503 - Updated Ejabberd setup steps for Ejabberd 14.x for Debian Jessie

Signed-off-by: Josh Stompro <github@stompro.org>
Signed-off-by: Ben Shum <bshum@biblio.org>
7 years agoDocs: Emphasize variables and paths consistently in README
Ben Shum [Mon, 4 May 2015 21:01:23 +0000 (17:01 -0400)]
Docs: Emphasize variables and paths consistently in README

Some variables and paths were not emphasized when the instructions for
websockets was added. Maintain consistency in the document and emphasize
them.

Signed-off-by: Ben Shum <bshum@biblio.org>
7 years agoDocs: Add [source, bash] to code blocks that were not defined in README
Ben Shum [Mon, 4 May 2015 20:57:38 +0000 (16:57 -0400)]
Docs: Add [source, bash] to code blocks that were not defined in README

For consistency, add [source, bash] to all the blocks of code or script
commands in the README

Signed-off-by: Ben Shum <bshum@biblio.org>
7 years agoDocs: Keep all source syntax consistent in README
Ben Shum [Mon, 4 May 2015 20:49:08 +0000 (16:49 -0400)]
Docs: Keep all source syntax consistent in README

Change occurrences of [source,bash] to [source, bash] for consistency
throughout README.

Signed-off-by: Ben Shum <bshum@biblio.org>
7 years agoLP#1445503 - Updated Ejabberd setup steps for Ejabberd 14.x for Debian Jessie
Josh Stompro [Tue, 21 Apr 2015 14:50:49 +0000 (09:50 -0500)]
LP#1445503 - Updated Ejabberd setup steps for Ejabberd 14.x for Debian Jessie

Signed-off-by: Josh Stompro <github@stompro.org>
Signed-off-by: Ben Shum <bshum@biblio.org>
7 years agoDocs: Emphasize variables and paths consistently in README
Ben Shum [Mon, 4 May 2015 21:01:23 +0000 (17:01 -0400)]
Docs: Emphasize variables and paths consistently in README

Some variables and paths were not emphasized when the instructions for
websockets was added. Maintain consistency in the document and emphasize
them.

Signed-off-by: Ben Shum <bshum@biblio.org>
7 years agoDocs: Add [source, bash] to code blocks that were not defined in README
Ben Shum [Mon, 4 May 2015 20:57:38 +0000 (16:57 -0400)]
Docs: Add [source, bash] to code blocks that were not defined in README

For consistency, add [source, bash] to all the blocks of code or script
commands in the README

Signed-off-by: Ben Shum <bshum@biblio.org>
7 years agoDocs: Keep all source syntax consistent in README
Ben Shum [Mon, 4 May 2015 20:49:08 +0000 (16:49 -0400)]
Docs: Keep all source syntax consistent in README

Change occurrences of [source,bash] to [source, bash] for consistency
throughout README.

Signed-off-by: Ben Shum <bshum@biblio.org>
7 years agoLP#1418613 per-tab websocket send() JS thinko repair
Bill Erickson [Thu, 5 Feb 2015 15:34:40 +0000 (10:34 -0500)]
LP#1418613 per-tab websocket send() JS thinko repair

Avoid referencing variable defined somewhere outside the send_ws()
function.  Doing so happened to result in re-sending the same message
twice in some cases.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
7 years agoLP#1418613 per-tab websocket send() JS thinko repair
Bill Erickson [Thu, 5 Feb 2015 15:34:40 +0000 (10:34 -0500)]
LP#1418613 per-tab websocket send() JS thinko repair

Avoid referencing variable defined somewhere outside the send_ws()
function.  Doing so happened to result in re-sending the same message
twice in some cases.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
7 years agoUpdate Release Notes for OpenSRF 2.4.0 osrf_rel_2_4_0
Ben Shum [Tue, 6 Jan 2015 19:50:25 +0000 (14:50 -0500)]
Update Release Notes for OpenSRF 2.4.0

Signed-off-by: Ben Shum <bshum@biblio.org>
7 years agoUpdate ChangeLog for OpenSRF 2.4.0
Ben Shum [Tue, 6 Jan 2015 19:47:28 +0000 (14:47 -0500)]
Update ChangeLog for OpenSRF 2.4.0

Signed-off-by: Ben Shum <bshum@biblio.org>
7 years agoBump up version number for OpenSRF 2.4.0
Ben Shum [Tue, 6 Jan 2015 19:37:59 +0000 (14:37 -0500)]
Bump up version number for OpenSRF 2.4.0

Signed-off-by: Ben Shum <bshum@biblio.org>
7 years agoLP#1383828 Jessie/Trusty installer Apache "mpm" repairs
Bill Erickson [Fri, 17 Oct 2014 21:07:53 +0000 (17:07 -0400)]
LP#1383828 Jessie/Trusty installer Apache "mpm" repairs

Disable the default Apache mpm_event module and enable mpm_prefork for
Debian Jessie and Ubuntu Trusty.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
7 years agoLP#1383828 Jessie/Trusty installer Apache "mpm" repairs
Bill Erickson [Fri, 17 Oct 2014 21:07:53 +0000 (17:07 -0400)]
LP#1383828 Jessie/Trusty installer Apache "mpm" repairs

Disable the default Apache mpm_event module and enable mpm_prefork for
Debian Jessie and Ubuntu Trusty.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
7 years agoLP#1391248: Fix NameVirtualHost warnings in websockets apache2.conf
Ben Shum [Mon, 10 Nov 2014 17:20:31 +0000 (12:20 -0500)]
LP#1391248: Fix NameVirtualHost warnings in websockets apache2.conf

For the websockets configuration, the sample apache2.conf for Apache 2.4 (i.e.
Ubuntu 14.04, etc.) contains NameVirtualHost entries that are no longer
needed.

When starting apache2-websockets, you may see warnings like:

AH00548: NameVirtualHost has no effect and will be removed in the next
release /etc/apache2-websockets/apache2.conf:53

Remove the NameVirtualHost entries and these warnings go away.

Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
7 years agoLP#1391248: Fix NameVirtualHost warnings in websockets apache2.conf
Ben Shum [Mon, 10 Nov 2014 17:20:31 +0000 (12:20 -0500)]
LP#1391248: Fix NameVirtualHost warnings in websockets apache2.conf

For the websockets configuration, the sample apache2.conf for Apache 2.4 (i.e.
Ubuntu 14.04, etc.) contains NameVirtualHost entries that are no longer
needed.

When starting apache2-websockets, you may see warnings like:

AH00548: NameVirtualHost has no effect and will be removed in the next
release /etc/apache2-websockets/apache2.conf:53

Remove the NameVirtualHost entries and these warnings go away.

Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
7 years agoLP#1369169: Remove hardcoded paths for OpenSRF directory
Ben Shum [Sat, 1 Nov 2014 03:53:58 +0000 (23:53 -0400)]
LP#1369169: Remove hardcoded paths for OpenSRF directory

Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
7 years agoLP#1369169: Mention the requirement for valid SSL certificate
Ben Shum [Sat, 13 Sep 2014 22:23:46 +0000 (18:23 -0400)]
LP#1369169: Mention the requirement for valid SSL certificate

The apache2-websockets instance will not start without a valid SSL certificate
in /etc/apache2/ssl.  Include a mention of this in the README with the extra
stipulation that it is still possible to use a self-signed SSL certificate for
testing purposes, but this is not recommended for live installations.

Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
7 years agoLP#1369169: Add websockets section to the OpenSRF README
Ben Shum [Fri, 12 Sep 2014 21:58:11 +0000 (17:58 -0400)]
LP#1369169: Add websockets section to the OpenSRF README

Remove the separate README.websockets and move the contents into the primary
OpenSRF README document so that all steps are in one place.

Additional edits to the websockets instructions to detail differences made
between Ubuntu 14.04 Trusty and Debian / Ubuntu 12.04 Precise. More edits
may be necessary for Debian Jessie later?

Also, create a separate config file for Apache 2.4 that is copied into place
for Ubuntu Trusty and potentially other systems that will need it.

Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
7 years agoLP#1369169: Add Apache 2.4 specific configuration file for websockets
Ben Shum [Sat, 13 Sep 2014 22:04:54 +0000 (18:04 -0400)]
LP#1369169: Add Apache 2.4 specific configuration file for websockets

For Apache 2.4, there were some necessary modifications for running the
websockets code properly. Similar to how we do things in Evergreen, we
added a new directory for apache_24 which contains the modified apache2.conf
file.

Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
7 years agoLP#1369169: Remove trailing whitespace from apache2.conf
Ben Shum [Sat, 13 Sep 2014 22:07:47 +0000 (18:07 -0400)]
LP#1369169: Remove trailing whitespace from apache2.conf

For some reason, there was a lot of trailing whitespace in this apache2.conf
file for websockets. Removing them.

Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
7 years agoLP#1369169: Standardize styling of root linux account for README
Ben Shum [Sat, 13 Sep 2014 21:03:19 +0000 (17:03 -0400)]
LP#1369169: Standardize styling of root linux account for README

Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
7 years agoLP#1369169: Add generated README.html to the .gitignore file for OpenSRF
Ben Shum [Sat, 13 Sep 2014 21:38:54 +0000 (17:38 -0400)]
LP#1369169: Add generated README.html to the .gitignore file for OpenSRF

Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
7 years agoLP#1369169: Remove hardcoded paths for OpenSRF directory
Ben Shum [Sat, 1 Nov 2014 03:53:58 +0000 (23:53 -0400)]
LP#1369169: Remove hardcoded paths for OpenSRF directory

Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
7 years agoLP#1369169: Mention the requirement for valid SSL certificate
Ben Shum [Sat, 13 Sep 2014 22:23:46 +0000 (18:23 -0400)]
LP#1369169: Mention the requirement for valid SSL certificate

The apache2-websockets instance will not start without a valid SSL certificate
in /etc/apache2/ssl.  Include a mention of this in the README with the extra
stipulation that it is still possible to use a self-signed SSL certificate for
testing purposes, but this is not recommended for live installations.

Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
7 years agoLP#1369169: Add websockets section to the OpenSRF README
Ben Shum [Fri, 12 Sep 2014 21:58:11 +0000 (17:58 -0400)]
LP#1369169: Add websockets section to the OpenSRF README

Remove the separate README.websockets and move the contents into the primary
OpenSRF README document so that all steps are in one place.

Additional edits to the websockets instructions to detail differences made
between Ubuntu 14.04 Trusty and Debian / Ubuntu 12.04 Precise. More edits
may be necessary for Debian Jessie later?

Also, create a separate config file for Apache 2.4 that is copied into place
for Ubuntu Trusty and potentially other systems that will need it.

Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
7 years agoLP#1369169: Add Apache 2.4 specific configuration file for websockets
Ben Shum [Sat, 13 Sep 2014 22:04:54 +0000 (18:04 -0400)]
LP#1369169: Add Apache 2.4 specific configuration file for websockets

For Apache 2.4, there were some necessary modifications for running the
websockets code properly. Similar to how we do things in Evergreen, we
added a new directory for apache_24 which contains the modified apache2.conf
file.

Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
7 years agoLP#1369169: Remove trailing whitespace from apache2.conf
Ben Shum [Sat, 13 Sep 2014 22:07:47 +0000 (18:07 -0400)]
LP#1369169: Remove trailing whitespace from apache2.conf

For some reason, there was a lot of trailing whitespace in this apache2.conf
file for websockets. Removing them.

Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
7 years agoLP#1369169: Standardize styling of root linux account for README
Ben Shum [Sat, 13 Sep 2014 21:03:19 +0000 (17:03 -0400)]
LP#1369169: Standardize styling of root linux account for README

Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
7 years agoLP#1369169: Add generated README.html to the .gitignore file for OpenSRF
Ben Shum [Sat, 13 Sep 2014 21:38:54 +0000 (17:38 -0400)]
LP#1369169: Add generated README.html to the .gitignore file for OpenSRF

Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
7 years agofix typo in release notes
Galen Charlton [Thu, 21 Aug 2014 23:52:10 +0000 (16:52 -0700)]
fix typo in release notes

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agobump up version number for OpenSRF 2.4.0-alpha osrf_rel_2_4_0-alpha
Galen Charlton [Thu, 21 Aug 2014 23:33:11 +0000 (16:33 -0700)]
bump up version number for OpenSRF 2.4.0-alpha

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agoupdate ChangeLog for OpenSRF 2.4.0-alpha
Galen Charlton [Thu, 21 Aug 2014 23:30:58 +0000 (16:30 -0700)]
update ChangeLog for OpenSRF 2.4.0-alpha

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agorelease notes for OpenSRF 2.4.0-alpha
Galen Charlton [Thu, 21 Aug 2014 23:30:05 +0000 (16:30 -0700)]
release notes for OpenSRF 2.4.0-alpha

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agoLP#1002028: set Access-Control-Expose-Headers
Galen Charlton [Thu, 21 Aug 2014 17:02:14 +0000 (10:02 -0700)]
LP#1002028: set Access-Control-Expose-Headers

This allows the OpenSRF JavaScript client library (or
to be precise, one that has been modified to direct
requests at a different domain) to take advantage of CORS
support.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agoLP#1002028: support CORS for HTTPS
Galen Charlton [Thu, 21 Aug 2014 16:13:23 +0000 (09:13 -0700)]
LP#1002028: support CORS for HTTPS

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agoLP#1002028: Cross Origin Resource Sharing for OpenSRF
Bennett Goble [Tue, 22 May 2012 15:57:56 +0000 (11:57 -0400)]
LP#1002028: Cross Origin Resource Sharing for OpenSRF

Background
----------
Browsers' same-origin policy currently restricts requests to the current
website's domain to prevent various nefarious scenarios. However,
because APIs and other web resources need to remain open to cross-site
use Cross Origin Resource Sharing (CORS) was created to allow services
to formally authorize cross-origin requests. CORS makes it simple to use
OpenSRF's HTTP translator and gateway APIs on websites using separate
domains.

Example Scenarios
-----------------
1) A library would like an AJAX-driven "quicksearch" box on their main
site, which is hosted on a different domain than their catalog.
2) A developer wants to create new web applications and services that
tie into Evergreen, but does not wish to install EG locally or
configure a proxy.

Implementation
--------------
The function crossOriginHeaders() has been added to apachetools.c.
Incoming requests are checked to see if they have an Origin header. The
value of the Origin header is checked against a whitelist defined in
opensrf_core.xml config (XPath: /config/gateway/cross_origin/origin).
The function returns 1 if CORS headers have been added to the response.

Notes
-----
* The OpenSRF Javascript client library (opensrf.js) defaults to the root
of the current web host "/osrf-http-translator." In addition, synchronous
requests are presumed in some situations: resulting in the oncomplete
method never returning (Blocking requests are not possible with cross-
domain XHR.)
* It is also possible to enable CORS with the Apache "set header"
configuration directive. However, this means that the necessary headers
would be appended to every response.

Links
-----
Specification - http://www.w3.org/TR/cors/
Wikipedia Article - http://en.wikipedia.org/wiki/Cross-origin_resource_sharing

Signed-off-by: Bennett Goble <nivardus@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agoRevert "LP#1350457: Pass caller's session to subrequests called via method_lookup"
Galen Charlton [Thu, 21 Aug 2014 15:58:18 +0000 (08:58 -0700)]
Revert "LP#1350457: Pass caller's session to subrequests called via method_lookup"

This reverts commit 96917538c6b6fad688dd40c2a8f0cc9127053b24.

7 years ago(doc) Reorder changes to ejabberd.cfg in install instructions
Josh Stompro [Wed, 21 May 2014 13:26:53 +0000 (08:26 -0500)]
(doc) Reorder changes to ejabberd.cfg in install instructions

I found it annoying that the list of changes to make to ejabberd.cfg
didn't follow the order that the options showed up in the default
Debian ejabberd.cfg.  I reordered them so after you finish changing one
option, you can search forward in the document for the next term.

(From Github pull request #3.)

Signed-off-by: Josh Stompro <Stomproj@larl.org>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agoLP#1350457: Pass caller's session to subrequests called via method_lookup
Mike Rylander [Wed, 30 Jul 2014 17:29:46 +0000 (13:29 -0400)]
LP#1350457: Pass caller's session to subrequests called via method_lookup

In the process of looking up a method for an internal subrequest, we lose
session info. This is a problem when the subrequest makes a remote request,
because then the subrequest can't look up the proper locale, among other
things. The forthcoming branch passes the caller's session to the subrequest.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agoLP#1341687 listeners log/drop XMPP error msgs
Bill Erickson [Thu, 17 Jul 2014 15:37:53 +0000 (11:37 -0400)]
LP#1341687 listeners log/drop XMPP error msgs

The most common form of XMPP error messages are "bounced" messages, i.e.
those where the recipient is not available.  Instead of passing these
useless and confusing messages down to a drone for processing, log the
error in the listener and drop the message.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agoLP#1343578: document <logtag> in the example opensrf_core.xml
Galen Charlton [Wed, 20 Aug 2014 21:00:17 +0000 (14:00 -0700)]
LP#1343578: document <logtag> in the example opensrf_core.xml

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agoLP#1343578: Perl/C syslog "logtag" additions.
Bill Erickson [Thu, 17 Jul 2014 19:10:35 +0000 (15:10 -0400)]
LP#1343578: Perl/C syslog "logtag" additions.

 * Honor logtag value when applying a default appname for Perl and C
 * Extract / apply logtag in the router
 * Minor repair: avoid redundant strdup

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agoLP#1343578: Add support for log tagging
Mike Rylander [Fri, 20 Jun 2014 19:52:47 +0000 (15:52 -0400)]
LP#1343578: Add support for log tagging

The ability to provide instance-specific log tagging via syslog
would make running multiple instances much easier to manage.  So
this branch does that.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agoLP#1316245: JS now uses browser-native JSON routines
Bill Erickson [Mon, 5 May 2014 17:40:46 +0000 (13:40 -0400)]
LP#1316245: JS now uses browser-native JSON routines

* Replace JSON2jsRaw() with JSON.parse()

* Replace js2JSONRaw() with JSON.stringify()

* Removed unit tests for JSON2jsRaw() and js2JSONRaw()

* Removed jsonPretty() pretty-printing routine.  Use
  JSON.stringify(json, null, <spaces>) instead.

See also:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_native_JSON

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agoLP#1268619: disable shared workers pending browser issues
Bill Erickson [Mon, 4 Aug 2014 18:26:36 +0000 (14:26 -0400)]
LP#1268619: disable shared workers pending browser issues

There appears to be a bug in Chromium where loading the same page
multiple times (without a refresh or cache clear) causes the
SharedWorker to fail to instantiate on every other page load.
Further research pending.  Disabling SharedWorker's entirely for
now.

Note, to replicate, load a page using shared workers, focus the
browser address bar, hit Enter to load the page again.  The shared
worker will fail to load on every other page load, though it will
appear to the SharedWorker caller (opensrf.js) that the port is open.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agoLP#1268619: update JS/WS/SSL code comment
Bill Erickson [Wed, 30 Jul 2014 16:05:36 +0000 (12:05 -0400)]
LP#1268619: update JS/WS/SSL code comment

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agoLP#1268619: JS status codes can come across as numbers; stringify for match
Bill Erickson [Thu, 10 Jul 2014 15:29:49 +0000 (11:29 -0400)]
LP#1268619: JS status codes can come across as numbers; stringify for match

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agoLP#1268619: JS libs capture all method errors
Bill Erickson [Tue, 8 Jul 2014 13:41:12 +0000 (09:41 -0400)]
LP#1268619: JS libs capture all method errors

Instead of selecting specific errors to report as method errors, report
all API calls which return 400 or 500-series errors as method errors.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agoLP#1268619: websocket: avoid sharedworker for firefox 29
Bill Erickson [Sun, 4 May 2014 19:58:17 +0000 (15:58 -0400)]
LP#1268619: websocket: avoid sharedworker for firefox 29

https://bugzilla.mozilla.org/show_bug.cgi?id=504553#c73

Avoid using SharedWorkers when useragent match "Firefox".  FF supports
shared workers, but it does not yet support WebSockets within shared
workers.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agoLP#1268619: websockets: detect connectedness of JS default sockets
Bill Erickson [Thu, 10 Apr 2014 12:50:13 +0000 (08:50 -0400)]
LP#1268619: websockets: detect connectedness of JS default sockets

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agoLP#1268619: websockets: auto-upgrade to shared workers; SSL-always
Bill Erickson [Mon, 7 Apr 2014 16:04:33 +0000 (12:04 -0400)]
LP#1268619: websockets: auto-upgrade to shared workers; SSL-always

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agoLP#1268619: websockets: gateway code repairs & confing options
Bill Erickson [Tue, 11 Mar 2014 21:25:19 +0000 (17:25 -0400)]
LP#1268619: websockets: gateway code repairs & confing options

* avoid unneccessary and wrong incantation of apr_thread_exit.  The two
  sub-threads now both live for the duration of the process.
* to be safe, create thread mutex before threads

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agoLP#1268619: websockets: apply syslog name in gateway
Bill Erickson [Mon, 10 Mar 2014 19:55:24 +0000 (15:55 -0400)]
LP#1268619: websockets: apply syslog name in gateway

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agoLP#1268619: websockets: README typo repairs
Bill Erickson [Mon, 10 Mar 2014 12:41:45 +0000 (08:41 -0400)]
LP#1268619: websockets: README typo repairs

Patch from Warren Layton to repair path to 'envvars' and clarify some
text.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agoLP#1268619: websockets : additional apache config docs
Bill Erickson [Thu, 6 Mar 2014 20:47:36 +0000 (15:47 -0500)]
LP#1268619: websockets : additional apache config docs

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agoLP#1268619: websockets: apache conf -> info logging
Bill Erickson [Thu, 6 Mar 2014 20:05:12 +0000 (15:05 -0500)]
LP#1268619: websockets: apache conf -> info logging

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agoLP#1268619: websockets: remove single-tab JS WS implementation
Bill Erickson [Wed, 5 Mar 2014 13:40:05 +0000 (08:40 -0500)]
LP#1268619: websockets: remove single-tab JS WS implementation

It was falling behind the shared lib in bug fixes and features.  A
per-tab WS implementation is (maybe) a dangerous thing to have around,
as well, since it encourages /many/ connections.  Can resurrect later if
needed.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agoLP#1268619: websockets: shared worker path; JS api_level
Bill Erickson [Tue, 4 Mar 2014 19:10:59 +0000 (14:10 -0500)]
LP#1268619: websockets: shared worker path; JS api_level

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agoLP#1268619: websockets: initial C libs api_level support
Bill Erickson [Mon, 3 Mar 2014 21:23:44 +0000 (16:23 -0500)]
LP#1268619: websockets: initial C libs api_level support

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agoLP#1268619: websockets : gateway log inbound messages at internal
Bill Erickson [Mon, 3 Mar 2014 21:01:58 +0000 (16:01 -0500)]
LP#1268619: websockets : gateway log inbound messages at internal

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agoLP#1268619: websocket : add JS lib to makefile
Bill Erickson [Mon, 3 Mar 2014 17:06:12 +0000 (12:06 -0500)]
LP#1268619: websocket : add JS lib to makefile

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agoLP#1268619: websocket: avoid module auto configuration
Bill Erickson [Mon, 3 Mar 2014 15:29:23 +0000 (10:29 -0500)]
LP#1268619: websocket: avoid module auto configuration

We don't want osrf_websocket_translator to be directly loaded as a
module, since it is not an apache module, but a shared library loaded by
an apache module (mod_websockets).  This is especially true of the default
apache instance.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agoLP#1268619: websocket : apache gateway minor fixes
Bill Erickson [Mon, 3 Mar 2014 15:05:26 +0000 (10:05 -0500)]
LP#1268619: websocket : apache gateway minor fixes

Replace remaining remote_ip calls with a get_client_ip() function which
operates for apache2 and apache4.

Make log functions for applying a log trace value accept const char*'s

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agoLP#1268619: websocket : more JS api docs
Bill Erickson [Mon, 3 Mar 2014 14:42:03 +0000 (09:42 -0500)]
LP#1268619: websocket : more JS api docs

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agoLP#1268619: websockets : added config docs to install readme
Bill Erickson [Thu, 16 Jan 2014 16:41:01 +0000 (11:41 -0500)]
LP#1268619: websockets : added config docs to install readme

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
7 years agoLP#1268619: websocket JS libs: reconnect and auto-connect
Bill Erickson [Tue, 14 Jan 2014 21:25:20 +0000 (16:25 -0500)]
LP#1268619: websocket JS libs: reconnect and auto-connect

JS clients no longer need to explicitly call the shared WS setup
routine.  It happens under the covers now.

JS client detects disconnects and reconnects when the next message send
attempt occurs.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>