Commit log

e74bae8 Merge branch 'error-refactor' into 'master'

Click to expand commit body
Error refactor

See merge request soprani.ca/sgx-bwmsgsv2!13

Christopher Vollick created

cddd64b Return meaningful text from bandwidth errors

Stephen Paul Weber created

7739701 Use blather error method

Stephen Paul Weber created

5c053fe Merge branch 'tests' into 'master'

Click to expand commit body
Initial test framework and some tests

See merge request soprani.ca/sgx-bwmsgsv2!12

Christopher Vollick created

f6e362c Initial test framework and some tests

Stephen Paul Weber created

bed6a72 Merge branch 'reply-to-remove' into 'master'

Click to expand commit body
Reply to IBR remove request

See merge request soprani.ca/sgx-bwmsgsv2!11

Christopher Vollick created

f770000 Reply to IBR remove request

Click to expand commit body
Otherwise caller times out waiting for it

Stephen Paul Weber created

f1e2313 Merge branch 'fix-for-older-redis' into 'master'

Click to expand commit body
Need Redis 7 for NX and GET together

See merge request soprani.ca/sgx-bwmsgsv2!10

Christopher Vollick created

44c4cd8 Need Redis 7 for NX and GET together

Stephen Paul Weber created

5c5482e Typo

Stephen Paul Weber created

b423b9e Merge branch 'sentry' into 'master'

Click to expand commit body
Instrument for sentry

See merge request soprani.ca/sgx-bwmsgsv2!9

Christopher Vollick created

778b90f Instrument for sentry

Stephen Paul Weber created

b14063e Hotfixes

Stephen Paul Weber created

57cde84 Merge branch 'allow-unregister' into 'master'

Click to expand commit body
Unregister when asked

See merge request soprani.ca/sgx-bwmsgsv2!7

Christopher Vollick created

15be6a7 Merge branch 'v1-is-dead' into 'master'

Click to expand commit body
v1 is dead, remove hacks

See merge request soprani.ca/sgx-bwmsgsv2!8

Christopher Vollick created

2c59c74 v1 is dead, remove hacks

Stephen Paul Weber created

e8530d1 Actually remove registration when asked

Stephen Paul Weber created

4217dbf Refactor knowledge of registration persistance to RegistrationRepo

Click to expand commit body
Keeps all knowledge about redis key structure, etc, in one place.

Stephen Paul Weber created

52fe3db Rack 2 breaks goliath

Stephen Paul Weber created

331f212 Get rubocop running again

Click to expand commit body
Not clean yet, but at least it runs

Stephen Paul Weber created

e786e90 Require from gem not relative

Stephen Paul Weber created

85b99a5 Merge branch 'use-empromise-gem' into 'master'

Click to expand commit body
Use new em_promise.rb gem

See merge request soprani.ca/sgx-bwmsgsv2!2

Stephen Paul Weber created

5ff13ff Merge branch 'remove-unused-usage-redis' into 'master'

Click to expand commit body
Remove unused redis usage data

See merge request soprani.ca/sgx-bwmsgsv2!6

Stephen Paul Weber created

5b38d8d Merge branch 'feature-not-implemented' into 'master'

Click to expand commit body
Simplify iq feature-not-implemented

See merge request soprani.ca/sgx-bwmsgsv2!5

Stephen Paul Weber created

df8d1af Remove unused redis usage data

Click to expand commit body
This redis key is not used anymore

Stephen Paul Weber created

8f9ed4b Simplify iq feature-not-implemented

Stephen Paul Weber created

127caeb Merge branch 'no-cheogram-hardcode' into 'master'

Click to expand commit body
Send to the correct target, do not assume cheogram

See merge request soprani.ca/sgx-bwmsgsv2!4

Stephen Paul Weber created

64a6291 Send to the correct target, do not assume cheogram

Click to expand commit body
Backport from prod hotfix

Stephen Paul Weber created

0884217 Merge branch 'support-more-delivery-failure-metadata' into 'master'

Click to expand commit body
Log the errorCode and description for deliver-failure

See merge request soprani.ca/sgx-bwmsgsv2!3

Stephen Paul Weber created

9b5d446 Give user a tiny bit more context about their failure

Click to expand commit body
Let them see the human readable failure description

Stephen Paul Weber created

c7f21dc Log the errorCode and description for deliver-failure

Click to expand commit body
deliveryCode and deliveryDescription were the v1 equivalents, but this is v2

Stephen Paul Weber created

5a2ea93 Use new em_promise.rb gem

Stephen Paul Weber created

d2e1163 copy sgx-catapult .all Deferable; not factored yet

