Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update/v6.5.6 #46

Merged
merged 229 commits into from
Aug 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
229 commits
Select commit Hold shift + click to select a range
7ecc225
Update to latest goflow
rowanseymour Apr 21, 2021
1d4ab79
CI test on Go 1.16
rowanseymour Apr 21, 2021
cd52a99
Update to latest goflow
rowanseymour Apr 21, 2021
b3bd3b4
Update CHANGELOG.md for v6.3.7
Apr 21, 2021
98c09fa
Add task to resend messages
rowanseymour Apr 23, 2021
74e2f68
Add tests
rowanseymour Apr 26, 2021
dc39983
Import msgs task package in mailroom cmd
rowanseymour Apr 26, 2021
910e8f8
Rather than clone messages for resending, reset their state
rowanseymour May 6, 2021
ecb4f52
Fix test
rowanseymour May 6, 2021
b8e35e4
Add WA template translation namespace
norkans7 May 6, 2021
a74599e
Set queued_on to now() when resending messages
rowanseymour May 6, 2021
ce8d627
Merge pull request #420 from nyaruka/resend_msgs
rowanseymour May 6, 2021
ff36733
Update to latest goflow
rowanseymour May 6, 2021
04d4d85
Fix test
rowanseymour May 6, 2021
7eb8843
Update to latest goflow
norkans7 May 6, 2021
3fcb636
Update mailroom test dump
norkans7 May 7, 2021
79020dd
Fix conflicts
norkans7 May 7, 2021
a6bfdd4
Update CHANGELOG.md for v6.3.8
May 10, 2021
c4b4cbc
Update tests
norkans7 May 11, 2021
900fbbe
Update tests
norkans7 May 11, 2021
0c72cac
Merge pull request #422 from nyaruka/update-tests
norkans7 May 11, 2021
c93df8e
Merge branch 'main' of github.com:nyaruka/mailroom into WA-template-n…
norkans7 May 11, 2021
7722513
Update to latest goflow
rowanseymour May 11, 2021
1f1ed3c
Merge pull request #423 from nyaruka/latest_goflow
rowanseymour May 11, 2021
cafe24c
Merge pull request #421 from nyaruka/WA-template-namespace
rowanseymour May 11, 2021
0707846
Fix queueing of resent messages to courier and improve testing of que…
rowanseymour May 11, 2021
c0a771b
Fix comment
rowanseymour May 11, 2021
c7ddc4e
Merge pull request #424 from nyaruka/resend_fix
rowanseymour May 11, 2021
e72131a
Update CHANGELOG.md for v6.3.9
May 11, 2021
3d4f948
Load contact open tickets and pass to engine to expose as @contact.ti…
rowanseymour May 12, 2021
468ef0a
Merge pull request #425 from nyaruka/contact_tickets
rowanseymour May 13, 2021
5e043e0
Update CHANGELOG.md for v6.3.11
May 13, 2021
7b56a07
Update to latest goflow
rowanseymour May 18, 2021
911ad86
Add endpoint for msg resends
rowanseymour May 18, 2021
c4e348a
Update test db
rowanseymour May 18, 2021
0ccb380
Merge pull request #426 from nyaruka/update_test_db
rowanseymour May 19, 2021
4cb312b
Merge branch 'main' into resend_endpoint
rowanseymour May 19, 2021
f24a25c
More testing
rowanseymour May 19, 2021
1171613
Merge pull request #427 from nyaruka/resend_endpoint
rowanseymour May 19, 2021
c4ede12
Update to latest goflow
rowanseymour May 19, 2021
eff0eb8
Update CHANGELOG.md for v6.3.12
May 19, 2021
708f250
Remove reduntant resend_msgs task
rowanseymour May 19, 2021
1a57b8d
Start moving test constants to testsuite/testdata and out of the mode…
rowanseymour May 20, 2021
72657f3
Merge pull request #428 from nyaruka/testdata
rowanseymour May 24, 2021
b208126
Move more test constants out of models package
rowanseymour May 25, 2021
2362a4b
Merge pull request #429 from nyaruka/test_constants_pt2
rowanseymour May 26, 2021
37c9119
Move remaining test contact constants out of models package
rowanseymour May 26, 2021
f229184
Move remaining test constants out of models package
rowanseymour May 31, 2021
c42e9dd
Simplify use of test contacts in handler tests
rowanseymour May 31, 2021
c7017e0
Various fixes from linter
rowanseymour May 31, 2021
5e8e418
Update test db
rowanseymour Jun 1, 2021
b534620
Merge pull request #431 from nyaruka/fixes_from_linter
rowanseymour Jun 1, 2021
e2a1914
Add support for exclusion groups on triggers and add more testing of …
rowanseymour Jun 1, 2021
4691976
Further simplify trigger finding functions
rowanseymour Jun 2, 2021
bbde5a9
Tweak new testdata functions
rowanseymour Jun 2, 2021
ad901ca
Simplify testdata functions
rowanseymour Jun 2, 2021
2fd5636
Merge pull request #433 from nyaruka/test_tweaks
rowanseymour Jun 2, 2021
456ea74
Merge branch 'main' into triggers_exclude_groups
rowanseymour Jun 2, 2021
597bad7
Simplify FindMatchingReferralTrigger
rowanseymour Jun 3, 2021
c14a9bc
Remove cruft
rowanseymour Jun 3, 2021
6a2072c
Add comment and remove unused order by in query
rowanseymour Jun 3, 2021
61d2666
write sessions to s3 on resumes (optionally)
nicpottier Jun 3, 2021
1aceb82
WIP
rowanseymour Jun 4, 2021
56ef249
introduce runtime, move Server to use it
nicpottier Jun 4, 2021
035ae8e
use runtime for Mailroom and tasks
nicpottier Jun 4, 2021
421e50b
rename testsuite.Runtime to testsuite.RT
nicpottier Jun 4, 2021
3af46bc
actually save :)
nicpottier Jun 4, 2021
81c1947
Merge pull request #435 from nyaruka/runtime
nicpottier Jun 4, 2021
c41d694
Update CHANGELOG.md for v6.3.13
Jun 4, 2021
7ec0399
Merge pull request #432 from nyaruka/triggers_exclude_groups
rowanseymour Jun 4, 2021
72f52b9
Merge branch 'main' into closed_ticket_trigger
rowanseymour Jun 4, 2021
50546fb
merge main
nicpottier Jun 7, 2021
dcf9b7a
Add ticket closed events
rowanseymour Jun 7, 2021
a551619
more runtime usage
nicpottier Jun 7, 2021
bcb8ee4
Trigger ticket closed events (WIP)
rowanseymour Jun 8, 2021
89f9a3e
try manual codecov upload
nicpottier Jun 8, 2021
6e5e39a
try manual codecov upload
nicpottier Jun 8, 2021
226bf5d
Reorganize some handler code to break dependency on core/handlers and…
rowanseymour Jun 8, 2021
c9bb6d9
Use more testdata functions for trigger creation in tests
rowanseymour Jun 8, 2021
69dcd65
Merge branch 'handler_reorg' into closed_ticket_trigger
rowanseymour Jun 8, 2021
7c5065d
Temporarily switch to manual coverage uploads
rowanseymour Jun 8, 2021
8553b2e
Merge branch 'main' into handler_reorg
rowanseymour Jun 8, 2021
6e6470e
Merge branch 'handler_reorg' into closed_ticket_trigger
rowanseymour Jun 8, 2021
2c68ad5
write batch sessions, add session storage
nicpottier Jun 8, 2021
916f215
Merge pull request #436 from nyaruka/handler_reorg
rowanseymour Jun 8, 2021
c164de9
Fix closing mailroom tickets from CLOSE emails
rowanseymour Jun 8, 2021
0834865
Merge branch 'main' into closed_ticket_trigger
rowanseymour Jun 8, 2021
576fb41
update test cases for new media location
nicpottier Jun 8, 2021
0b1c23c
merge
nicpottier Jun 8, 2021
cbd8cb0
Rework TicketEvent to look like database model we'll add soon
rowanseymour Jun 8, 2021
bf13e44
Update to latest goflow
rowanseymour Jun 8, 2021
1353bb4
Merge branch 'main' into closed_ticket_trigger
rowanseymour Jun 8, 2021
0e55778
Merge branch 'main' into s3-session
rowanseymour Jun 9, 2021
20f4514
tweak config values
nicpottier Jun 9, 2021
2ec5de5
Merge branch 's3-session' of github.com:nyaruka/mailroom into s3-session
nicpottier Jun 9, 2021
b383466
Merge pull request #434 from nyaruka/s3-session
rowanseymour Jun 9, 2021
87e40ff
Update CHANGELOG.md for v6.3.14
Jun 9, 2021
b032561
Update to latest goflow as last release was broken
rowanseymour Jun 9, 2021
f7e8d35
Test tweaks
rowanseymour Jun 9, 2021
f900458
Fix test which modifies org
rowanseymour Jun 9, 2021
f58a957
Update CHANGELOG.md for v6.3.15
Jun 9, 2021
64f532f
Update test db
rowanseymour Jun 9, 2021
9b801e4
Merge pull request #438 from nyaruka/update_test_db
rowanseymour Jun 9, 2021
6b0a0b8
Merge branch 'main' into closed_ticket_trigger
rowanseymour Jun 9, 2021
26c296c
Make remaining unit tests in models package black box so testsuite ca…
rowanseymour Jun 9, 2021
f8e1550
Merge branch 'main' into closed_ticket_trigger
rowanseymour Jun 9, 2021
9745a79
Fix test
rowanseymour Jun 9, 2021
c4739e7
use milli in session URL, use media storage in testsuite.RT
nicpottier Jun 9, 2021
4565e0c
Merge pull request #439 from nyaruka/session-url-tweaks
rowanseymour Jun 9, 2021
90f76a4
Update to latest goflow which ditches TicketReference
rowanseymour Jun 9, 2021
44bcc36
Merge pull request #440 from nyaruka/flow_tickets
rowanseymour Jun 9, 2021
e810db8
Merge branch 'main' into closed_ticket_trigger
rowanseymour Jun 9, 2021
e5faea9
Insert closed ticket events into the db when closing tickets
rowanseymour Jun 9, 2021
6a05718
Closing and reopening tickets should save ticket events
rowanseymour Jun 10, 2021
f591ddb
Save user on ticket closed and reopened events
rowanseymour Jun 10, 2021
c30da69
Fix changed field UUIDs
rowanseymour Jun 10, 2021
14cd739
Opening tickets should create ticket opened events in the database
rowanseymour Jun 10, 2021
8a02cf9
Ensure that when tickets are reopened by incoming message that a reop…
rowanseymour Jun 10, 2021
f261532
read session files from storage when org configured to do so
nicpottier Jun 11, 2021
3ab7ea1
throw error upwards if we have no DB backdown
nicpottier Jun 11, 2021
8681099
use s3 session prefix when building s3 paths, default to /
nicpottier Jun 14, 2021
d0723df
Merge pull request #437 from nyaruka/closed_ticket_trigger
rowanseymour Jun 14, 2021
4043930
Update CHANGELOG.md for v6.3.16
Jun 14, 2021
2c8a610
Ignore contact tickets on ticketers which have been deleted
rowanseymour Jun 14, 2021
85c5de2
Merge pull request #442 from nyaruka/ticket_load_fix
rowanseymour Jun 14, 2021
81f2afe
Update CHANGELOG.md for v6.3.17
Jun 15, 2021
1b1d7f3
Merge pull request #441 from nyaruka/read-s3-sessions
nicpottier Jun 15, 2021
88c07ad
Update CHANGELOG.md for v6.3.18
Jun 15, 2021
f3938f4
parse URL to get path out
nicpottier Jun 15, 2021
1043c97
Update CHANGELOG.md for v6.3.19
Jun 15, 2021
53c03ed
have our session filename lead with timestamp so other objects can ex…
nicpottier Jun 15, 2021
348aa4b
Update CHANGELOG.md for v6.3.20
Jun 15, 2021
63d1756
Update to latest goflow and test database
rowanseymour Jun 17, 2021
459cf54
Add support for exclusion groups on scheduled triggers
rowanseymour Jun 17, 2021
f8c9003
Update system field test constants
rowanseymour Jun 17, 2021
cccdb02
Merge pull request #443 from nyaruka/latest_goflow
rowanseymour Jun 17, 2021
8c14422
Merge branch 'main' into scheduled_trigger_excludes
rowanseymour Jun 17, 2021
2dc0cb5
Update CHANGELOG.md for v6.3.21
Jun 17, 2021
3b01c81
Set contact_id when creating new tickets events and set last_activity…
rowanseymour Jun 17, 2021
439d8f4
Update ticket last_activity_on for incoming messages
rowanseymour Jun 17, 2021
fe04bc1
Merge pull request #445 from nyaruka/ticket_activity
rowanseymour Jun 17, 2021
dfacffa
Update CHANGELOG.md for v6.3.22
Jun 17, 2021
c8bd9ef
Merge branch 'main' into scheduled_trigger_excludes
rowanseymour Jun 17, 2021
cb74f37
Coverage
rowanseymour Jun 17, 2021
2c0f1dd
Merge pull request #444 from nyaruka/scheduled_trigger_excludes
rowanseymour Jun 21, 2021
22c3a56
Update CHANGELOG.md for v6.3.23
Jun 21, 2021
8d3923e
Update test database
rowanseymour Jun 22, 2021
366ba75
Add ticket to broadcasts and update last_activity_on after creating m…
rowanseymour Jun 22, 2021
f10ddf6
Coverage
rowanseymour Jun 22, 2021
b463811
Merge pull request #446 from nyaruka/bcast_tickets
rowanseymour Jun 22, 2021
5cd00c6
Make it easier to create tickets in tests
rowanseymour Jun 22, 2021
9338a36
Update test database
rowanseymour Jun 23, 2021
0232f86
Load org users as assets and use for ticket assignees and manual trig…
rowanseymour Jun 23, 2021
871b0da
Update to latest goflow
rowanseymour Jun 23, 2021
e1c35d1
Merge pull request #447 from nyaruka/user_assets
rowanseymour Jun 23, 2021
ebf0dcf
Update CHANGELOG.md for v6.3.24
Jun 23, 2021
3a9a6c8
Allow web tests to take substitutions so things like UUIDs don't alwa…
rowanseymour Jun 24, 2021
4420e59
Simplify testdata functions to not need a T
rowanseymour Jun 24, 2021
f099b4e
Replace some places where we access the config.Mailroom singleton wit…
rowanseymour Jun 24, 2021
ef4ef87
Merge pull request #448 from nyaruka/less_config_singleton
rowanseymour Jun 24, 2021
f188605
Make it easier to assert database state in unit tests
rowanseymour Jun 25, 2021
7c42f79
Merge pull request #449 from nyaruka/cleaner_asserts
rowanseymour Jun 26, 2021
6727a2f
Rework tests to lceanup after themselves and reduce need to reset ent…
rowanseymour Jun 26, 2021
9c76806
Fix tests
rowanseymour Jun 28, 2021
43d7be3
Update to latest goflow
rowanseymour Jun 28, 2021
d94056c
Cleanup tests
rowanseymour Jun 28, 2021
a8cb442
Update CHANGELOG.md for v6.3.25
Jun 28, 2021
ed4842c
Update test database
rowanseymour Jun 29, 2021
4a5325f
Stop writing broadcast.is_active which is now nullable
rowanseymour Jun 29, 2021
e25625e
Merge pull request #450 from nyaruka/broadcasts_is_active
rowanseymour Jun 29, 2021
dd5dc63
Update CHANGELOG.md for v6.3.26
Jun 29, 2021
08213f2
Fix handling of inbox messages to also update open tickets
rowanseymour Jul 1, 2021
253eb81
Merge pull request #451 from nyaruka/handle_ticket_fix
rowanseymour Jul 1, 2021
b1feaa0
Update CHANGELOG.md for v6.3.27
Jul 1, 2021
d686952
Rework remaining AssertQueryCount instances to AssertQuery > Returns
rowanseymour Jul 2, 2021
030d57e
Update to latest goflow/gocommon
rowanseymour Jul 2, 2021
ebecb62
Return more SQL when BulkQuery errors
rowanseymour Jul 2, 2021
4275a4a
Merge pull request #452 from nyaruka/better_bulk_query_errors
rowanseymour Jul 2, 2021
b04ba86
Update CHANGELOG.md for v6.3.28
Jul 2, 2021
af2e584
Include args in BulkQuery error output
rowanseymour Jul 2, 2021
b42c8c6
Update CHANGELOG.md for v6.3.29
Jul 2, 2021
88eaf0d
Update to latest goflow
rowanseymour Jul 5, 2021
2cdb138
Update CHANGELOG.md for v6.3.30
Jul 5, 2021
1cc80f1
Add endpoints for ticket assignment and adding notes
rowanseymour Jul 5, 2021
2664584
Merge pull request #453 from nyaruka/assign_and_note
rowanseymour Jul 5, 2021
196fbfb
Support ticket open events with assignees
rowanseymour Jul 5, 2021
95bfe6b
Coverage
rowanseymour Jul 5, 2021
d034a79
Merge pull request #454 from nyaruka/open_with_assignee
rowanseymour Jul 5, 2021
85348d2
Add test case for using ticket/assign endpoint to unassign
rowanseymour Jul 5, 2021
a4da43b
Update CHANGELOG.md for v6.3.31
Jul 5, 2021
7cd93ef
move s3 session config error to a warning for the time being since no…
nicpottier Jul 6, 2021
81299d7
Merge pull request #455 from nyaruka/session-s3-warn
nicpottier Jul 6, 2021
9b268b9
Update CHANGELOG.md for v6.4.0
Jul 6, 2021
96970fe
Add new error type for failed SQL queries
rowanseymour Jul 8, 2021
819300f
Merge pull request #457 from nyaruka/query_errors
rowanseymour Jul 9, 2021
082cd88
Update to latest goflow
rowanseymour Jul 9, 2021
ce1cb1e
Update CHANGELOG.md for v6.4.1
Jul 9, 2021
f806aa2
Latest goflow with latest localization
rowanseymour Jul 9, 2021
adb9eb5
Update CHANGELOG.md for v6.4.2
Jul 12, 2021
13b7078
Fix triggering new IVR flow from a simulation resume so that it inclu…
rowanseymour Jul 12, 2021
8c429d8
Merge pull request #458 from nyaruka/ivr_sim_fix
rowanseymour Jul 13, 2021
a21028b
Update CHANGELOG.md for v6.4.3
Jul 13, 2021
0329060
Update to latest goflow and gocommon
rowanseymour Jul 19, 2021
3707fdb
Merge pull request #460 from nyaruka/latest_goflow
rowanseymour Jul 19, 2021
91fd406
Update CHANGELOG.md for v6.5.0
rowanseymour Jul 19, 2021
1113a33
Log error if marking event fire as fired fails
rowanseymour Jul 19, 2021
013438c
Merge pull request #461 from nyaruka/log_err_mark_fails
rowanseymour Jul 19, 2021
75d3f0c
Support flow config ivr_retry values of -1 meaning no retry
rowanseymour Jul 20, 2021
e8cff47
Merge pull request #462 from nyaruka/no_ivr_retry
rowanseymour Jul 21, 2021
8de59cb
Update CHANGELOG.md for v6.5.1
rowanseymour Jul 21, 2021
d967560
Set sent_on for outgoing IVR messages
rowanseymour Jul 21, 2021
f7ea740
Merge pull request #463 from nyaruka/ivr_sent_on
rowanseymour Jul 21, 2021
cd49c1c
Update CHANGELOG.md for v6.5.2
rowanseymour Jul 21, 2021
7e0dded
Update to latest goflow
rowanseymour Jul 21, 2021
9d81dcb
Update contact modified_on after populate dynamic group task
rowanseymour Jul 23, 2021
59585f8
Merge pull request #464 from nyaruka/pop_dyn_group_fix
rowanseymour Jul 26, 2021
1474dda
Update CHANGELOG.md for v6.5.3
rowanseymour Jul 26, 2021
3dda6b7
Actually save IVR messages with sent_on set
rowanseymour Jul 26, 2021
41b30db
Merge pull request #466 from nyaruka/ivr_sent_on_fix
rowanseymour Jul 26, 2021
9f4fa51
Update CHANGELOG.md for v6.5.4
rowanseymour Jul 26, 2021
d8d1d5a
Populate ticket_count when creating new contacts
rowanseymour Jul 27, 2021
39eb79d
Fix tests broken by recent db changes to msgs and broadcasts
rowanseymour Jul 27, 2021
9b0247d
Merge pull request #467 from nyaruka/ticket_counts_pt1
rowanseymour Jul 28, 2021
a9293b9
Update CHANGELOG.md for v6.5.5
rowanseymour Jul 28, 2021
f28855d
Update to latest goflow and add parse_only as param to parse_query to…
rowanseymour Jul 29, 2021
4071ce0
Update to latest goflow
rowanseymour Jul 30, 2021
2b9bd2a
Merge pull request #468 from nyaruka/parse_only
rowanseymour Jul 30, 2021
734bd7a
Update CHANGELOG.md for v6.5.6
rowanseymour Jul 30, 2021
d08cc3d
Merge tag 'v6.5.6' into update/v6.5.6
jcbalmeida Aug 3, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: CI
on: [push, pull_request]
env:
go-version: '1.14.x'
go-version: '1.16.x'
postgis-version: '2.5'
jobs:
test:
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
if: success()
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
fail_ci_if_error: false

