Giter VIP home page Giter VIP logo

mongoosepush's Introduction

MongoosePush

CircleCI Coverage Status

MongoosePush is a simple, RESTful service written in Elixir, providing the ability to send push notifications to FCM (Firebase Cloud Messaging) and/or APNS (Apple Push Notification Service) via their HTTP/2 API.

Documentation

Documentation is available at: https://esl.github.io/MongoosePush

Quick start

Running from DockerHub

We provide prebuilt MongoosePush images. Configuration requires either an FCM token, APNS certificates or an APNS token. Depending on your usecase, you can have some or all of them in a standalone MongoosePush instance or using a docker container. For the full configuration you need to set the following directory structure up:

  • priv/
    • ssl/
      • rest_cert.pem - The HTTP endpoint certificate
      • rest_key.pem - private key for the HTTP endpoint certificate (has to be unencrypted)
    • apns/
      • prod_cert.pem - Production APNS app certificate
      • prod_key.pem - Production APNS app certificate's private key (has to be unencrypted)
      • dev_cert.pem - Development APNS app certificate
      • dev_key.pem - Development APNS app certificate's private key (has to be unencrypted)
      • token.p8 - APNS authentication token
    • fcm/
      • token.json - FCM service account JSON file

If you want to use APNS token authentication you need to provide token and set key_id and team_id environment variables. To see how to obtain token and key_id read this. To see how to obtain team_id read this.