Click to expand commit body
Specifically https://gitlab.com/ossguy/sgx-catapult/commit/583f98b is
copied here.  While there was another commit in that merge request (at
https://gitlab.com/ossguy/sgx-catapult/merge_requests/20), that commit
(https://gitlab.com/ossguy/sgx-catapult/commit/8f9e588) was already
included in 9d556e1 so we don't need to copy the entire merge request
here, only the single commit in that merge request that included the
"Allow EMPromise.all to accept both Promise and Deferable" part.

Note that this is required in sgx-bwmsgsv2 since jmp-fwdcalls uses it
and jmp-fwdcalls must be able to run with either sgx-catapult or
sgx-bwmsgsv2.  As an example, the following commit and MR require it:
https://gitlab.com/ossguy/jmp-fwdcalls/commit/405ef3c and
https://gitlab.com/ossguy/jmp-fwdcalls/merge_requests/12 .

We are doing the copy here since we haven't properly refactored the
common parts of sgx-catapult and sgx-bwmsgsv2 so they can, for
example, share one em_promise.rb file.

Denver Gingerich created

9d556e1 merge "CI and Lint" plus extra "not a script" fix

Click to expand commit body
See merge request !1 for the discussion and details behind the merge.

Denver Gingerich created

8f41b5a Add CI to run linter and also comply with the linter

Click to expand commit body
The metrics changes in .rubocop.yml definitely need to be reset to defaults, but
the required refactors are too big for this change alone so for now they were
increased to make it pass.

Other disabled rules may want to be revisited in the future also.

At least this passes its own ruleset now, and can run on sourcehut CI for every
commit.

Stephen Paul Weber created

f7d6273 fix eddafea as some bad reqs have non-empty params

Click to expand commit body
This fix is ported in from sgx-catapult, where we made the fix in
https://gitlab.com/ossguy/sgx-catapult/commit/c8fd695 - it is fairly
simple, but also fairly important.  Here is the description (with
edits made to show the corresponding commit IDs in this repo):

Sometimes HTTP requests to the port that sgx-bwmsgsv2 is running on
are slightly less naive - for example, with a path of:

  /web-meetme/conf_cdr.php?bookId=1

In this case params is indeed non-empty so we need to also catch this
case.  To be extra safe, we do so by rejecting both non-POST and
non-"root" requests.  Hopefully this will suffice for the situations
we care about, though of course the better solution would be to do
actual request validation.  We'll save that for later.

As with eddafea we have the same error/crash without this fix (if we
got an HTTP request of the above form):

  Shutting down gateway due to exception 013: no implicit conversion of nil into String

Denver Gingerich created

0349b26 fix disco code so non-:get disco <iq>s are ignored

Click to expand commit body
A copy of https://gitlab.com/ossguy/sgx-catapult/commit/a887c61 :

This is not 100% correct, but it's close enough for our purposes and
we left a TODO in case someone wants to fix it properly in the future.
This fix will at least prevent feedback loops of the type we had
previously with components like Cheogram.

Denver Gingerich created

eddafea don't crash on naive (parameter-less) HTTP request

Click to expand commit body
This fix is ported in from sgx-catapult, where we made the fix in
https://gitlab.com/ossguy/sgx-catapult/commit/300def9 - it is fairly
simple, but also fairly important.  Here is the description:

Without this fix, one will get the following error (and subsequent
crash) if the port that sgx-catapult is running on receives a naive
HTTP request, such as a "GET /" (from Wget or curl or similar):

  Shutting down gateway due to exception 013: no implicit conversion of nil into String

Denver Gingerich created

002c54c pass on to_catapult() ret val instead of ignoring

Click to expand commit body
This is a cross-merge of the fix done to sgx-catapult in
https://gitlab.com/ossguy/sgx-catapult/commit/89598a8 - it has no
effect in sgx-bwmsgsv2 for now, but will help once we cross-merge the
blocking code (to be done later).

We just have one fix left until we otherwise have fix-/feature-parity
with sgx-catapult.

Denver Gingerich created

3f11459 merge in "Clean up oob" incl. always on MMS-on-OOB

Click to expand commit body
This is a cross-merge of what we did in sgx-catapult already, in
https://gitlab.com/ossguy/sgx-catapult/commit/f95aab3 - see
https://gitlab.com/ossguy/sgx-catapult/merge_requests/19 for further
details.  The merge is not exact, as there has been some drift in
sgx-bwmsgsv2 since this was done in sgx-catapult, so indentation and
some s/next/return/ caused it to be a bit off.  But it should be fine.

This effectively removes the option to turn off MMS-on-OBB, and since
that has already been removed in sgx-catapult (per above), we can now
remove it from jmp-acct_bot as there are no further users (to be done
in a future commit).

With this commit we are getting close to feature-/fix-parity with
sgx-catapult, aside from the message blocking feature (which we won't
need to merge for a while yet).

Denver Gingerich created

68f03b8 revert 1570fd8 - it will be moot as of next commit

Denver Gingerich created

25bc6ad sgx-catapult users on same DB so need passthru fix

Click to expand commit body
We run sgx-bwmsgsv2 and sgx-catapult off the same database, which
means that mere existence in the database does not mean that we can
pass on the message directly, as they could be on a different system
(i.e. sgx-catapult instead of sgx-bwmsgsv2) and Cheogram will become
unhappy if we try to pass on messages in this way (plus it's wrong).

As a result, we need to make the check more precise, and specifically
determine that the destination user is a user of sgx-bwmsgsv2, which
we do by checking for a distinctive characteristic of the credentials.
This should ideally be done in a better way, but since we just have
the two systems for now, it is easy to do this substring check, as all
credentials follow this general pattern.

We know this commit works because we've been running it in production
for a couple months now (* sigh *) and will be making a similar commit
to sgx-catapult in the near future (as it naturally requires the same
sort of change in order to work properly, per above).

Denver Gingerich created

9563218 revert 7adf7d6 - jmp-fwdcalls plugover demands it

Click to expand commit body
While this localhost hardcoding would work fine if sgx-bwmsgsv2 was
run on its own, it usually isn't.  Instead, it is run as a plugover
(see https://gitlab.com/ossguy/jmp-fwdcalls/commit/08d3acc for
details), and because the voice endpoint that jmp-fwdcalls responds to
is public (so our carrier can deliver voice-related requests directly
to it), we need the whole endpoint to be public, even though the
requests delivered to sgx-bwmsgsv2 don't require that.

Denver Gingerich created

4416c47 fix send_media() so it supports both V1 & V2 media

Click to expand commit body
Ah, the idealism of 91ff289 could simply not be left unsullied.  We
though the V2 SGX would only need to deal with V2 media, but alas it
must deal with V1 media too, since we want it to work with the V1
jmp-fwdcalls.  In particular this means that send_media() must handle
the V1 media that is sent by jmp-fwdcalls (voicemail recording URLs).

This is roughly the counterpart of the fix we made at
https://gitlab.com/ossguy/sgx-catapult/commit/7dfe149683d31738076b075e9815643194d81684
- check the prefix and set the user accordingly (instead of checking
the user to set the prefix accordingly).

While we should probably document that deployment requires this extra
user, the warning in the code should serve the small number of people
who actually care well enough.  We hopefully won't need to run this
V1 + V2 monstrosity for very long.

With this fix we now fully support voicemails received by V2 users who
happen to still be using the V1 API for voice (which happens to be
everyone right now).  We thought this was all done as of
https://gitlab.com/ossguy/jmp-fwdcalls/commit/a4ed555e2dd16fb342f33ea7ee5675553baa39ec
but we needed the commit here to make voicemail recordings work.  I
suppose the jmp-fwdcalls commit message is still correct, though - no
additional work was needed in jmp-fwdcalls to fix the voicemail
recordings: only the fix here was required.

Denver Gingerich created

1570fd8 add note re MMS on OOB URL for V2 as no Jingle now

Click to expand commit body
Since we ripped out support for Jingle File Transfer in 60832f5 we
need to figure out the best way to provide MMS by default to users of
this SGX (the V2 SGX).  Should we just turn it on by default for all
users?  We could, but we'd have to let anyone migrating from V1 to V2
know about this change.  And maybe there should be a different default
option?  In any case, it still needs to be decided so add a TODO here.

Denver Gingerich created

cd4ceba add code for fixing V1 user_id - continues 9fece75

Denver Gingerich created

9fece75 more prep for jmp-fwdcalls compat: V1-provided arg

Click to expand commit body
This is a continuation of the work started in 90a21bc, which prepares
the SGX for integration with jmp-fwdcalls and its V1 dependence.  Left
out from that previous commit was a mention of where we first did the
V1->V2 switch in this SGX.  For the URL code of important to the
call_catapult() method, this was in a9237ee.

Back to this commit, we have paved the way for jmp-fwdcalls to pass us
a config file containing the V1 credentials, which we can then use
when we detect a V1 path in call_catapult() and convert accordingly.

Denver Gingerich created

90a21bc prepare SGX for use with jmp-fwdcalls, which is V1

Click to expand commit body
Until Bandwidth supports SIP endpoints in their V2 voice API, we need
to use their V1 voice API.  However, to use the V1 voice API alongside
the V2 messages API, we need to be a bit clever.  In particular, we
need to detect when we're getting a V1 call and adjust the URL
accordingly.

The hack implemented here to accomplish this allows us to make very
minimal changes to jmp-fwdcalls (letting it continue to use an
unmodified call_catapult() invocation) while still permitting it to
work with the V2 SGX (this one) as well as the V1 SGX.  As noted in
this commit's comments, jmp-fwdcalls will need to pass us some V1
credentials to use (since the V2 user won't have these available in
its creds list).  But that should be the only added complexity here.

Denver Gingerich created

8644cc6 add TODO since I forget what needs doing, rm extra

Denver Gingerich created

fcb7e2c put .copy() in send_media - caller shouldn't worry

Click to expand commit body
We added group picture message receiving support in d89a1b7, but the
API introduced there (as part of the send_media method) was not ideal
due to the caller having to worry about the deep clone.  So instead we
will move the .copy() into send_media() so that it worries about the
deep clone and the caller doesn't have to care.

Denver Gingerich created