release:
name: Release
Expand Down
165 changes: 165 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,168 @@
v6.5.6
----------
* Update to latest goflow and add parse_only as param to parse_query to allow us to extract field dependencies even when they don't yet exist in the database

v6.5.5
----------
* Fix tests broken by recent db changes to msgs and broadcasts
* Populate ticket_count when creating new contacts

v6.5.4
----------
* Actually save IVR messages with sent_on set

v6.5.3
----------
* Update contact modified_on after populate dynamic group task
* Update to latest goflow

v6.5.2
----------
* Set sent_on for outgoing IVR messages

v6.5.1
----------
* Support flow config ivr_retry values of -1 meaning no retry
* Log error if marking event fire as fired fails

v6.5.0
----------
* Update to latest goflow and gocommon

v6.4.3
----------
* Fix triggering new IVR flow from a simulation resume so that it includes connection to test channel

v6.4.2
----------
* Latest goflow with latest localization

v6.4.1
----------
* Update to latest goflow to get fixes for nulls in webhook responses
* Add new error type for failed SQL queries

v6.4.0
----------
* move s3 session config error to a warning for the time being since not strictly required yet

v6.3.31
----------
* Support ticket open events with assignees
* Add endpoints for ticket assignment and adding notes

v6.3.30
----------
* Update to latest goflow