FCM JSON file can be generated by Firebase console (https://console.firebase.google.com). Go to your project -> Project Settings -> Service accounts -> Generate new private key Assuming that you have the priv directory with all certificates and fcm token in current directory, then you may start MongoosePush with the following command:

docker run -v `pwd`/priv:/opt/app/priv \
  -e PUSH_HTTPS_CERTFILE="/opt/app/priv/ssl/rest_cert.pem" \
  -e PUSH_HTTPS_KEYFILE="/opt/app/priv/ssl/rest_key.pem" \
  -it --rm mongooseim/mongoose-push:latest

Local build prerequisites

  • Elixir 1.5+ (http://elixir-lang.org/install.html)
  • Erlang/OTP 19.3+

    NOTE: Some Erlang/OTP 20.x releases / builds contain TLS bug that prevents connecting to APNS servers. When building with this Erlang version, please make sure that MongoosePushRuntimeTest test suite passes. It is however highly recommended to build MongoosePush with Erlang/OTP 21.x.

  • Rebar3 (just enter mix local.rebar)

mongoosepush's People

Contributors

aleklisi avatar arkgil avatar chrzaszcz avatar janciesla8818 avatar kamilwaz avatar kmakiela avatar leszke avatar ludwikbukowski avatar michalwski avatar nelsonvides avatar pawlooss1 avatar rslota avatar zofpolkowska avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mongoosepush's Issues

Latest Docker image not running in foreground

The latest Docker image on DockerHub terminates after initializing:

mongoosepush_1  | 19:10:29.817 [info] Application elixometer started on node '[email protected]'
mongoosepush_1  | 19:10:29.817 [info] Application exometer started on node '[email protected]'
mongoosepush_1  | 19:10:29.817 [info] Application cowlib started on node '[email protected]'
mongoosepush_1  | 19:10:29.818 [info] Application ranch started on node '[email protected]'
mongoosepush_1  | Interactive Elixir (1.4.1) - press Ctrl+C to exit (type h() ENTER for help)
mongoosepush_1  | Eshell V8.3  (abort with ^G)
mongoosepush_1  | iex([email protected])1> *** Terminating erlang ('[email protected]')
ejabberd_mongoosepush_1 exited with code 0

docker-compose.yml:

version: '2'
services:
  mongoosepush:
    image: mongooseim/mongoose-push:latest
    ports:
      - "8443:8443"
    environment:
      PUSH_FCM_APP_KEY: "..."
      PUSH_LOGLEVEL: debug
    volumes:
      - ./push:/opt/app/priv

This issue seems to be introduced with the following commit: 41d8f41. This commit included a whole rewrite of Dockerfile.release. When I override the command, MongoosePush stays in the foreground, thus everything works again as expected:

command: foreground

And another question: would it be possible to do proper releases using semantic versioning? We are using this image in production and being only able to pull latest (or some PRs) is kind of a deal-breaker.

Local Build Failing, Looks like issue with chatterbox

Got the following error while building

===> Compiling chatterbox
===> Compiling src/h2_stream.erl failed
src/h2_stream.erl:105: gen_fsm:start_link/3 is deprecated and will be removed in a future release; use gen_statem:start/3
src/h2_stream.erl:115: gen_fsm:send_event/2 is deprecated and will be removed in a future release; use gen_statem:cast/1
src/h2_stream.erl:120: gen_fsm:send_event/2 is deprecated and will be removed in a future release; use gen_statem:cast/1
src/h2_stream.erl:124: gen_fsm:sync_send_all_state_event/2 is deprecated and will be removed in a future release; use gen_statem:call/2
src/h2_stream.erl:128: gen_fsm:sync_send_all_state_event/2 is deprecated and will be removed in a future release; use gen_statem:call/2
src/h2_stream.erl:132: gen_fsm:send_all_state_event/2 is deprecated and will be removed in a future release; use gen_statem:cast/1
src/h2_stream.erl:136: gen_fsm:send_all_state_event/2 is deprecated and will be removed in a future release; use gen_statem:cast/1
src/h2_stream.erl:139: gen_fsm:sync_send_all_state_event/2 is deprecated and will be removed in a future release; use gen_statem:call/2
src/h2_stream.erl:143: gen_fsm:stop/1 is deprecated and will be removed in a future release; use gen_statem:stop/1
src/h2_stream.erl:486: gen_fsm:send_all_state_event/2 is deprecated and will be removed in a future release; use gen_statem:cast/1

==> mongoose_push
** (Mix) Could not compile dependency :chatterbox, "/home/ubuntu/.mix/rebar3 bare compile --paths "/home/ubuntu/MongoosePush-0.9.0/_build/prod/lib/*/ebin"" command failed. You can recompile this dependency with "mix deps.compile chatterbox", update it with "mix deps.update chatterbox" or clean it with "mix deps.clean chatterbox"

Tried to blindly replace the functions, got error while running.

compilation error : Could not compile dependency :chatterbox

===> Compiling exometer
==> elixometer
Compiling 4 files (.ex)
Generated elixometer app
===> Compiling chatterbox
===> Compiling src/h2_stream.erl failed
src/h2_stream.erl:105: gen_fsm:start_link/3 is deprecated and will be removed in a future release; use gen_statem:start/3
src/h2_stream.erl:115: gen_fsm:send_event/2 is deprecated and will be removed in a future release; use gen_statem:cast/1
src/h2_stream.erl:120: gen_fsm:send_event/2 is deprecated and will be removed in a future release; use gen_statem:cast/1
src/h2_stream.erl:124: gen_fsm:sync_send_all_state_event/2 is deprecated and will be removed in a future release; use gen_statem:call/2
src/h2_stream.erl:128: gen_fsm:sync_send_all_state_event/2 is deprecated and will be removed in a future release; use gen_statem:call/2
src/h2_stream.erl:132: gen_fsm:send_all_state_event/2 is deprecated and will be removed in a future release; use gen_statem:cast/1
src/h2_stream.erl:136: gen_fsm:send_all_state_event/2 is deprecated and will be removed in a future release; use gen_statem:cast/1
src/h2_stream.erl:139: gen_fsm:sync_send_all_state_event/2 is deprecated and will be removed in a future release; use gen_statem:call/2
src/h2_stream.erl:143: gen_fsm:stop/1 is deprecated and will be removed in a future release; use gen_statem:stop/1
src/h2_stream.erl:486: gen_fsm:send_all_state_event/2 is deprecated and will be removed in a future release; use gen_statem:cast/1

==> mongoose_push
** (Mix) Could not compile dependency :chatterbox, "/root/.mix/rebar3 bare compile --paths "/home/mongoosePush/MongoosePush/_build/prod/lib/*/ebin"" command failed. You can recompile this dependency with "mix deps.compile chatterbox", update it with "mix deps.update chatterbox" or clean it with "mix deps.clean chatterbox"

Debugging utilities on production

The release included in docker image doesn't contain any debugging utilities like dbg or recon. I think they are worth adding since they help a lot on production when you want to investigate failures.

APNS connection instability

In MongoosePush logs I see many errors like the following:

07:23:17.883 [error] :nxdomain

=CRASH REPORT==== 7-Apr-2017::07:23:17 ===
  crasher:
    initial call: h2_connection:init/1
    pid: <0.11866.2>
    registered_name: []
    exception exit: nxdomain
      in function  gen_fsm:init_it/6 (gen_fsm.erl, line 335)
    ancestors: [apns_dev_1,'Elixir.MongoosePush.Supervisor',<0.1311.0>]
    messages: []
    links: [<0.1318.0>]
    dictionary: []
    trap_exit: false
    status: running
    heap_size: 987
    stack_size: 27
    reductions: 5548
  neighbours:
07:23:17.884 [error] CRASH REPORT Process <0.11866.2> with 0 neighbours exited with reason: nxdomain in gen_fsm:init_it/6 line 335

docker run error: OpenSSL might not be installed on this system

Ubuntu 16
Erlang/OTP: 20
Source: master

After building docker from latest source for 1.0.0

MIX_ENV=prod mix do docker.build, docker.release

and typing:

docker run -it --rm mongoose_push:release foreground

got errors:

2018-05-22 10:29:34 Unable to load crypto library. Failed with error:~n"~p, ~s"~nOpenSSL might not be installed on this system.~n
        load_failed
        "Failed to load NIF library /opt/app/lib/crypto-4.2.2/priv/lib/crypto: 'libcrypto.so.1.1: cannot open shared object file: No such file or directory'"
2018-05-22 10:29:34 crash_report        
    initial_call: {supervisor,kernel,['Argument__1']}
    pid: <0.1180.0>
    registered_name: []
    error_info: {exit,{on_load_function_failed,crypto},[{init,run_on_load_handlers,0,[]},{kernel,init,1,[{file,"kernel.erl"},{line,217}]},{supervisor,init,1,[{file,"supervisor.erl"},{line,294}]},{gen_server,init_it,2,[{file,"gen_server.erl"},{line,365}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,333}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]}
    ancestors: [kernel_sup,<0.1156.0>]
    message_queue_len: 0
    messages: []
    links: [<0.1157.0>]
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 610
    stack_size: 27
    reductions: 235
2018-05-22 10:29:34 supervisor_report   
    supervisor: {local,kernel_sup}
    errorContext: start_error
    reason: {on_load_function_failed,crypto}
    offender: [{pid,undefined},{id,kernel_safe_sup},{mfargs,{supervisor,start_link,[{local,kernel_safe_sup},kernel,safe]}},{restart_type,permanent},{shutdown,infinity},{child_type,supervisor}]
2018-05-22 10:29:35 crash_report        
    initial_call: {application_master,init,['Argument__1','Argument__2','Argument__3','Argument__4']}
    pid: <0.1155.0>
    registered_name: []
    error_info: {exit,{{shutdown,{failed_to_start_child,kernel_safe_sup,{on_load_function_failed,crypto}}},{kernel,start,[normal,[]]}},[{application_master,init,4,[{file,"application_master.erl"},{line,134}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]}
    ancestors: [<0.1154.0>]
    message_queue_len: 1
    messages: [{'EXIT',<0.1156.0>,normal}]
    links: [<0.1154.0>,<0.1153.0>]
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 376
    stack_size: 27
    reductions: 213
2018-05-22 10:29:35 std_info            
    application: kernel
    exited: {{shutdown,{failed_to_start_child,kernel_safe_sup,{on_load_function_failed,crypto}}},{kernel,start,[normal,[]]}}
    type: permanent
{"Kernel pid terminated",application_controller,"{application_start_failure,kernel,{{shutdown,{failed_to_start_child,kernel_safe_sup,{on_load_function_failed,crypto}}},{kernel,start,[normal,[]]}}}"}
Kernel pid terminated (application_controller) ({application_start_failure,kernel,{{shutdown,{failed_to_start_child,kernel_safe_sup,{on_load_function_failed,crypto}}},{kernel,start,[normal,[]]}}})

Crash dump is being written to: erl_crash.dump...done

KEY_ID TEAM_ID apns

Not sure if it's something on my end or what, but seems like the environment variable is reversed? I get a InvalidProviderToken until i swapped the key and team. Inspecting the resulted JWT token you see kid gets filled out with the team id...

1.0.5 release docker image has faulty ssl-9.2

Hello,

We are using the current 1.0.5 release of MongoosePush and have been having intermittent problems with connecting out to remote services to send push notifications.

The 1.0.5 MongoosePush docker image has ssl-9.2.

Upon investigation we have see that the problem is being caused by https://bugs.erlang.org/browse/ERL-883 and https://bugs.erlang.org/browse/ERL-884.

These issues are fixed in OTP 21.3.1 and ssl-9.2.1.

It would be great if a new release could be made which contains this, I bet we are not the only people affected by this issue.

Cheers

  • Mike

Default value for APNS Topic

The APNS topic in production environments have to be set via MongoosePush API. This may be redundant since, MongoosePush may default this topic to the first one available in APNS X509 certificate.

Fail while using with APNS.

12:22:49.774 [info] Reconnecting to push service provider before request

12:22:49.869 [error] {:options, {:keyfile, '/home/MongoosePush/_build/prod/rel/mongoose_push/lib/mongoose_push-0.1.0/priv/apns/PushChatKey_Prod.pem', []}}

=CRASH REPORT==== 12-Oct-2017::12:22:49 ===
crasher:
initial call: h2_connection:init/1
pid: <0.1432.0>
registered_name: []
exception exit: {options,{keyfile,"/home/MongoosePush/_build/prod/rel/mongoose_push/lib/mongoose_push-0.1.0/priv/apns/PushChatKey_Prod.pem",
[]}}
in function gen_fsm:init_it/6 (gen_fsm.erl, line 335)
ancestors: [apns_prod_2,'Elixir.MongoosePush.Supervisor',<0.1393.0>]
messages: []
links: [<0.1406.0>]
dictionary: []
trap_exit: false
status: running
heap_size: 1598
stack_size: 27
reductions: 5074
neighbours:
12:22:49.870 [error] CRASH REPORT Process <0.1432.0> with 0 neighbours exited with reason: {options,{keyfile,"/home/MongoosePush/_build/prod/rel/mongoose_push/lib/mongoose_push-0.1.0/priv/apns/PushChatKey_Prod.pem",[]}} in gen_fsm:init_it/6 line 335

12:22:49.969 [error] {:options, {:keyfile, '/home/MongoosePush/_build/prod/rel/mongoose_push/lib/mongoose_push-0.1.0/priv/apns/PushChatKey_Prod.pem', []}}

=CRASH REPORT==== 12-Oct-2017::12:22:49 ===
crasher:
initial call: h2_connection:init/1
pid: <0.1436.0>
registered_name: []
exception exit: {options,{keyfile,"/home/MongoosePush/_build/prod/rel/mongoose_push/lib/mongoose_push-0.1.0/priv/apns/PushChatKey_Prod.pem",
[]}}
in function gen_fsm:init_it/6 (gen_fsm.erl, line 335)
ancestors: [apns_prod_2,'Elixir.MongoosePush.Supervisor',<0.1393.0>]
messages: []
links: [<0.1406.0>]
dictionary: []
trap_exit: false
status: running
heap_size: 987
stack_size: 27
reductions: 5030
neighbours:

12:22:50.061 [error] {:options, {:keyfile, '/home/MongoosePush/_build/prod/rel/mongoose_push/lib/mongoose_push-0.1.0/priv/apns/PushChatKey_Prod.pem', []}}

12:22:50.061 [error] Failed to establish SSL connection. Is the certificate signed for :prod mode?

12:22:50.061 [info] Reconnecting to push service provider before request

=CRASH REPORT==== 12-Oct-2017::12:22:50 ===
crasher:
initial call: h2_connection:init/1
pid: <0.1438.0>
registered_name: []
exception exit: {options,{keyfile,"/home/MongoosePush/_build/prod/rel/mongoose_push/lib/mongoose_push-0.1.0/priv/apns/PushChatKey_Prod.pem",
[]}}
in function gen_fsm:init_it/6 (gen_fsm.erl, line 335)
ancestors: [apns_prod_2,'Elixir.MongoosePush.Supervisor',<0.1393.0>]
messages: []
links: [<0.1406.0>]
dictionary: []
trap_exit: false
status: running
heap_size: 987
stack_size: 27
reductions: 5034
neighbours:
12:22:49.969 [error] CRASH REPORT Process <0.1436.0> with 0 neighbours exited with reason: {options,{keyfile,"/home/MongoosePush/_build/prod/rel/mongoose_push/lib/mongoose_push-0.1.0/priv/apns/PushChatKey_Prod.pem",[]}} in gen_fsm:init_it/6 line 335

12:22:50.159 [error] {:options, {:keyfile, '/home/MongoosePush/_build/prod/rel/mongoose_push/lib/mongoose_push-0.1.0/priv/apns/PushChatKey_Prod.pem', []}}

=CRASH REPORT==== 12-Oct-2017::12:22:50 ===
crasher:
initial call: h2_connection:init/1
pid: <0.1440.0>
registered_name: []
exception exit: {options,{keyfile,"/home/MongoosePush/_build/prod/rel/mongoose_push/lib/mongoose_push-0.1.0/priv/apns/PushChatKey_Prod.pem",
[]}}
in function gen_fsm:init_it/6 (gen_fsm.erl, line 335)
ancestors: [apns_prod_2,'Elixir.MongoosePush.Supervisor',<0.1393.0>]
messages: []
links: [<0.1406.0>]
dictionary: []
trap_exit: false
status: running
heap_size: 987
stack_size: 27
reductions: 5038
neighbours:
12:22:50.061 [error] CRASH REPORT Process <0.1438.0> with 0 neighbours exited with reason: {options,{keyfile,"/home/MongoosePush/_build/prod/rel/mongoose_push/lib/mongoose_push-0.1.0/priv/apns/PushChatKey_Prod.pem",[]}} in gen_fsm:init_it/6 line 335

12:22:50.250 [error] {:options, {:keyfile, '/home/MongoosePush/_build/prod/rel/mongoose_push/lib/mongoose_push-0.1.0/priv/apns/PushChatKey_Prod.pem', []}}

=CRASH REPORT==== 12-Oct-2017::12:22:50 ===
crasher:
initial call: h2_connection:init/1
pid: <0.1442.0>
registered_name: []
exception exit: {options,{keyfile,"/home/MongoosePush/_build/prod/rel/mongoose_push/lib/mongoose_push-0.1.0/priv/apns/PushChatKey_Prod.pem",
[]}}
in function gen_fsm:init_it/6 (gen_fsm.erl, line 335)
ancestors: [apns_prod_2,'Elixir.MongoosePush.Supervisor',<0.1393.0>]
messages: []
links: [<0.1406.0>]
dictionary: []
trap_exit: false
status: running
heap_size: 987
stack_size: 27
reductions: 5042
neighbours:

12:22:50.308 [error] {:options, {:keyfile, '/home/MongoosePush/_build/prod/rel/mongoose_push/lib/mongoose_push-0.1.0/priv/apns/PushChatKey_Prod.pem', []}}

=CRASH REPORT==== 12-Oct-2017::12:22:50 ===
crasher:
initial call: h2_connection:init/1
pid: <0.1444.0>
registered_name: []
exception exit: {options,{keyfile,"/home/MongoosePush/_build/prod/rel/mongoose_push/lib/mongoose_push-0.1.0/priv/apns/PushChatKey_Prod.pem",
[]}}
in function gen_fsm:init_it/6 (gen_fsm.erl, line 335)
ancestors: [apns_prod_2,'Elixir.MongoosePush.Supervisor',<0.1393.0>]
messages: []
links: [<0.1406.0>]
dictionary: []
trap_exit: false
status: running
heap_size: 987
stack_size: 27
reductions: 5046
neighbours:

12:22:50.308 [error] Failed to establish SSL connection. Is the certificate signed for :prod mode?

MAM query archive response containing empty 'to' field

MongooseIM 3.3.0
Smack 4.3.4

Referring to the request and response below, kindly note the empty 'to' field in the response. I suspect this is causing Smack to throw an exception of 'Not a valid combination of localpart, domainpart and resource'.

If I refer to https://xmpp.org/extensions/xep-0313.html, I do not see an empty 'to' field.

Please advise me on how to resolve this.

Many thanks in advance.

Request

<iq to='[email protected]' id='DUgMm-240' type='set'>
  <query xmlns='urn:xmpp:mam:1' queryid='a75f5d75-aac5-4625-9a77-e54ea605f7a0'>
    <x xmlns='jabber:x:data' type='submit'>
      <field var='FORM_TYPE' type='hidden'>
        <value>urn:xmpp:mam:1</value>
      </field>
      <field var='start'>
        <value>2019-12-01T09:49:40.000+00:00</value>
      </field>
    </x>
    <set xmlns='http://jabber.org/protocol/rsm'>
      <max>5</max>
    </set>
  </query>
</iq>

Response

<message from='[email protected]' to='[email protected]/mobile' id='56d97cef-131f-4265-9a59-f32dbaf89790'>
  <result queryid='a75f5d75-aac5-4625-9a77-e54ea605f7a0' xmlns='urn:xmpp:mam:1' id='B651C6UHK5G1'>
    <forwarded xmlns='urn:xmpp:forward:0'>
      <delay xmlns='urn:xmpp:delay' stamp='2019-12-01T09:49:40Z' from='[email protected]/[email protected]'></delay>
      <message from='[email protected]/[email protected]' to='' xmlns='jabber:client' id='e81d40f4-c86d-474f-a9e7-e06cd8cb3857' type='groupchat'>
        <body>46</body>
        <item-type xmlns='custom.example.com' type='1' mime-type=''/>
        <markable xmlns='urn:xmpp:chat-markers:0'/>
      </message>
    </forwarded>
  </result>
</message>

Feature request: support multiple apns certificates

Feature request: support multiple apns certificates.

Using the named pool, please make the possibility to configure the apns service to be able to send PUSH notifications using multiple certificates by configuring something like this:

 {apns,
      [{dev1,
           [{endpoint,{system,string,<<"PUSH_APNS_DEV1_ENDPOINT">>,nil}},
            {cert,
                {system,string,<<"PUSH_APNS_DEV1_CERT">>,
                    <<"priv/apns/dev1_cert.pem">>}},
            {key,
                {system,string,<<"PUSH_APNS_DEV1_KEY">>,
                    <<"priv/apns/dev1_key.pem">>}},
            {mode,dev},
            {use_2197,{system,boolean,<<"PUSH_APNS_DEV1_USE_2197">>,false}},
            {pool_size,{system,integer,<<"PUSH_APNS_DEV1_POOL_SIZE">>,5}},
            {default_topic,
                {system,string,<<"PUSH_APNS_DEV1_DEFAULT_TOPIC">>,nil}}]},
       {prod1,
           [{endpoint,{system,string,<<"PUSH_APNS_PROD1_ENDPOINT">>,nil}},
            {cert,
                {system,string,<<"PUSH_APNS_PROD1_CERT">>,
                    <<"priv/apns/prod1_cert.pem">>}},
            {key,
                {system,string,<<"PUSH_APNS_PROD1_KEY">>,
                    <<"priv/apns/prod1_key.pem">>}},
            {mode,prod},
            {use_2197,
                {system,boolean,<<"PUSH_APNS_PROD1_USE_2197">>,false}},
            {pool_size,{system,integer,<<"PUSH_APNS_PROD1_POOL_SIZE">>,5}},
            {default_topic,
                {system,string,<<"PUSH_APNS_PROD1_DEFAULT_TOPIC">>,
                    nil}}]},
      {dev2,
           [{endpoint,{system,string,<<"PUSH_APNS_DEV2_ENDPOINT">>,nil}},
            {cert,
                {system,string,<<"PUSH_APNS_DEV2_CERT">>,
                    <<"priv/apns/dev2_cert.pem">>}},
            {key,
                {system,string,<<"PUSH_APNS_DEV2_KEY">>,
                    <<"priv/apns/dev2_key.pem">>}},
            {mode,dev},
            {use_2197,{system,boolean,<<"PUSH_APNS_DEV2_USE_2197">>,false}},
            {pool_size,{system,integer,<<"PUSH_APNS_DEV2_POOL_SIZE">>,5}},
            {default_topic,
                {system,string,<<"PUSH_APNS_DEV2_DEFAULT_TOPIC">>,nil}}]},
       {prod2,
           [{endpoint,{system,string,<<"PUSH_APNS_PROD2_ENDPOINT">>,nil}},
            {cert,
                {system,string,<<"PUSH_APNS_PROD2_CERT">>,
                    <<"priv/apns/prod2_cert.pem">>}},
            {key,
                {system,string,<<"PUSH_APNS_PROD2_KEY">>,
                    <<"priv/apns/prod2_key.pem">>}},
            {mode,prod},
            {use_2197,
                {system,boolean,<<"PUSH_APNS_PROD2_USE_2197">>,false}},
            {pool_size,{system,integer,<<"PUSH_APNS_PROD2_POOL_SIZE">>,5}},
            {default_topic,
                {system,string,<<"PUSH_APNS_PROD2_DEFAULT_TOPIC">>,
                    nil}}]}]}]},

To be able to select the correct pool, one should be able to set the pool name as "mode" in the json snet via REST API
like: "mode":"prod1" or "mode":"dev2" etc.

mongoosepush start error

HI
i am trying to start mongoosepush with below docker command.
docker run -p 8443:8443 -v pwd/priv:/opt/mongoosepush/priv
-e PUSH_FCM_APP_KEY="my_key"
-e PUSH_HTTPS_CERTFILE="/opt/mongoosepush/priv/ssl/rest_cert.pem"
-e PUSH_HTTPS_KEYFILE="/opt/mongoosepush/priv/ssl/rest_key.pem"
-it --rm mongooseim/mongoose-push:latest

But i am getting this error. please help to resolve this.

2019-12-15T00:22:14.228 [error] pid=<0.1792.0> Required authentication elements are missing. Got:
key=, team=, p8_file=/opt/app/lib/mongoose_push-2.0.0-beta.2/priv/apns/token.p8

2019-12-15T00:22:14.228 [error] pid=<0.1792.0> Required authentication elements are missing. Got:
key=, team=, p8_file=/opt/app/lib/mongoose_push-2.0.0-beta.2/priv/apns/token.p8

=SUPERVISOR REPORT==== 15-Dec-2019::00:22:14.244279 ===
supervisor: {local,gr_param_sup}
errorContext: child_terminated
reason: killed
offender: [{pid,<0.1556.0>},
{id,gr_lager_default_tracer_params},
{mfargs,{gr_param,start_link,[gr_lager_default_tracer_params]}},
{restart_type,transient},
{shutdown,brutal_kill},
{child_type,worker}]
{"Kernel pid terminated",application_controller,"{application_start_failure,mongoose_push,{{shutdown,{failed_to_start_child,apns_supervisor,{bad_return,{'Elixir.MongoosePush.Service.APNS.Supervisor',init,{stop,bad_auth}}}}},{'Elixir.MongoosePush.Application',start,[normal,[]]}}}"}
Kernel pid terminated (application_controller) ({application_start_failure,mongoose_push,{{shutdown,{failed_to_start_child,apns_supervisor,{bad_return,{'Elixir.MongoosePush.Service.APNS.Supervisor',in

Docker fail to find key file. although it is there.

[root@ivr ssl]# ls -l /opt/app/priv/ssl/
total 12
-rw-r--r--. 1 root root 6641 Jun 23 12:07 server.crt
-rw-r--r--. 1 root root 1679 Jun 23 12:07 server.key

[root@ivr ssl]# docker run -v /usr/lib/mongooseim/priv/ssl:/opt/app/priv -e PUSH_FCM_APP_KEY="AAAA5y_R5rA:APA91bGUmR7xsghMfgpudP64lt1JdJ2XBqxYLijGerdIaLI7Z4ZXqYfVRYjqKIUm6opCvEvS5H8m_KEtr9J_VRJlX9Ge7U-U5S2dasjjx0LtxQfjCSddhwxYXgR4goX8fBStIdoYikYM" -e PUSH_HTTPS_CERTFILE="/opt/app/priv/ssl/server.crt" -e PUSH_HTTPS_KEYFILE="/opt/app/priv/ssl/server.key" -it --rm mongooseim/mongoose-push:latest

12:12:09.270 [info] Setup running ...

12:12:09.273 [info] Directories verified. Res = :ok

12:12:09.273 [info] Setup finished processing hooks (Mode=:normal)...

12:12:09.279 [info] Starting Elixir.MongoosePush.Router with Cowboy on https://0.0.0.0:8443

12:12:09.281 [info] Application maru exited: exited in: Maru.start(:normal, [])
** (EXIT) an exception was raised:
** (ArgumentError) could not start Cowboy adapter, the file /opt/app/priv/ssl/server.key required by SSL's :keyfile either does not exist, or the application does not have permission to access it
(plug) lib/plug/adapters/cowboy.ex:245: Plug.Adapters.Cowboy.fail/1
(plug) lib/plug/adapters/cowboy.ex:222: Plug.Adapters.Cowboy.put_ssl_file/3
(elixir) lib/enum.ex:1755: Enum."-reduce/3-lists^foldl/2-0-"/3
(plug) lib/plug/adapters/cowboy.ex:167: Plug.Adapters.Cowboy.normalize_cowboy_options/2
(plug) lib/plug/adapters/cowboy.ex:49: Plug.Adapters.Cowboy.args/4
(plug) lib/plug/adapters/cowboy.ex:137: Plug.Adapters.Cowboy.child_spec/4
(maru) lib/maru.ex:32: anonymous fn/4 in Maru.start/2
(elixir) lib/enum.ex:1755: Enum."-reduce/3-lists^foldl/2-0-"/3
12:12:09.240 [error] Supervisor 'Elixir.Logger.Supervisor' had child 'Elixir.Logger.ErrorHandler' started with 'Elixir.Logger.Watcher':watcher(error_logger, 'Elixir.Logger.ErrorHandler', {true,false,500}) at <0.1109.0> exit with reason normal in context child_terminated
12:12:09.267 [info] Application lager started on node '[email protected]'
12:12:09.267 [info] Application asn1 started on node '[email protected]'
12:12:09.267 [info] Application crypto started on node '[email protected]'
12:12:09.267 [info] Application public_key started on node '[email protected]'
12:12:09.270 [info] Application ssl started on node '[email protected]'
12:12:09.270 [info] Application chatterbox started on node '[email protected]'
12:12:09.270 [info] Application metrics started on node '[email protected]'
12:12:09.270 [info] Application ssl_verify_fun started on node '[email protected]'
12:12:09.270 [info] Application certifi started on node '[email protected]'
12:12:09.270 [info] Application mimerl started on node '[email protected]'
12:12:09.270 [info] Application idna started on node '[email protected]'
12:12:09.270 [info] Application hackney started on node '[email protected]'
12:12:09.270 [info] Application httpoison started on node '[email protected]'
12:12:09.270 [info] Application pigeon started on node '[email protected]'
12:12:09.270 [info] Application pobox started on node '[email protected]'
12:12:09.270 [info] Setup running ...
12:12:09.273 [info] Directories verified. Res = ok
12:12:09.274 [info] Setup finished processing hooks (Mode=normal)...
12:12:09.274 [info] Application setup started on node '[email protected]'
12:12:09.276 [info] Starting reporters with []
12:12:09.278 [info] Application exometer_core started on node '[email protected]'
12:12:09.278 [info] Application elixometer started on node '[email protected]'
12:12:09.278 [info] Application exometer started on node '[email protected]'
12:12:09.278 [info] Application cowlib started on node '[email protected]'
12:12:09.278 [info] Application ranch started on node '[email protected]'
{"Kernel pid terminated",application_controller,"{application_start_failure,maru,{bad_return,{{'Elixir.Maru',start,[normal,[]]},{'EXIT',{#{'exception' => true,'struct' => 'Elixir.ArgumentError',message => <<"could not start Cowboy adapter, the file /opt/app/priv/ssl/server.key required by SSL's :keyfile either does not exist, or the application does not have permission to access it">>},[{'Elixir.Plug.Adapters.Cowboy',fail,1,[{file,"lib/plug/adapters/cowboy.ex"},{line,245}]},{'Elixir.Plug.Adapters.Cowboy',put_ssl_file,3,[{file,"lib/plug/adapters/cowboy.ex"},{line,222}]},{'Elixir.Enum','-reduce/3-lists^foldl/2-0-',3,[{file,"lib/enum.ex"},{line,1755}]},{'Elixir.Plug.Adapters.Cowboy',normalize_cowboy_options,2,[{file,"lib/plug/adapters/cowboy.ex"},{line,167}]},{'Elixir.Plug.Adapters.Cowboy',args,4,[{file,"lib/plug/adapters/cowboy.ex"},{line,49}]},{'Elixir.Plug.Adapters.Cowboy',child_spec,4,[{file,"lib/plug/adapters/cowboy.ex"},{line,137}]},{'Elixir.Maru','-start/2-fun-0-',4,[{file,"lib/maru.ex"},{line,32}]},{'Elixir.Enum','-reduce/3-lists^foldl/2-0-',3,[{file,"lib/enum.ex"},{line,1755}]}]}}}}}"}
Kernel pid terminated (application_controller) ({application_start_failure,maru,{bad_return,{{'Elixir.Maru',start,[normal,[]]},{'EXIT',{#{'exception' => true,'struct' => 'Elixir.ArgumentError'

Crash dump is being written to: erl_crash.dump...done

Shutting down..
Node is not running!

The specified device token was bad. Verify that the request contains a valid token and that the token matches the environment.

14:11:36.155 [info] Setup running ...

14:11:36.155 [info] Directories verified. Res = :ok

14:11:36.155 [info] Setup finished processing hooks (Mode=:normal)...

14:11:36.156 [info] Starting Elixir.MongoosePush.Router with Cowboy on https://127.0.0.1:303
14:11:36.149 [error] Supervisor 'Elixir.Logger.Supervisor' had child 'Elixir.Logger.ErrorHandler' started with 'Elixir.Logger.Watcher':start_link({error_logger,'Elixir.Logger.ErrorHandler',{true,false,500}}) at <0.1159.0> exit with reason normal in context child_terminated
14:11:36.154 [info] Application lager started on node '[email protected]'
14:11:36.154 [info] Application asn1 started on node '[email protected]'
14:11:36.154 [info] Application crypto started on node '[email protected]'
14:11:36.154 [info] Application public_key started on node '[email protected]'
14:11:36.154 [info] Application ssl started on node '[email protected]'
14:11:36.154 [info] Application chatterbox started on node '[email protected]'
14:11:36.154 [info] Application metrics started on node '[email protected]'
14:11:36.154 [info] Application ssl_verify_fun started on node '[email protected]'
14:11:36.154 [info] Application certifi started on node '[email protected]'
14:11:36.155 [info] Application mimerl started on node '[email protected]'
14:11:36.155 [info] Application unicode_util_compat started on node '[email protected]'
14:11:36.155 [info] Application idna started on node '[email protected]'
14:11:36.155 [info] Application hackney started on node '[email protected]'
14:11:36.155 [info] Application httpoison started on node '[email protected]'
14:11:36.155 [info] Application pigeon started on node '[email protected]'
14:11:36.155 [info] Application pobox started on node '[email protected]'
14:11:36.155 [info] Setup running ...
14:11:36.155 [info] Directories verified. Res = ok
14:11:36.155 [info] Setup finished processing hooks (Mode=normal)...
14:11:36.155 [info] Application setup started on node '[email protected]'
14:11:36.156 [info] Starting reporters with []
14:11:36.156 [info] Application exometer_core started on node '[email protected]'
14:11:36.156 [info] Application elixometer started on node '[email protected]'
14:11:36.156 [info] Application exometer started on node '[email protected]'
14:11:36.156 [info] Application mime started on node '[email protected]'
14:11:36.156 [info] Application plug started on node '[email protected]'

14:11:36.174 [info] Starting FCM pool with API key AAAAC3sFy48:APA91bEHZGVesP4TycnyY5UhLC9jk2Ilo9CY4RISfOL8S7CvPcQCL4Wv-dkLuopIzF7Xmn9_A1kp7WYVJW1PDH35Ju0LD_EdzHzcwvV1bhOuOEAGCB22bJ-WEmBndr154HwfoPGIYmoV

14:11:36.175 [warn] Unable to extract APNS topic from the dev certificate due to: :no_extension

14:11:36.175 [debug] Using user-defined default APNS topic: com.banksalaam.waafi
Interactive Elixir (1.6.0-dev) - press Ctrl+C to exit (type h() ENTER for help)
iex([email protected])1> 14:11:36.649 [debug] Lager installed handler lager_backend_throttle into lager_event
14:11:37.008 [warning] lager_error_logger_h dropped 103 messages in the last second that exceeded the limit of 50 messages/sec

14:11:54.127 [debug] POST /v2/notification/e4a89d2f3f7f3196d5869a33454e22b3821b6fbd51ebf6446c627a5fd5a992e8

14:11:54.127 [debug] POST /v2/notification/e4a89d2f3f7f3196d5869a33454e22b3821b6fbd51ebf6446c627a5fd5a992e8

14:11:54.127 [debug] POST /v2/notification/e4a89d2f3f7f3196d5869a33454e22b3821b6fbd51ebf6446c627a5fd5a992e8

14:11:54.127 [info] Reconnecting to push service provider before request

14:11:54.127 [info] Reconnecting to push service provider before request
14:11:54.127 [debug] Supervisor inet_gethost_native_sup started undefined at pid <0.1442.0>
14:11:54.127 [debug] Supervisor kernel_safe_sup started inet_gethost_native:start_link() at pid <0.1441.0>

14:11:54.129 [debug] POST /v2/notification/e4a89d2f3f7f3196d5869a33454e22b3821b6fbd51ebf6446c627a5fd5a992e8
14:11:54.321 [debug] Spawning ack timeout alarm clock: <0.1440.0> + {#Ref<0.0.1.516>,{settings,4096,1,unlimited,65535,16384,unlimited}}
14:11:54.321 [debug] Spawning ack timeout alarm clock: <0.1439.0> + {#Ref<0.0.8.508>,{settings,4096,1,unlimited,65535,16384,unlimited}}
14:11:54.322 [debug] NewStream {active_stream,1,<0.1447.0>,<0.1408.0>,65535,65535,undefined,false}
14:11:54.322 [debug] [client] added stream #1 to {stream_set,client,{peer_subset,unlimited,1,0,3,[{active_stream,1,<0.1447.0>,<0.1408.0>,65535,65535,undefined,false}]},{peer_subset,unlimited,0,0,2,[]}}
14:11:54.322 [debug] [client] Received SETTINGS
14:11:54.322 [debug] [client] IWS undefined
14:11:54.322 [debug] [client] Sent Settings ACK
14:11:54.322 [debug] [client] {send headers, 1, [{<<":method">>,<<"POST">>},{<<":path">>,<<"/3/device/e4a89d2f3f7f3196d5869a33454e22b3821b6fbd51ebf6446c627a5fd5a992e8">>},{<<":scheme">>,<<"https">>},{<<":authority">>,<<"api.push.apple.com">>},{<<"content-length">>,<<"95">>},{<<"content-type">>,<<"application/json">>},{<<"accept">>,<<"application/json">>},{<<"apns-topic">>,<<"com.banksalaam.waafi">>}]}
14:11:54.323 [debug] [client] Send Body Stream 1
14:11:54.323 [debug] NewStream {active_stream,3,<0.1448.0>,<0.1408.0>,65535,65535,undefined,false}
14:11:54.323 [debug] [client] added stream #3 to {stream_set,client,{peer_subset,1000,2,0,5,[{active_stream,1,<0.1447.0>,<0.1408.0>,65440,65535,done,true},{active_stream,3,<0.1448.0>,<0.1408.0>,65535,65535,undefined,false}]},{peer_subset,unlimited,0,0,2,[]}}
14:11:54.323 [debug] [client] {send headers, 3, [{<<":method">>,<<"POST">>},{<<":path">>,<<"/3/device/e4a89d2f3f7f3196d5869a33454e22b3821b6fbd51ebf6446c627a5fd5a992e8">>},{<<":scheme">>,<<"https">>},{<<":authority">>,<<"api.push.apple.com">>},{<<"content-length">>,<<"95">>},{<<"content-type">>,<<"application/json">>},{<<"accept">>,<<"application/json">>},{<<"apns-topic">>,<<"nil">>}]}
14:11:54.323 [debug] [client] Send Body Stream 3
14:11:54.323 [debug] NewStream {active_stream,1,<0.1449.0>,<0.1406.0>,65535,65535,undefined,false}
14:11:54.323 [debug] [client] added stream #1 to {stream_set,client,{peer_subset,unlimited,1,0,3,[{active_stream,1,<0.1449.0>,<0.1406.0>,65535,65535,undefined,false}]},{peer_subset,unlimited,0,0,2,[]}}
14:11:54.323 [debug] [client] Received SETTINGS
14:11:54.323 [debug] [client] IWS undefined
14:11:54.323 [debug] [client] Sent Settings ACK
14:11:54.323 [debug] [client] {send headers, 1, [{<<":method">>,<<"POST">>},{<<":path">>,<<"/3/device/e4a89d2f3f7f3196d5869a33454e22b3821b6fbd51ebf6446c627a5fd5a992e8">>},{<<":scheme">>,<<"https">>},{<<":authority">>,<<"api.push.apple.com">>},{<<"content-length">>,<<"95">>},{<<"content-type">>,<<"application/json">>},{<<"accept">>,<<"application/json">>},{<<"apns-topic">>,<<"nil">>}]}
14:11:54.323 [debug] [client] Send Body Stream 1
14:11:54.324 [debug] NewStream {active_stream,3,<0.1450.0>,<0.1406.0>,65535,65535,undefined,false}
14:11:54.324 [debug] [client] added stream #3 to {stream_set,client,{peer_subset,1000,2,0,5,[{active_stream,1,<0.1449.0>,<0.1406.0>,65440,65535,done,true},{active_stream,3,<0.1450.0>,<0.1406.0>,65535,65535,undefined,false}]},{peer_subset,unlimited,0,0,2,[]}}
14:11:54.324 [debug] [client] {send headers, 3, [{<<":method">>,<<"POST">>},{<<":path">>,<<"/3/device/e4a89d2f3f7f3196d5869a33454e22b3821b6fbd51ebf6446c627a5fd5a992e8">>},{<<":scheme">>,<<"https">>},{<<":authority">>,<<"api.push.apple.com">>},{<<"content-length">>,<<"95">>},{<<"content-type">>,<<"application/json">>},{<<"accept">>,<<"application/json">>},{<<"apns-topic">>,<<"nil">>}]}
14:11:54.324 [debug] [client] Send Body Stream 3
14:11:54.427 [debug] [client][connected] {frame, "[Frame Header: L:0, T:"SETTINGS", F:1, StrId:0] | []"}
14:11:54.427 [debug] [client][connected] {frame, "[Frame Header: L:0, T:"SETTINGS", F:1, StrId:0] | []"}
14:11:54.427 [debug] [client] Received SETTINGS ACK
14:11:54.427 [debug] [client] Received SETTINGS ACK
14:11:54.427 [debug] [client][connected] {frame, "[Frame Header: L:30, T:"SETTINGS", F:0, StrId:0] | [{header_table_size,4096},\n {max_concurrent_streams,1000},\n {initial_window_size,65535},\n {max_frame_size,16384},\n {max_header_list_size,8000}]"}
14:11:54.427 [debug] [client][connected] {frame, "[Frame Header: L:30, T:"SETTINGS", F:0, StrId:0] | [{header_table_size,4096},\n {max_concurrent_streams,1000},\n {initial_window_size,65535},\n {max_frame_size,16384},\n {max_header_list_size,8000}]"}
14:11:54.427 [debug] [client] Received SETTINGS
14:11:54.427 [debug] [client] Received SETTINGS
14:11:54.427 [debug] old IWS: 65535 new IWS: 65535
14:11:54.427 [debug] old IWS: 65535 new IWS: 65535
14:11:54.427 [debug] [client] Sent Settings ACK
14:11:54.427 [debug] [client] Sent Settings ACK
14:11:54.427 [debug] [client][connected] {frame, "[Frame Header: L:37, T:"HEADERS", F:4, StrId:1] | [Headers: {headers,undefined,\n <<140,64,133,29,117,33,99,73,156,133,156,32,113,204,15,172,\n 38,175,194,181,215,66,250,208,134,252,43,58,23,92,132,23,\n 112,178,200,174,255>>}]"}
14:11:54.427 [debug] [client] Received HEADERS Frame for Stream 1
14:11:54.427 [debug] [client][connected] {frame, "[Frame Header: L:37, T:"HEADERS", F:4, StrId:1] | [Headers: {headers,undefined,\n <<140,64,133,29,117,33,99,73,156,188,229,208,179,129,203,\n 203,54,237,241,44,245,240,190,182,7,27,117,102,153,11,32,\n 106,232,91,125,182,127>>}]"}
14:11:54.427 [debug] [client] Received HEADERS Frame for Stream 1
14:11:54.427 [debug] read_binary L: 27, actually: 27
14:11:54.427 [debug] read_binary L: 27, actually: 27
14:11:54.427 [debug] [client][connected] {frame, "[Frame Header: L:27, T:"DATA", F:1, StrId:1] | [Data: {data: <<"{\"reason\":\"BadDeviceToken\"}">> ...}]"}
14:11:54.427 [debug] [client][connected] {frame, "[Frame Header: L:27, T:"DATA", F:1, StrId:1] | [Data: {data: <<"{\"reason\":\"BadDeviceToken\"}">> ...}]"}
14:11:54.427 [debug] [client] Received DATA Frame for Stream 1
14:11:54.427 [debug] [client] Received DATA Frame for Stream 1
14:11:54.427 [info] [client] Stream 1 WindowUpdate 27
14:11:54.427 [info] [client] Stream 1 WindowUpdate 27
14:11:54.427 [debug] [client][connected] {frame, "[Frame Header: L:32, T:"HEADERS", F:4, StrId:3] | [Headers: {headers,undefined,\n <<140,31,47,156,113,235,237,181,117,156,43,62,253,214,214,\n 125,172,55,150,111,0,94,89,247,0,232,128,39,25,115,5,223>>}]"}
14:11:54.427 [debug] [client][connected] {frame, "[Frame Header: L:32, T:"HEADERS", F:4, StrId:3] | [Headers: {headers,undefined,\n <<140,31,47,156,188,203,112,185,11,225,88,13,94,105,103,\n 222,189,117,102,238,187,121,96,190,203,247,240,133,151,\n 128,248,127>>}]"}
14:11:54.427 [debug] [client] Received HEADERS Frame for Stream 3

14:11:54.428 [error] Error code 400 (:bad_device_token): The specified device token was bad. Verify that the request contains a valid token and
that the token matches the environment.

14:11:54.427 [debug] [client] Received HEADERS Frame for Stream 3

14:11:54.428 [warn] Unable to complete push request due to bad_device_token

14:11:54.428 [error] Error code 400 (:bad_device_token): The specified device token was bad. Verify that the request contains a valid token and
that the token matches the environment.

14:11:54.428 [debug] Sent 500 in 300ms

14:11:54.428 [warn] Unable to complete push request due to bad_device_token

14:11:54.428 [debug] Sent 500 in 300ms
14:11:54.427 [debug] read_binary L: 27, actually: 27

14:11:54.428 [error] Error code 400 (:bad_device_token): The specified device token was bad. Verify that the request contains a valid token and
that the token matches the environment.

14:11:54.428 [warn] Unable to complete push request due to bad_device_token

14:11:54.428 [debug] Sent 500 in 301ms

14:11:54.428 [error] Error code 400 (:bad_device_token): The specified device token was bad. Verify that the request contains a valid token and
that the token matches the environment.

14:11:54.427 [debug] read_binary L: 27, actually: 27

14:11:54.428 [warn] Unable to complete push request due to bad_device_token

14:11:54.428 [debug] Sent 500 in 298ms
14:11:54.428 [debug] [client][connected] {frame, "[Frame Header: L:27, T:"DATA", F:1, StrId:3] | [Data: {data: <<"{\"reason\":\"BadDeviceToken\"}">> ...}]"}
14:11:54.428 [debug] [client][connected] {frame, "[Frame Header: L:27, T:"DATA", F:1, StrId:3] | [Data: {data: <<"{\"reason\":\"BadDeviceToken\"}">> ...}]"}
14:11:54.428 [debug] [client] Received DATA Frame for Stream 3
14:11:54.428 [debug] [client] Received DATA Frame for Stream 3
14:11:54.428 [info] [client] Stream 3 WindowUpdate 27
14:11:54.428 [info] [client] Stream 3 WindowUpdate 27
14:11:54.428 [debug] _Other = {false,false}
14:11:54.428 [debug] _Other = {false,false}
14:11:54.428 [debug] _Other = {false,false}

docker run not working

I am trying to configure mod_push for mongooseIM server. I got some success but when I run docker its giving error. I am following this doc: https://mongooseim.readthedocs.io/en/latest/user-guide/Push-notifications/

My command looks like this :

docker run -v /home/ubuntu/MongooseIM/priv:/opt/app/priv -e PUSH_FCM_APP_KEY="AAAA5y_R5rA:APA91bGUmR7xsghMfgpudP64lt1JdJ2XBqxYLijGerdIaLI7Z4ZXqYfVRYjqKIUm6opCvEvS5H8m_KEtr9J_VRJlX9Ge7U-U5S2dasjjx0LtxQfjCSddhwxYXgR4goX8fBStIdoYikYM" -e PUSH_HTTPS_CERTFILE="/opt/app/priv/ssl/server.pem" -e PUSH_HTTPS_KEYFILE="/opt/app/priv/ssl/server.key" -it --rm mongooseim/mongoose-push:latest
And I get error :

{"Kernel pid terminated",application_controller,"{application_start_failure,maru,{bad_return,{{'Elixir.Maru',start,[normal,[]]},{'EXIT',{#{'exception' => true,'struct' => 'Elixir.ArgumentError',message => <<"could not start Cowboy adapter, the file /opt/app/priv/ssl/server.key required by SSL's :keyfile either does not exist, or the application does not have permission to access it">>},[{'Elixir.Plug.Adapters.Cowboy',fail,1,[{file,"lib/plug/adapters/cowboy.ex"},{line,245}]},{'Elixir.Plug.Adapters.Cowboy',put_ssl_file,3,[{file,"lib/plug/adapters/cowboy.ex"},{line,222}]},{'Elixir.Enum','-reduce/3-lists^foldl/2-0-',3,[{file,"lib/enum.ex"},{line,1755}]},{'Elixir.Plug.Adapters.Cowboy',normalize_cowboy_options,2,[{file,"lib/plug/adapters/cowboy.ex"},{line,167}]},{'Elixir.Plug.Adapters.Cowboy',args,4,[{file,"lib/plug/adapters/cowboy.ex"},{line,49}]},{'Elixir.Plug.Adapters.Cowboy',child_spec,4,[{file,"lib/plug/adapters/cowboy.ex"},{line,137}]},{'Elixir.Maru','-start/2-fun-0-',4,[{file,"lib/maru.ex"},{line,32}]},{'Elixir.Enum','-reduce/3-lists^foldl/2-0-',3,[{file,"lib/enum.ex"},{line,1755}]}]}}}}}"} Kernel pid terminated (application_controller) ({application_start_failure,maru,{bad_return,{{'Elixir.Maru',start,[normal,[]]},{'EXIT',{#{'exception' => true,'struct' => 'Elixir.ArgumentError'

I have placed ssl in /opt/app/priv/ssl but still its not working.

MngoosePush docker run crashes

I build docker from source using
sudo MIX_ENV=prod mix do deps.get, certs.dev, docker.build, docker.release
and when I run docker with
command docker run -it --rm mongoose_push:release foreground
I am getting following error .
I also tried using docker image from DockerHub same error always whether I enable apns or fcm.
I have no experience in erlang or elixer , I need xmpp server with Push notification , so any help will be appreciaed

Os Ubuntu 18.04

error

=INFO REPORT==== 2-Nov-2018::11:24:49 ===
msg: "Starting reporters with []\n"
options: []
11:24:49.531 [error] Supervisor 'Elixir.Logger.Supervisor' had child 'Elixir.Logger.ErrorHandler' started with 'Elixir.Logger.Watcher':start_link({error_logger,'Elixir.Logger.ErrorHandler',{false,false,500}}) at <0.1201.0> exit with reason normal in context child_terminated
11:24:49.548 [info] Application lager started on node '[email protected]'
11:24:49.550 [info] Application elixometer started on node '[email protected]'
11:24:49.551 [info] Application logger_lager_backend started on node '[email protected]'
11:24:49.552 [info] Application mime started on node '[email protected]'
11:24:49.553 [info] Application crypto started on node '[email protected]'
11:24:49.554 [info] Application plug started on node '[email protected]'
11:24:49.555 [info] Application asn1 started on node '[email protected]'
11:24:49.556 [info] Application public_key started on node '[email protected]'
11:24:49.558 [info] Application ssl started on node '[email protected]'
11:24:49.559 [info] Application ranch started on node '[email protected]'
11:24:49.560 [info] Application cowlib started on node '[email protected]'
11:24:49.561 [info] Application cowboy started on node '[email protected]'
11:24:49.562 [info] Starting Elixir.MongoosePush.Router with Cowboy on https://0.0.0.0:8443
11:24:49.578 [info] Starting FCM pool with API key fake_app_key
11:24:49.580 [info] Using APNS certificate '/PL/ML/Krakow/mongoose-push-apns-dev' for 'dev' connection pool
11:24:49.580 [warning] Unable to extract APNS topic from the dev certificate due to: :no_extension
11:24:49.582 [info] Using APNS certificate '/PL/ML/Krakow/mongoose-push-apns-prod' for 'prod' connection pool
11:24:49.583 [warning] Unable to extract APNS topic from the prod certificate due to: :undef
11:24:50.041 [warning] lager_error_logger_h dropped 87 messages in the last second that exceeded the limit of 50 messages/sec
capture

Unable to submit notification ErrorCode 400

I have setup MongooseIm (latest) with MongoosePush (docker image).

During regular one-to-one messaging the notifications work as expected.

But when I create a room light, the hook for sending a notification is called (I assume) and a warning with the following message is printed out

[warning] <0.910.0>@mod_push_service_mongoosepush:http_notification:109 Unable to submit push notification. ErrorCode 400, Payload <<"{\"details\":\"Parsing Param Error: body\"}">>

I am not sure how to debug this message. If you could point me to the right direction I would appreciate it. Thank you.

use `ref` instead of `tag` for git commits

$ MIX_ENV=prod mix do deps.get
* Getting pigeon (https://github.com/rslota/pigeon.git)
remote: Enumerating objects: 839, done.
remote: Total 839 (delta 0), reused 0 (delta 0), pack-reused 839
Receiving objects: 100% (839/839), 201.79 KiB | 0 bytes/s, done.
Resolving deltas: 100% (472/472), done.
warning: found quoted keyword "coveralls" but the quotes are not required. Note that keywords are always atoms, even when quoted. Similar to atoms, keywords made exclusively of Unicode letters, numbers, underscore, and @ do not require quotes
  /opt/MongoosePush/deps/pigeon/mix.exs:15
* Getting chatterbox (https://github.com/joedevivo/chatterbox.git)
remote: Enumerating objects: 2, done.
remote: Counting objects: 100% (2/2), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 2113 (delta 0), reused 2 (delta 0), pack-reused 2111
Receiving objects: 100% (2113/2113), 2.30 MiB | 3.19 MiB/s, done.
Resolving deltas: 100% (1502/1502), done.
* Getting sparrow (https://github.com/esl/sparrow.git)
fatal: reference is not a tree: b41ea2cc9e6c97ff5db784cb49402ec87234295d
** (Mix) Command "git --git-dir=.git checkout --quiet b41ea2cc9e6c97ff5db784cb49402ec87234295d" failed
$

{:sparrow, github: "esl/sparrow", tag: "b41ea2c"},

tag -> ref

Connection timeout when attempting push in prod mode

When running the latest official docker container

A simple check with curl:

curl --insecure --header "Content-Type: application/json" \
  --request POST \
  --data '{"service":"apns","mode":"prod","alert":{"title":"foo","body":"bar"}}' \
  https://localhost:8443/v2/notification/deadbeef

times out with no reply.
console output:

=INFO REPORT==== 10-Jul-2018::17:53:37 ===
    msg: "Starting reporters with []\n"
    options: []
17:53:37.011 [error] Supervisor 'Elixir.Logger.Supervisor' had child 'Elixir.Logger.ErrorHandler' started with 'Elixir.Logger.Watcher':start_link({error_logger,'Elixir.Logger.ErrorHandler',{false,false,500}}) at <0.1201.0> exit with reason normal in context child_terminated
17:53:37.024 [info] Application lager started on node '[email protected]'
17:53:37.025 [info] Application elixometer started on node '[email protected]'
17:53:37.025 [info] Application logger_lager_backend started on node '[email protected]'
17:53:37.025 [info] Application mime started on node '[email protected]'
17:53:37.025 [info] Application crypto started on node '[email protected]'
17:53:37.025 [info] Application plug started on node '[email protected]'
17:53:37.025 [info] Application asn1 started on node '[email protected]'
17:53:37.026 [info] Application public_key started on node '[email protected]'
17:53:37.026 [info] Application ssl started on node '[email protected]'
17:53:37.026 [info] Application ranch started on node '[email protected]'
17:53:37.026 [info] Application cowlib started on node '[email protected]'
17:53:37.027 [info] Application cowboy started on node '[email protected]'
17:53:37.027 [info] Starting Elixir.MongoosePush.Router with Cowboy on https://0.0.0.0:8443
17:53:37.066 [info] Starting FCM pool with API key *REDACTED*
17:53:37.067 [info] Using APNS certificate '/
*REDACTED*/Apple Development IOS Push Services: *REDACTED*' for 'dev' connection pool
17:53:37.068 [warning] Unable to extract APNS topic from the dev certificate due to: :no_extension
17:53:37.074 [info] Using APNS certificate '/
*REDACTED*/Apple Development IOS Push Services: *REDACTED*' for 'prod' connection pool
17:53:37.074 [warning] Unable to extract APNS topic from the prod certificate due to: :no_extension
17:53:38.021 [warning] lager_error_logger_h dropped 87 messages in the last second that exceeded the limit of 50 messages/sec
18:27:36.381 [info] Reconnecting to push service provider before request

The last message gets repeated each time I try it so I suspect that it's some sort of a connection error. It is not reported on the console though.

When using mode: dev we get a reply: {"details":"bad_device_token"} as expected.

( Are you sure changing the original 4XX reply from APNS to a 500 Internal Server Error, which would indicate that something is wrong with the push server and not the request is The Right Thing(TM) to do in the sense of following the HTTP and REST semantics? )

Cannot start latest MongoosePush with APNS only

I am using Elixir 1.9.1 with Erlang 22
after: 689400f committed to master when trying to run:

MIX_ENV=prod mix do deps.get, compile, certs.dev
MIX_ENV=prod mix do distillery.release
export PUSH_FCM_ENABLED=false
export PUSH_APNS_ENABLED=true
export PUSH_LOGLEVEL=debug
export PUSH_APNS_PROD_POOL_SIZE=5
export PUSH_APNS_PROD_DEFAULT_TOPIC=hz_topic
export PUSH_APNS_PROD_CERT=priv/apns/newfile.crt.pem
export PUSH_APNS_PROD_KEY=priv/apns/newfile.key.pem
_build/prod/rel/mongoose_push/bin/mongoose_push console

build everything works as expected but when running a build I get:

$ _build/prod/rel/mongoose_push/bin/mongoose_push console
Erlang/OTP 22 [erts-10.4.4] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe] [dtrace]
2019-09-06T10:08:57.404 [info] pid=<0.1586.0>  [msg: 'Starting reporters with []\n', options: []]
2019-09-06T10:08:57.408 [info] pid=<0.1639.0>  Starting Elixir.MongoosePush.Router with Cowboy on https://127.0.0.1:8443
2019-09-06T10:08:57.433 [info] pid=<0.1779.0>  worker=pools_warden, action=init, result=success
2019-09-06T10:08:57.436 [info] pid=<0.1473.0>  Application mongoose_push exited: MongoosePush.Application.start(:normal, []) returned an error: shutdown: failed to start child: :fcm_pool_supervisor
    ** (EXIT) shutdown: failed to start child: :fcm_sparrow_supervisor
        ** (EXIT) an exception was raised:
            ** (FunctionClauseError) no function clause matching in Sparrow.FCM.V1.Supervisor.init/1
                (sparrow) lib/sparrow/fcm/v1/supervisor.ex:15: Sparrow.FCM.V1.Supervisor.init([])
                (stdlib) supervisor.erl:295: :supervisor.init/1
                (stdlib) gen_server.erl:374: :gen_server.init_it/2
                (stdlib) gen_server.erl:342: :gen_server.init_it/6
                (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
=SUPERVISOR REPORT==== 6-Sep-2019::10:08:57.460678 ===
    supervisor: {local,gr_counter_sup}
    errorContext: child_terminated
    reason: killed
    offender: [{pid,<0.1557.0>},
               {id,gr_lager_default_tracer_counters},
               {mfargs,{gr_counter,start_link,
                                   [gr_lager_default_tracer_counters]}},
               {restart_type,transient},
               {shutdown,brutal_kill},
               {child_type,worker}]
=SUPERVISOR REPORT==== 6-Sep-2019::10:08:57.460678 ===
    supervisor: {local,gr_param_sup}
    errorContext: child_terminated
    reason: killed
    offender: [{pid,<0.1556.0>},
               {id,gr_lager_default_tracer_params},
               {mfargs,{gr_param,start_link,[gr_lager_default_tracer_params]}},
               {restart_type,transient},
               {shutdown,brutal_kill},
               {child_type,worker}]
{"Kernel pid terminated",application_controller,"{application_start_failure,mongoose_push,{{shutdown,{failed_to_start_child,fcm_pool_supervisor,{shutdown,{failed_to_start_child,fcm_sparrow_supervisor,{function_clause,[{'Elixir.Sparrow.FCM.V1.Supervisor',init,[[]],[{file,\"lib/sparrow/fcm/v1/supervisor.ex\"},{line,15}]},{supervisor,init,1,[{file,\"supervisor.erl\"},{line,295}]},{gen_server,init_it,2,[{file,\"gen_server.erl\"},{line,374}]},{gen_server,init_it,6,[{file,\"gen_server.erl\"},{line,342}]},{proc_lib,init_p_do_apply,3,[{file,\"proc_lib.erl\"},{line,249}]}]}}}}},{'Elixir.MongoosePush.Application',start,[normal,[]]}}}"}
Kernel pid terminated (application_controller) ({application_start_failure,mongoose_push,{{shutdown,{failed_to_start_child,fcm_pool_supervisor,{shutdown,{failed_to_start_child,fcm_sparrow_supervisor,{
Crash dump is being written to: erl_crash.dump...done

Unable to communiucate to MongoosePush service due to pool_timeout

Hi , I am running MongoosePush from DockerHub and getting console log as :

$ sudo docker run -p 8443:8443 -v /home/tg-linux/priv:/opt/app/priv/ -e PUSH_FCM_APP_KEY="" -e PUSH_HTTPS_CERTFILE="/opt/app/priv/ssl/server.pem" -e PUSH_HTTPS_KEYFILE="/opt/app/priv/ssl/server.key" -e PUSH_APNS_ENABLED=0 -it --rm mongooseim/mongoose-push:latest

=INFO REPORT==== 20-Dec-2018::06:48:32 ===
msg: "Starting reporters with []\n"
options: []
06:48:32.122 [error] Supervisor 'Elixir.Logger.Supervisor' had child 'Elixir.Logger.ErrorHandler' started with 'Elixir.Logger.Watcher':start_link({error_logger,'Elixir.Logger.ErrorHandler',{false,false,500}}) at <0.1201.0> exit with reason normal in context child_terminated
06:48:32.144 [info] Application lager started on node '[email protected]'
06:48:32.145 [info] Application elixometer started on node '[email protected]'
06:48:32.145 [info] Application logger_lager_backend started on node '[email protected]'
06:48:32.145 [info] Application mime started on node '[email protected]'
06:48:32.145 [info] Application crypto started on node '[email protected]'
06:48:32.153 [info] Application plug started on node '[email protected]'
06:48:32.153 [info] Application asn1 started on node '[email protected]'
06:48:32.153 [info] Application public_key started on node '[email protected]'
06:48:32.154 [info] Application ssl started on node '[email protected]'
06:48:32.154 [info] Application ranch started on node '[email protected]'
06:48:32.154 [info] Application cowlib started on node '[email protected]'
06:48:32.154 [info] Application cowboy started on node '[email protected]'
06:48:32.154 [info] Starting Elixir.MongoosePush.Router with Cowboy on https://0.0.0.0:8443
06:48:32.199 [info] Starting FCM pool with API key
06:48:33.035 [warning] lager_error_logger_h dropped 90 messages in the last second that exceeded the limit of 50 messages/sec

and mongooseim.cfg file:

{outgoing_pools,
[{http, global, mongoose_push_http,
[{strategy, available_worker}],
[{server, "https://localhost:8443"}]}
]
}.
{mod_event_pusher, [
{backends, [
{push, [{wpool, [{workers, 100}]}]}
]}
]},
{mod_pubsub, [
{plugins, [<<"push">>]}
]},
{mod_push_service_mongoosepush, [
{pool_name, mongoose_push_http},
{api_version, "v2"}]}

The issue i am facing is whenever MongooseIM server tries to communicate with MongoosePush service for offline messages, I am getting below log on MongooseIM console and not getting push notification to the android client:

13:31:10.234 [error] Unable to communicate to MongoosePush service due to pool_timeout

Support for FCM APIv1

Recently FCM introduced APIv1 which replaces the legacy API which is currently supported by MongoosePush. We need to add support to the new FCM API. This may be done in two ways:

  1. We drop support for the legacy FCM altogether. This would mean, that anyone that needs it, has to use older release of MongoosePush (0.10.0).
  2. We add support for the new FCM API as an option. This requires more work and also, requires us to make a new API version for MongoosePush (APIv3). Reason for that is that it would be nice if APIv2 would (by default at least) use the legacy FCM to be backwards compatible and still, for new users, use FCM APIv1 by deafult (in MongoosePush APIv3).

a list of options for graphite

Where I can see a list of options for graphite. I want to replace GRAPHITE_OPTIONS with a list of options for graphite. Thanks.

Unable to communicate to MongoosePush service due to {options,{{server_name_indication,"127.0.0.1"}}}

MongoosePush master
MongooseIM master

I am getting the following error on mongoseim when trying to connect to mongoosepush

2017-11-11 00:09:06.727 [debug] <0.560.0>@mod_push:filter_packet:117 Receive packet
    from {jid,<<>>,<<"pubsub.localhost">>,<<>>,<<>>,<<"pubsub.localhost">>,<<>>} 
    to {jid,<<"user1">>,<<"localhost">>,<<>>,<<"user1">>,<<"localhost">>,<<>>}
    packet #{attrs => [{<<"id">>,<<"D4F5C3D1546E6564">>},{<<"type">>,<<"result">>}],element => {xmlel,<<"iq">>,[{<<"id">>,<<"D4F5C3D1546E6564">>},{<<"type">>,<<"result">>}],[{xmlel,<<"pubsub">>,[{<<"xmlns">>,<<"http://jabber.org/protocol/pubsub">>}],[{xmlel,<<"publish">>,[{<<"node">>,<<"iphone">>}],[{xmlel,<<"item">>,[{<<"id">>,<<"5E65C072AEE28">>}],[]}]}]}]},from => <<"pubsub.localhost">>,from_jid => {jid,<<>>,<<"pubsub.localhost">>,<<>>,<<>>,<<"pubsub.localhost">>,<<>>},mongoose_acc => true,name => <<"iq">>,ref => #Ref<0.1187471059.3889692673.78090>,timestamp => {1510,376946,726918},to => <<"user1@localhost">>,to_jid => {jid,<<"user1">>,<<"localhost">>,<<>>,<<"user1">>,<<"localhost">>,<<>>},type => <<"result">>}.
2017-11-11 00:09:06.727 [debug] <0.560.0>@ejabberd_local:do_route:392 local route
        from {jid,<<>>,<<"pubsub.localhost">>,<<>>,<<>>,<<"pubsub.localhost">>,<<>>}
        to {jid,<<"user1">>,<<"localhost">>,<<>>,<<"user1">>,<<"localhost">>,<<>>}
        packet {xmlel,<<"iq">>,[{<<"id">>,<<"D4F5"...>>},{<<"type">>,<<...>>}],[{xmlel,<<...>>,...}]}
2017-11-11 00:09:06.727 [debug] <0.560.0>@ejabberd_sm:do_route:608 session manager
        from {jid,<<>>,<<"pubsub.localhost">>,<<>>,<<>>,<<"pubsub.localhost">>,<<>>}
        to {jid,<<"user1">>,<<"localhost">>,<<>>,<<"user1">>,<<"localhost">>,<<>>}
        packet #{attrs => [{<<"id">>,<<"D4F5C3D1546E"...>>},{<<"type">>,<<"result">>}],element => {xmlel,<<"iq">>,[{<<...>>,...},{...}],[{...}]},from => <<"pubsub.localhost">>,from_jid => {jid,<<>>,<<...>>,...},mongoose_acc => true,name => <<"iq">>,ref => #Ref<0.1187471059.3889692673.78090>,...}
2017-11-11 00:09:06.727 [debug] <0.560.0>@ejabberd_router:route:476 routing done
2017-11-11 00:09:06.730 [error] <0.816.0>@mod_push_service_mongoosepush:http_notification:114 Unable to communicate to MongoosePush service due to {options,{{server_name_indication,"127.0.0.1"}}}

Configs are


{http_connections, [{mongoose_push_http,
    [{server, "https://127.0.0.1:8443"}]
}]}.

{modules,
 [

  {mod_pubsub, [
	{ignore_pep_from_offline, true},
	{last_item_cache, true},
	{max_items_node, 1000},
	{plugins, [<<"push">>]}
  ]},

  {mod_push, [
	{backend, mnesia},
	{wpool, [{workers, 200}]},
	{plugin_module, mod_push_plugin_default}
   ]},

    {mod_caps, []},

   {mod_push_service_mongoosepush, [
      {pool_name, mongoose_push_http},
      {api_version, "v2"}
  ]},

However when I changed to [{server, "https://localhost:8443"}] I do not see the error anymore
But back in Mongoosepush server I do not see anything on the logs.
Built the server locally:

> MIX_ENV=dev mix do deps.get, compile, certs.dev, release
> 
> localhost:MongoosePush gibranrodriguez$ cat config/dev.exs 
> use Mix.Config
> 
> config :exometer_core, report: [reporters: [{:exometer_report_tty, []}]]
> config :elixometer, reporter: :exometer_report_tty,
>      env: Mix.env,
>      metric_prefix: "mongoose_push"
> 
> config :mongoose_push, loglevel: :debug
> 
> config :maru, MongoosePush.Router,
>     versioning: [
>         using: :path
>     ],
>     https: [
>         bind_addr: "127.0.0.1",
>         port: 8443,
>         keyfile: "priv/ssl/rest_key.pem",
>         certfile: "priv/ssl/rest_cert.pem",
>         otp_app: :mongoose_push
>     ]
> 
> config :mongoose_push, fcm: [
>     default: [
>         key: "fake",
>         pool_size: 5,
>         mode: :prod
>     ]
>   ]
> 
> config :mongoose_push, apns: [
>    dev: [
>      endpoint: "api.development.push.apple.com",
>      cert: "priv/apns/apns-dev-cert.pem",
>      key: "priv/apns/apns-dev-key-noenc.pem",
>      mode: :dev,
>      use_2197: true,
>      pool_size: 5
>    ],
>    prod: [
>      endpoint: "api.push.apple.com",
>      cert: "priv/apns/apns-pro-cert.pem",
>      key: "priv/apns/apns-pro-key-noenc.pem",
>      mode: :prod,
>      use_2197: false,
>      pool_size: 5
>    ]
>  ]
> 

Anything I might be doing wrong?

docker not working properly

i have started docker using this command
docker run -e PUSH_FCM_APP_KEY="AIzaSyDmCafdcFrooE2n3P_ya4aQiPpD-9o" -e PUSH_APNS_ENABLED=0 -it -p 8443:8443 --rm mongooseim/mongoose-push:latest

but log says

12:20:11.931 [info] Starting Elixir.MongoosePush.Router with Cowboy on https://0.0.0.0:8443
12:20:11.874 [error] Supervisor 'Elixir.Logger.Supervisor' had child 'Elixir.Logger.ErrorHandler' started with 'Elixir.Logger.Watcher':watcher(error_logger, 'Elixir.Logger.ErrorHandler', {true,false,500}) at <0.1109.0> exit with reason normal in context child_terminated
12:20:11.910 [info] Application lager started on node '[email protected]'
12:20:11.910 [info] Application asn1 started on node '[email protected]'
12:20:11.910 [info] Application crypto started on node '[email protected]'
12:20:11.910 [info] Application public_key started on node '[email protected]'
12:20:11.911 [info] Application ssl started on node '[email protected]'
12:20:11.911 [info] Application chatterbox started on node '[email protected]'
12:20:11.911 [info] Application metrics started on node '[email protected]'
12:20:11.911 [info] Application ssl_verify_fun started on node '[email protected]'
12:20:11.911 [info] Application certifi started on node '[email protected]'
12:20:11.911 [info] Application mimerl started on node '[email protected]'
12:20:11.912 [info] Application idna started on node '[email protected]'
12:20:11.912 [info] Application hackney started on node '[email protected]'
12:20:11.912 [info] Application httpoison started on node '[email protected]'
12:20:11.912 [info] Application pigeon started on node '[email protected]'
12:20:11.912 [info] Application pobox started on node '[email protected]'
12:20:11.913 [info] Setup running ...
12:20:11.922 [info] Directories verified. Res = ok
12:20:11.922 [info] Setup finished processing hooks (Mode=normal)...
12:20:11.922 [info] Application setup started on node '[email protected]'
12:20:11.929 [info] Starting reporters with []
12:20:11.929 [info] Application exometer_core started on node '[email protected]'
12:20:11.930 [info] Application elixometer started on node '[email protected]'
12:20:11.930 [info] Application exometer started on node '[email protected]'
12:20:11.930 [info] Application cowlib started on node '[email protected]'
12:20:11.930 [info] Application ranch started on node '[email protected]'

12:20:12.012 [info] Starting FCM pool with API key _ya4aQiPpD-9o
12:20:12.013 [warning] lager_error_logger_h dropped 93 messages in the last second that exceeded the limit of 50 messages/sec
12:20:12.015 [info] Application mongoose_push started on node '[email protected]'
12:20:12.015 [info] Application iex started on node '[email protected]'
12:20:12.038 [info] Application sasl started on node '[email protected]'

Unable to communicate to MongoosePush

I am running MongooseIM and dockerized Push

My config are:

ejabberd.cfg

%%                    ]}.
%%

{http_connections, [{mongoose_push_http,
    [{server, "https://0.0.0.0:8443"}]
}]}.
{mod_pubsub, [
{ignore_pep_from_offline, true},
{last_item_cache, true},
{max_items_node, 1000},
{plugins, [<<"push">>]}
]},

{mod_push, [
{backend, mnesia},
{wpool, [{workers, 200}]},
{plugin_module, mod_push_plugin_default}
]},

{mod_caps, []},

{mod_push_service_mongoosepush, [
{pool_name, mongoose_push_http},
{api_version, "v2"}
]},

Push


 docker run -v `pwd`/priv:/opt/app/priv   -e PUSH_HTTPS_CERTFILE="/opt/app/priv/ssl/rest_cert.pem"   -e PUSH_HTTPS_KEYFILE="/opt/app/priv/ssl/rest_key.pem"   -it --rm mongooseim/mongoose-push:latest
14:59:49.144 [error] Supervisor 'Elixir.Logger.Supervisor' had child 'Elixir.Logger.ErrorHandler' started with 'Elixir.Logger.Watcher':watcher(error_logger, 'Elixir.Logger.ErrorHandler', {true,false,500}) at <0.1109.0> exit with reason normal in context child_terminated
14:59:49.155 [info] Application lager started on node '[email protected]'
14:59:49.155 [info] Application asn1 started on node '[email protected]'
14:59:49.156 [info] Application crypto started on node '[email protected]'
14:59:49.156 [info] Application public_key started on node '[email protected]'
14:59:49.156 [info] Application ssl started on node '[email protected]'
14:59:49.156 [info] Application chatterbox started on node '[email protected]'
14:59:49.156 [info] Application metrics started on node '[email protected]'
14:59:49.156 [info] Application ssl_verify_fun started on node '[email protected]'
14:59:49.157 [info] Application certifi started on node '[email protected]'
14:59:49.157 [info] Application mimerl started on node '[email protected]'
14:59:49.157 [info] Application idna started on node '[email protected]'
14:59:49.157 [info] Application hackney started on node '[email protected]'
14:59:49.157 [info] Application httpoison started on node '[email protected]'
14:59:49.157 [info] Application pigeon started on node '[email protected]'
14:59:49.157 [info] Application pobox started on node '[email protected]'
14:59:49.158 [info] Setup running ...

14:59:49.158 [info]  Setup running ...


14:59:49.159 [info]  Directories verified. Res = :ok

14:59:49.159 [info] Directories verified. Res = ok

14:59:49.159 [info]  Setup finished processing hooks (Mode=:normal)...

14:59:49.159 [info] Setup finished processing hooks (Mode=normal)...
14:59:49.159 [info] Application setup started on node '[email protected]'
14:59:49.161 [info] Starting reporters with []
14:59:49.161 [info] Application exometer_core started on node '[email protected]'
14:59:49.161 [info] Application elixometer started on node '[email protected]'
14:59:49.161 [info] Application exometer started on node '[email protected]'
14:59:49.162 [info] Application cowlib started on node '[email protected]'
14:59:49.162 [info] Application ranch started on node '[email protected]'

14:59:49.163 [info]  Starting Elixir.MongoosePush.Router with Cowboy on https://0.0.0.0:8443
When I send offline message I get this issue on mongooseIM....
{jid,<<>>,<<...>>,...},mongoose_acc => true,name => <<"iq">>,ref => #Ref<0.0.4.372>,...}
2017-09-08 11:12:52.142 [debug] <0.550.0>@ejabberd_sm:do_route:606 session manager
        from {jid,<<>>,<<"pubsub.localhost">>,<<>>,<<>>,<<"pubsub.localhost">>,<<>>}
        to {jid,<<"user">>,<<"localhost">>,<<>>,<<"user">>,<<"localhost">>,<<>>}
        packet #{attrs => [{<<"id">>,<<"4DB7248A6DF3"...>>},{<<"type">>,<<"result">>}],element => {xmlel,<<"iq">>,[{<<...>>,...},{...}],[{...}]},from => <<"pubsub.localhost">>,from_jid => {jid,<<>>,<<...>>,...},mongoose_acc => true,name => <<"iq">>,ref => #Ref<0.0.4.372>,...}
2017-09-08 11:12:52.142 [debug] <0.550.0>@ejabberd_router:route:476 routing done
2017-09-08 11:12:52.146 [debug] <0.1140.0> Supervisor inet_gethost_native_sup started undefined at pid <0.1141.0>
2017-09-08 11:12:52.146 [debug] <0.35.0> Supervisor kernel_safe_sup started inet_gethost_native:start_link() at pid <0.1140.0>
2017-09-08 11:12:52.157 [error] <0.804.0>@mod_push_service_mongoosepush:http_notification:114 Unable to communicate to MongoosePush service due to econnrefused

Any ideas what can be the issue?

Build fails compiling dependencies

There are multiple (transitive) dependencies to chatterbox, which appears to have warnings as errors set, while using a deprecated erlang API

Erlang/OTP 21 [erts-10.0] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1]
Elixir 1.6.6 (compiled with OTP 19)
Linux *redacted* 4.15.0-23-generic #25-Ubuntu SMP Wed May 23 18:02:16 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

And building as recommended in the README.md

ghard@*redacted*:~/src/MongoosePush$ MIX_ENV=prod mix do deps.get, certs.dev, docker.build, docker.release
*** stuff deleted ***
==> Compiling src/h2_connection.erl failed
src/h2_connection.erl:351: ssl:ssl_accept/2: deprecated; use ssl:handshake/2 instead

==> mongoose_push
** (Mix) Could not compile dependency :chatterbox, "/home/ghard/.mix/rebar3 bare compile --paths "/home/ghard/src/MongoosePush/_build/prod/lib/*/ebin"" command failed. You can recompile this dependency with "mix deps.compile chatterbox", update it with "mix deps.update chatterbox" or clean it with "mix deps.clean chatterbox"

Changing the compile opts for chatterbox will cause it to fail building the next module with a transitive chatterbox dependency. I am not adept enough in mix/elixir to figure out how to pass an exception to the build that would compile all modules matching X with warnings as errors disabled.

Is there an elegant workaround / fix or need I spoof whatever URL chatterbox gets loaded from from locally?

module Goth.Supervisor is not available

2019-10-16T12:37:35.639 [info] pid=<0.1472.0> Application mongoose_push exited: MongoosePush.Application.start(:normal, []) returned an error: shutdown: failed to start child: :fcm_pool_sup
ervisor
** (EXIT) shutdown: failed to start child: :fcm_sparrow_supervisor
** (EXIT) shutdown: failed to start child: Sparrow.FCM.V1.TokenBearer
** (EXIT) an exception was raised:
** (UndefinedFunctionError) function Goth.Supervisor.start_link/0 is undefined (module Goth.Supervisor is not available)
Goth.Supervisor.start_link()
(stdlib) supervisor.erl:379: :supervisor.do_start_child_i/3
(stdlib) supervisor.erl:365: :supervisor.do_start_child/2
(stdlib) supervisor.erl:349: anonymous fn/3 in :supervisor.start_children/2
(stdlib) supervisor.erl:1157: :supervisor.children_map/4
(stdlib) supervisor.erl:315: :supervisor.init_children/2
(stdlib) gen_server.erl:374: :gen_server.init_it/2
(stdlib) gen_server.erl:342: :gen_server.init_it

Docker fail to start with the error of maru

[root@ivr bin]# docker run -v /usr/lib/mongooseim/priv:/opt/app/priv -e PUSH_FCM_APP_KEY="AAAAC3sFy48:APA91bEHZGVesP4TycnyY5345ertegg34grY4RISfOL8S7CvPcQCL4Wv-dkLuopIzF7Xmn9_A1kp7WYVJW1PDH35Ju0LD_EdzHzcwvV1bhOuOEAGCB22bJ-WEmBndr154HwfoPGIYmoV" -e PUSH_HTTPS_CERTFILE="/opt/app/priv/ssl/server.crt" -e PUSH_HTTPS_KEYFILE="/opt/app/priv/ssl/server.key" -e PUSH_HTTPS_BIND_ADDR="stage_chat.ninja.com" -e PUSH_HTTPS_PORT="443" -e PUSH_LOGLEVEL="debug" -e PUSH_FCM_ENABLED="true" -e PUSH_APNS_ENABLED="false" -it --rm mongooseim/mongoose-push:latest

10:31:31.491 [info] Setup running ...

10:31:31.493 [info] Directories verified. Res = :ok

10:31:31.494 [info] Setup finished processing hooks (Mode=:normal)...

10:31:31.502 [info] Application maru exited: exited in: Maru.start(:normal, [])
** (EXIT) an exception was raised:
** (MatchError) no match of right hand side value: {:error, :einval}
(maru) lib/maru.ex:76: Maru.to_ip/1
(maru) lib/maru.ex:58: Maru.endpoint_spec/3
(maru) lib/maru.ex:32: anonymous fn/4 in Maru.start/2
(elixir) lib/enum.ex:1755: Enum."-reduce/3-lists^foldl/2-0-"/3
(maru) lib/maru.ex:30: anonymous fn/2 in Maru.start/2
(elixir) lib/enum.ex:1755: Enum."-reduce/3-lists^foldl/2-0-"/3
(maru) lib/maru.ex:29: Maru.start/2
(kernel) application_master.erl:273: :application_master.start_it_old/4
10:31:31.465 [error] Supervisor 'Elixir.Logger.Supervisor' had child 'Elixir.Logger.ErrorHandler' started with 'Elixir.Logger.Watcher':watcher(error_logger, 'Elixir.Logger.ErrorHandler', {true,false,500}) at <0.1109.0> exit with reason normal in context child_terminated
10:31:31.487 [info] Application lager started on node '[email protected]'
10:31:31.488 [info] Application asn1 started on node '[email protected]'
10:31:31.488 [info] Application crypto started on node '[email protected]'
10:31:31.488 [info] Application public_key started on node '[email protected]'
10:31:31.489 [info] Application ssl started on node '[email protected]'
10:31:31.489 [info] Application chatterbox started on node '[email protected]'
10:31:31.489 [info] Application metrics started on node '[email protected]'
10:31:31.489 [info] Application ssl_verify_fun started on node '[email protected]'
10:31:31.489 [info] Application certifi started on node '[email protected]'
10:31:31.489 [info] Application mimerl started on node '[email protected]'
10:31:31.489 [info] Application idna started on node '[email protected]'
10:31:31.490 [info] Application hackney started on node '[email protected]'
10:31:31.490 [info] Application httpoison started on node '[email protected]'
10:31:31.490 [info] Application pigeon started on node '[email protected]'
10:31:31.491 [info] Application pobox started on node '[email protected]'
10:31:31.491 [info] Setup running ...
10:31:31.493 [info] Directories verified. Res = ok
10:31:31.494 [info] Setup finished processing hooks (Mode=normal)...
10:31:31.494 [info] Application setup started on node '[email protected]'
10:31:31.497 [info] Starting reporters with []
10:31:31.497 [info] Application exometer_core started on node '[email protected]'
10:31:31.498 [info] Application elixometer started on node '[email protected]'
10:31:31.498 [info] Application exometer started on node '[email protected]'
10:31:31.498 [info] Application cowlib started on node '[email protected]'
10:31:31.498 [info] Application ranch started on node '[email protected]'
{"Kernel pid terminated",application_controller,"{application_start_failure,maru,{bad_return,{{'Elixir.Maru',start,[normal,[]]},{'EXIT',{{badmatch,{error,einval}},[{'Elixir.Maru',to_ip,1,[{file,"lib/maru.ex"},{line,76}]},{'Elixir.Maru',endpoint_spec,3,[{file,"lib/maru.ex"},{line,58}]},{'Elixir.Maru','-start/2-fun-0-',4,[{file,"lib/maru.ex"},{line,32}]},{'Elixir.Enum','-reduce/3-lists^foldl/2-0-',3,[{file,"lib/enum.ex"},{line,1755}]},{'Elixir.Maru','-start/2-fun-1-',2,[{file,"lib/maru.ex"},{line,30}]},{'Elixir.Enum','-reduce/3-lists^foldl/2-0-',3,[{file,"lib/enum.ex"},{line,1755}]},{'Elixir.Maru',start,2,[{file,"lib/maru.ex"},{line,29}]},{application_master,start_it_old,4,[{file,"application_master.erl"},{line,273}]}]}}}}}"}
Kernel pid terminated (application_controller) ({application_start_failure,maru,{bad_return,{{'Elixir.Maru',start,[normal,[]]},{'EXIT',{{badmatch,{error,einval}},[{'Elixir.Maru',to_ip,1,[{file,"lib/ma

Crash dump is being written to: erl_crash.dump...done

Shutting down..
Node is not running!

exception_from {'Elixir.MongoosePush',push,2} FunctionClauseError

I am compiled the code in dev mode.

09:03:06.609 [debug] POST /v2/notification/02440bfb8ace5e7769e8c7ac038813beeccd0c56270fa837d23005306691ad78
(<0.1813.0>) call 'Elixir.MongoosePush':push(<<"02440bfb8ace5e7769e8c7ac038813beeccd0c56270fa837d23005306691ad78">>,#{alert =>
#{badge => 1,body => <<"Yu">>,tag => <<"[email protected]">>,
title => <<"[email protected]">>},
mode => prod,service => apns,topic => <<"com.banksalaam.waafi">>})
(<0.1813.0>) exception_from {'Elixir.MongoosePush',push,2} {error,function_clause}

09:03:06.610 [error] %FunctionClauseError{args: nil, arity: 1, clauses: nil, function: :keys, kind: nil, module: Keyword}

09:03:06.610 [debug] Sent 500 in 655µs
(<0.1813.0>) call 'Elixir.MongoosePush':push(<<"02440bfb8ace5e7769e8c7ac038813beeccd0c56270fa837d23005306691ad78">>,#{alert =>
#{badge => 1,body => <<"Yu">>,tag => <<"[email protected]">>,
title => <<"[email protected]">>},
mode => prod,service => apns,topic => <<"com.banksalaam.waafi">>})

09:03:06.615 [debug] POST /v2/notification/02440bfb8ace5e7769e8c7ac038813beeccd0c56270fa837d23005306691ad78
(<0.1813.0>) exception_from {'Elixir.MongoosePush',push,2} {error,function_clause}

09:03:06.616 [error] %FunctionClauseError{args: nil, arity: 1, clauses: nil, function: :keys, kind: nil, module: Keyword}

09:03:06.616 [debug] Sent 500 in 543µs
(<0.1813.0>) call 'Elixir.MongoosePush':push(<<"02440bfb8ace5e7769e8c7ac038813beeccd0c56270fa837d23005306691ad78">>,#{alert =>
#{badge => 1,body => <<"Yu">>,tag => <<"[email protected]">>,
title => <<"[email protected]">>},
mode => prod,service => apns,topic => <<"com.banksalaam.waafi">>})

09:03:06.618 [debug] POST /v2/notification/02440bfb8ace5e7769e8c7ac038813beeccd0c56270fa837d23005306691ad78
(<0.1813.0>) exception_from {'Elixir.MongoosePush',push,2} {error,function_clause}

09:03:06.618 [error] %FunctionClauseError{args: nil, arity: 1, clauses: nil, function: :keys, kind: nil, module: Keyword}

09:03:06.618 [debug] Sent 500 in 414µs

How to change the endpoint correctly?

I have tried both dockerized and build locally with no success:

docker run -p 8443:8443 -v pwd/priv:/opt/app/priv -e PUSH_HTTPS_CERTFILE="/opt/app/priv/ssl/rest_cert.pem" -e PUSH_HTTPS_KEYFILE="/opt/app/priv/ssl/rest_key.pem" -e PUSH_APNS_PROD_CERT="/opt/app/priv/apns/prod.pem" -e PUSH_APNS_PROD_KEY="/opt/app/priv/apns/apns-pro-key-noenc.pem" -e PUSH_APNS_DEV_CERT="/opt/app/priv/apns/dev.pem" -e PUSH_APNS_DEV_KEY="/opt/app/priv/apns/apns-dev-key-noenc.pem" -e PUSH_APNS_DEV_ENDPOINT="gateway.sandbox.push.apple.com" -e PUSH_APNS_PROD_ENDPOINT="gateway.push.apple.com" -it --rm mongooseim/mongoose-push:latest

=SUPERVISOR REPORT==== 12-Sep-2017::13:45:20 ===
     Supervisor: {local,'Elixir.MongoosePush.Supervisor'}
     Context:    child_terminated
     Reason:     {bad_return_value,{stop,{error,invalid_config}}}
     Offender:   [{pid,<0.1352.0>},
                  {id,apns_prod_1},
                  {mfargs,
                      {'Elixir.Pigeon.APNSWorker',start_link,
                          [#{cert => nil,certfile => nil,
                             development_endpoint =>
                                 <<"api.development.push.apple.com">>,
                             key => nil,keyfile => nil,mode => prod,
                             name => apns_prod_1,port => 443,
                             production_endpoint =>
                                 <<"gateway.push.apple.com">>,
                             use_2197 => false}]}},
                  {restart_type,permanent},
                  {shutdown,5000},
                  {child_type,worker}]

13:45:20.073 [error] gen_server apns_prod_1 terminated with reason: bad return value: {stop,{error,invalid_config}}
13:45:20.073 [error] CRASH REPORT Process apns_prod_1 with 0 neighbours exited with reason: bad return value: {stop,{error,invalid_config}} in gen_server:terminate/7 line 812
13:45:20.074 [error] Supervisor 'Elixir.MongoosePush.Supervisor' had child apns_prod_1 started with 'Elixir.Pigeon.APNSWorker':start_link(#{cert => nil,certfile => nil,development_endpoint => <<"api.development.push.apple.com">>,key => nil,...}) at <0.1352.0> exit with reason bad return value: {stop,{error,invalid_config}} in context child_terminated

Also building locally

MIX_ENV=prod mix do docker.build, docker.release

config/dev.exs

config :mongoose_push, apns: [
dev: [
endpoint: "gateway.sandbox.push.apple.com",
cert: "priv/apns/dev.pem",
key: "priv/apns/apns-dev-key-noenc.pem",
mode: :dev,
use_2197: true,
pool_size: 5
],
prod: [
endpoint: "gateway.push.apple.com",
cert: "priv/apns/prod.pem",
key: "priv/apns/apns-pro-key-noenc.pem",
mode: :prod,
use_2197: false,
pool_size: 5
]
]

config/prod.exs

config :mongoose_push, apns: [
dev: [
endpoint: {:system, :string, "PUSH_APNS_DEV_ENDPOINT", "gateway.sandbox.push.apple.com"},
cert: {:system, :string, "PUSH_APNS_DEV_CERT", "priv/apns/dev.pem"},
key: {:system, :string, "PUSH_APNS_DEV_KEY", "priv/apns/apns-dev-key-noenc.pem"},
mode: :dev,
use_2197: {:system, :boolean, "PUSH_APNS_DEV_USE_2197", false},
pool_size: {:system, :integer, "PUSH_APNS_DEV_POOL_SIZE", 5},
default_topic: {:system, :string, "PUSH_APNS_DEV_DEFAULT_TOPIC", nil}
],
prod: [
endpoint: {:system, :string, "PUSH_APNS_PROD_ENDPOINT", "gateway.push.apple.com"},
cert: {:system, :string, "PUSH_APNS_PROD_CERT", "priv/apns/prod.pem"},
key: {:system, :string, "PUSH_APNS_PROD_KEY", "priv/apns/apns-pro-key-noenc.pem"},
mode: :prod,
use_2197: {:system, :boolean, "PUSH_APNS_PROD_USE_2197", false},
pool_size: {:system, :integer, "PUSH_APNS_PROD_POOL_SIZE", 5},
default_topic: {:system, :string, "PUSH_APNS_PROD_DEFAULT_TOPIC", nil}
]
]

"unknown status code 460" error

12:01:28.469 [error] %ArgumentError{message: "unknown status code 460\n\n
Custom codes can be defined in the configuration for the :plug application,\n
under the :statuses key (which contains a map of status codes as keys and\n
reason phrases as values). 
For example:
\n\n    config :plug, :statuses, %{451 => \"Unavailable For Legal Reasons\"}\n\n
After defining the config for custom statuses, Plug must be recompiled for\n
the changes to take place using:\n\n    MIX_ENV=dev mix deps.compile plug\n\n
Doing this will allow the use of the integer status code 451 as\n
well as the atom :unavailable_for_legal_reasons in many Plug functions.\n
For example:\n\n    put_status(conn, :unavailable_for_legal_reasons)\n"}

PUSH_LOGLEVEL is ignored

I cannot set the log level via environment. This is my configuration:

version: '2'
services:
  mongoosepush:
    image: mongooseim/mongoose-push:latest
    ports:
      - "8443:8443"
    environment:
      PUSH_FCM_APP_KEY: "..."
      PUSH_LOGLEVEL: error
    volumes:
      - ./push:/opt/app/priv

When defining error I would assume that no info messages are logged, but this is the case:

mongoosepush_1  | 
mongoosepush_1  | 19:10:29.805 [info]  Setup running ...
mongoosepush_1  | 
mongoosepush_1  | 
mongoosepush_1  | 19:10:29.807 [info]  Directories verified. Res = :ok
mongoosepush_1  | 
mongoosepush_1  | 
mongoosepush_1  | 19:10:29.808 [info]  Setup finished processing hooks (Mode=:normal)...
mongoosepush_1  | 
mongoosepush_1  | 
mongoosepush_1  | 19:10:29.819 [info]  Starting Elixir.MongoosePush.Router with Cowboy on https://0.0.0.0:8443
mongoosepush_1  | 
mongoosepush_1  | 19:10:29.828 [info]  Starting FCM pool with API key ...
mongoosepush_1  | 19:10:29.790 [error] Supervisor 'Elixir.Logger.Supervisor' had child 'Elixir.Logger.ErrorHandler' started with 'Elixir.Logger.Watcher':watcher(error_logger, 'Elixir.Logger.ErrorHandler', {true,false,500}) at <0.1110.0> exit with reason normal in context child_terminated
mongoosepush_1  | 19:10:29.802 [info] Application lager started on node '[email protected]'
mongoosepush_1  | 19:10:29.803 [info] Application asn1 started on node '[email protected]'

There also some error with Elixir.Logger.Supervisor which may be related.

Is it possible to programmatically change the not-silent notifications title?

Hi all,

This is just a question.
Is it possible, via config files or something similar, to change the title of not-silent notifications? Because the title is the userJID by default, and this is something that we wouldn't show our users on their smartphones.

For Android, we can handle silent push notifications in every state of the app.
For iOS instead, we can handle silent push notifications only when the app is in the Foreground. When the app is killed or in the Background, iOS needs a not-silent notification to display it.

Push notifications with iOS 13 don't work

Hi all,

We were testing our implementation of mongooseIM (version 3.4.0) with mongoosePush(1.0.5) with 2 iPhone, one with iOS 12 and one with iOS 13. We use a simple XMPP client.
On iOS 12 push notifications work ok, but on iOS 13 they don't work at all: we don't receive push notifications.
We are checking if it is a client issue, meanwhile, could you check if mongoosePush is iOS 13 compatible?

Thank you

FCM error: Unable to complete push request due to service error: INVALID_ARGUMENT in category: invalid_request

MongoosePush version: mongoose_push-2.0.0-alpha.4

docker pull mongooseim/mongoose-push

on 24 November 2019

Request:

2019-11-24T12:50:53.912 [debug] pid=<0.1873.0> action=push_fcm_notification, request=%Sparrow.H2Worker.Request{body: 
  "{\"message\":{\"android\":{\"data\":{\"last-message-body\":\"1250\",\"last-message-sender\":\"[email protected]\",\"message-count\":1},\"notification\":{},\"priority\":\"HIGH\"},\"data\":{},\"notification\":{},\"token\":\"secret-token\"}}", 
  headers: [{"content-type", "application/json"}], 
  path: "/v1/projects//messages:send", 
  timeout: 5000}

Response from FCM (error):

{
  "error": {
    "code": 400,
    "message": "Invalid value at 'message.android.data[2].value' (TYPE_STRING), 1",
    "status": "INVALID_ARGUMENT",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.BadRequest",
        "fieldViolations": [
          {
            "field": "message.android.data[2].value",
            "description": "Invalid value at 'message.android.data[2].value' (TYPE_STRING), 1"
          }
        ]
      }
    ]
  }
}

Please help.

Many thanks in advance.

How to make sure that docker runs only in dev mode for APNS

I am working in development mode only for now. I have successfully provided the dev (key and certificates). Concerns:

  1. How to make sure that it will sure APNS dev pem files only.
  2. Do I need to provide pem file for both PROD and DEV, even when I only need to use it for dev?

// output from mongooseim live logs:
[warning] Unable to submit push notification. ErrorCode 500, Payload <<"null">>

// output from mongooseimPush docker logs
[error] %FunctionClauseError{args: nil, arity: 1, clauses: nil, function: :keys, kind: nil, module: Keyword}

The same setup is working fine for Android but in case of IOS not working and showing these error logs (shown above)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.