v6.3.29
----------
* Include args in BulkQuery error output

v6.3.28
----------
* Return more SQL when BulkQuery errors
* Update to latest goflow/gocommon

v6.3.27
----------
* Fix handling of inbox messages to also update open tickets

v6.3.26
----------
* Stop writing broadcast.is_active which is now nullable

v6.3.25
----------
* Update to latest goflow

v6.3.24
----------
* Update to latest goflow
* Load org users as assets and use for ticket assignees and manual trigger users
* Add ticket to broadcasts and update last_activity_on after creating messages for a broadcast with a ticket

v6.3.23
----------
* Add support for exclusion groups on scheduled triggers

v6.3.22
----------
* Update ticket last_activity_on when opening/closing and for incoming messages
* Set contact_id when creating new tickets events

v6.3.21
----------
* Update to latest goflow and which no longer takes default_language

v6.3.20
----------
* Have our session filename lead with timestamp so other objects can exist in contact dirs

v6.3.19
----------
* Parse URL to get path out for sessions

v6.3.18
----------
* Use s3 session prefix when building s3 paths, default to /
* Throw error upwards if we have no DB backdown
* Read session files from storage when org configured to do so

v6.3.17
----------
* Ignore contact tickets on ticketers which have been deleted

v6.3.16
----------
* Add ticket closed triggers and use to handle close ticket events
* Add ticket events and insert when opening/closing/reopening tickets

v6.3.15
----------
* Fix test which modifies org
* Update to latest goflow as last release was broken

v6.3.14
----------
* Update to latest goflow
* Write sessions to s3 on resumes (optionally)
* Add support for exclusion groups on triggers and generalize trigger matching

v6.3.13
----------
* Introduce runtime.Runtime
* Simplify testdata functions
* Various fixes from linter
* Simplify use of test contacts in handler tests
* Move test constants out of models package
* Remove reduntant resend_msgs task

v6.3.12
----------
* Update to latest goflow (legacy_extra is no longer an issue)
* Make Msg.next_attempt nullable
* Add web endpoint for msg resends so they can be a synchronous operation

v6.3.11
----------
* Expose open tickets as @contact.tickets

v6.3.9
----------
* Fix queueing of resent messages to courier and improve testing of queueing
* Update to latest goflow
* Add WA template translation namespace

v6.3.8
----------
* Add task to resend messages

v6.3.7
----------
* Update to latest goflow
* Update test database and rename Nexmo to Vonage

v6.3.6
----------
* Update to latest goflow
Expand Down
56 changes: 31 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# mailroom
# mailroom

[![Build Status](https://github.com/nyaruka/mailroom/workflows/CI/badge.svg)](https://github.com/nyaruka/mailroom/actions?query=workflow%3ACI)
[![codecov](https://codecov.io/gh/nyaruka/mailroom/branch/main/graph/badge.svg)](https://codecov.io/gh/nyaruka/mailroom)
[![Build Status](https://github.com/nyaruka/mailroom/workflows/CI/badge.svg)](https://github.com/nyaruka/mailroom/actions?query=workflow%3ACI)
[![codecov](https://codecov.io/gh/nyaruka/mailroom/branch/main/graph/badge.svg)](https://codecov.io/gh/nyaruka/mailroom)

# About
# About

Mailroom is the [RapidPro](https://github.com/rapidpro/rapidpro) component responsible for the execution of
flows. It interacts directly with the RapidPro database and sends and receives messages with [Courier](https://github.com/nyaruka/courier) for handling via Redis.
Expand All @@ -18,9 +18,10 @@ behind a reverse proxy such as nginx or Elastic Load Balancer that provides HTTP
# Configuration

Mailroom uses a tiered configuration system, each option takes precendence over the ones above it:
1. The configuration file
2. Environment variables starting with `MAILROOM_`
3. Command line parameters

1. The configuration file
2. Environment variables starting with `MAILROOM_`
3. Command line parameters

We recommend running Mailroom with no changes to the configuration and no parameters, using only
environment variables to configure it. You can use `% mailroom --help` to see a list of the
Expand All @@ -30,29 +31,34 @@ environment variables and parameters and for more details on each option.

For use with RapidPro, you will want to configure these settings:

* `MAILROOM_ADDRESS`: the address to bind our web server to (default "localhost")
* `MAILROOM_DOMAIN`: the domain that mailroom is listening on
* `MAILROOM_AUTH_TOKEN`: the token clients will need to authenticate web requests (should match setting in RapidPro)
* `MAILROOM_ATTACHMENT_DOMAIN`: the domain that will be used for relative attachments in flows
* `MAILROOM_DB`: URL describing how to connect to the RapidPro database (default "postgres://temba:temba@localhost/temba?sslmode=disable")
* `MAILROOM_REDIS`: URL describing how to connect to Redis (default "redis://localhost:6379/15")
* `MAILROOM_ELASTIC`: URL describing how to connect to ElasticSearch (default "http://localhost:9200")
* `MAILROOM_SMTP_SERVER`: the smtp configuration for sending emails ex: smtp://user%40password@server:port/?from=foo%40gmail.com
- `MAILROOM_ADDRESS`: the address to bind our web server to (default "localhost")
- `MAILROOM_DOMAIN`: the domain that mailroom is listening on
- `MAILROOM_AUTH_TOKEN`: the token clients will need to authenticate web requests (should match setting in RapidPro)
- `MAILROOM_ATTACHMENT_DOMAIN`: the domain that will be used for relative attachments in flows
- `MAILROOM_DB`: URL describing how to connect to the RapidPro database (default "postgres://temba:temba@localhost/temba?sslmode=disable")
- `MAILROOM_REDIS`: URL describing how to connect to Redis (default "redis://localhost:6379/15")
- `MAILROOM_ELASTIC`: URL describing how to connect to ElasticSearch (default "http://localhost:9200")
- `MAILROOM_SMTP_SERVER`: the smtp configuration for sending emails ex: smtp://user%40password@server:port/?from=foo%40gmail.com

For writing of message attachments, Mailroom needs access to an S3 bucket, you can configure access to your bucket via:

* `MAILROOM_S3_REGION`: The region for your S3 bucket (ex: `eu-west-1`)
* `MAILROOM_S3_MEDIA_BUCKET`: The name of your S3 bucket (ex: `dl-mailroom`)
* `MAILROOM_S3_MEDIA_PREFIX`: The prefix to use for filenames of attachments added to your bucket (ex: `attachments`)
* `MAILROOM_AWS_ACCESS_KEY_ID`: The AWS access key id used to authenticate to AWS
* `MAILROOM_AWS_SECRET_ACCESS_KEY` The AWS secret access key used to authenticate to AWS
- `MAILROOM_S3_REGION`: The region for your S3 bucket (ex: `eu-west-1`)
- `MAILROOM_S3_MEDIA_BUCKET`: The name of your S3 bucket (ex: `dl-mailroom`)
- `MAILROOM_S3_MEDIA_PREFIX`: The prefix to use for filenames of attachments added to your bucket (ex: `attachments`)
- `MAILROOM_AWS_ACCESS_KEY_ID`: The AWS access key id used to authenticate to AWS
- `MAILROOM_AWS_SECRET_ACCESS_KEY` The AWS secret access key used to authenticate to AWS

While still in beta, Mailroom will move to writing session data to S3 in 6.6, you can configure those buckets using:

- `MAILROOM_S3_SESSION_BUCKET`: The name of your S3 bucket (ex: `rp-sessions`)
- `MAILROOM_S3_SESSION_PREFIX`: The prefix to use for filenames of sessions added to your bucket (ex: ``)

Recommended settings for error and performance monitoring:

* `MAILROOM_LIBRATO_USERNAME`: The username to use for logging of events to Librato
* `MAILROOM_LIBRATO_TOKEN`: The token to use for logging of events to Librato
* `MAILROOM_SENTRY_DSN`: The DSN to use when logging errors to Sentry
* `MAILROOM_LOG_LEVEL`: the logging level mailroom should use (default "error", use "debug" for more)
- `MAILROOM_LIBRATO_USERNAME`: The username to use for logging of events to Librato
- `MAILROOM_LIBRATO_TOKEN`: The token to use for logging of events to Librato
- `MAILROOM_SENTRY_DSN`: The DSN to use when logging errors to Sentry
- `MAILROOM_LOG_LEVEL`: the logging level mailroom should use (default "error", use "debug" for more)

# Development

Expand Down
2 changes: 1 addition & 1 deletion cmd/mailroom/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
_ "github.com/nyaruka/mailroom/core/tasks/campaigns"
_ "github.com/nyaruka/mailroom/core/tasks/contacts"
_ "github.com/nyaruka/mailroom/core/tasks/expirations"
_ "github.com/nyaruka/mailroom/core/tasks/groups"
_ "github.com/nyaruka/mailroom/core/tasks/interrupts"
_ "github.com/nyaruka/mailroom/core/tasks/ivr"
_ "github.com/nyaruka/mailroom/core/tasks/schedules"
Expand All @@ -36,6 +35,7 @@ import (
_ "github.com/nyaruka/mailroom/web/expression"
_ "github.com/nyaruka/mailroom/web/flow"
_ "github.com/nyaruka/mailroom/web/ivr"
_ "github.com/nyaruka/mailroom/web/msg"
_ "github.com/nyaruka/mailroom/web/org"
_ "github.com/nyaruka/mailroom/web/po"
_ "github.com/nyaruka/mailroom/web/simulation"
Expand Down
20 changes: 14 additions & 6 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,18 @@ type Config struct {
Domain string `help:"the domain that mailroom is listening on"`
AttachmentDomain string `help:"the domain that will be used for relative attachment"`

S3Endpoint string `help:"the S3 endpoint we will write attachments to"`
S3Region string `help:"the S3 region we will write attachments to"`
S3MediaBucket string `help:"the S3 bucket we will write attachments to"`
S3MediaPrefix string `help:"the prefix that will be added to attachment filenames"`
S3DisableSSL bool `help:"whether we disable SSL when accessing S3. Should always be set to False unless you're hosting an S3 compatible service within a secure internal network"`
S3ForcePathStyle bool `help:"whether we force S3 path style. Should generally need to default to False unless you're hosting an S3 compatible service"`
S3Endpoint string `help:"the S3 endpoint we will write attachments to"`
S3Region string `help:"the S3 region we will write attachments to"`

S3MediaBucket string `help:"the S3 bucket we will write attachments to"`
S3MediaPrefix string `help:"the prefix that will be added to attachment filenames"`

S3SessionBucket string `help:"the S3 bucket we will write attachments to"`
S3SessionPrefix string `help:"the prefix that will be added to attachment filenames"`

S3DisableSSL bool `help:"whether we disable SSL when accessing S3. Should always be set to False unless you're hosting an S3 compatible service within a secure internal network"`
S3ForcePathStyle bool `help:"whether we force S3 path style. Should generally need to default to False unless you're hosting an S3 compatible service"`

AWSAccessKeyID string `help:"the access key id to use when authenticating S3"`
AWSSecretAccessKey string `help:"the secret access key id to use when authenticating S3"`

Expand Down Expand Up @@ -93,6 +99,8 @@ func NewMailroomConfig() *Config {
S3Region: "us-east-1",
S3MediaBucket: "mailroom-media",
S3MediaPrefix: "/media/",
S3SessionBucket: "mailroom-sessions",
S3SessionPrefix: "/",
S3DisableSSL: false,
S3ForcePathStyle: false,
AWSAccessKeyID: "",
Expand Down
4 changes: 4 additions & 0 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ import (
"testing"

"github.com/nyaruka/mailroom/config"
"github.com/nyaruka/mailroom/testsuite"

"github.com/stretchr/testify/assert"
)

func TestParseDisallowedNetworks(t *testing.T) {
// this is only here because this is the first test run.. should find a better way to ensure DB is in correct state for first test that needs it
testsuite.Reset()

cfg := config.NewMailroomConfig()

privateNetwork1 := &net.IPNet{IP: net.IPv4(10, 0, 0, 0).To4(), Mask: net.CIDRMask(8, 32)}
Expand Down
Loading