Skip to content

add emailAdapter to ENV variables for parse-server-generic-email-adapter #5182

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

Closed
tanzeelrana opened this issue Nov 18, 2018 · 3 comments
Closed

Comments

@tanzeelrana
Copy link

Issue Description

Steps to reproduce

I have the following setup and I am getting an error parse-server-simple-mailgun-adapter: command not found

{
  "apps" :
[

{
    "name"        : "Logistics App",
    "script"      : "parse-server",
    "ignore_watch": ["logs"],
    "watch"       : true,
    "merge_logs"  : true,
    "cwd"         : "/root/parse-server/",
    "env": {
      "PARSE_SERVER_CLOUD_CODE_MAIN": "/root/logistics-app/cloud/main.js",
      "PARSE_SERVER_DATABASE_URI": "mongodb://localhost:27017/logisticsDB",
      "PARSE_SERVER_APPLICATION_ID": "PARSE_SERVER_APPLICATION_ID",
      "PARSE_SERVER_MASTER_KEY": "PARSE_SERVER_MASTER_KEY",
      "PORT": "1338",
      "PARSE_SERVER_EMAIL_ADAPTER": {
          "module": "parse-server-generic-email-adapter",
          "options": {
            "service": "Gmail",
            "email": "email@gmail.com",
            "password": "Your password"
          }
        },
      "PARSE_SERVER_URL": "http://HOST/logisticsApp",
    }
},
]}

I have installed parse-server-simple-mailgun-adapter using npm i -g parse-server-simple-mailgun-adapter

Expected Results

Parse server should start with the email module setup and loaded properly

Actual Outcome

Environment Setup

  • Server

    • parse-server version : "version": "2.3.1"
    • Operating System: Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-139-generic x86_64)
    • Hardware: digital ocean droplet
    • Localhost or remote server? : Digital Ocean
  • Database

    • MongoDB version:
MongoDB shell version v3.4.10
git version: 078f28920cb24de0dd479b5ea6c66c644f6326e9
OpenSSL version: OpenSSL 1.0.2g  1 Mar 2016
allocator: tcmalloc
modules: none
build environment:
    distmod: ubuntu1604
    distarch: x86_64
    target_arch: x86_64

Logs/Trace

Error: Cannot find module 'parse-server-generic-email-adapter'
    at Function.Module._resolveFilename (module.js:455:15)
    at Function.Module._load (module.js:403:25)
    at Function._load (/usr/lib/node_modules/pm2/node_modules/pmx/lib/transaction.js:62:21)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at loadAdapter (/usr/lib/node_modules/parse-server/lib/Adapters/AdapterLoader.js:27:15)
    at loadAdapter (/usr/lib/node_modules/parse-server/lib/Adapters/AdapterLoader.js:34:12)
    at new ParseServer (/usr/lib/node_modules/parse-server/lib/ParseServer.js:279:65)
    at new _ParseServer (/usr/lib/node_modules/parse-server/lib/index.js:46:16)
    at startServer (/usr/lib/node_modules/parse-server/lib/cli/parse-server.js:52:13)
@tanzeelrana
Copy link
Author

@flovilmart
Copy link
Contributor

You do not have the package installed as the good people of nvm mentioned.

You mentioned having ‘generic’ email adapter in your config? It should likely reference ‘simple’ as it’s the one you want to use.

@supermar1010
Copy link

supermar1010 commented May 19, 2020

I just struggled with this for about 2 hours. I'm setting the env variables in a docker-compose. The important thing was to use double quotes for attributes.

This is how it works:

services:
  parse:
    image: parseplatform/parse-server
    environment:
      ....
      - PARSE_SERVER_VERIFY_USER_EMAILS=true
      - PARSE_SERVER_PREVENT_LOGIN_WITH_UNVERIFIED_EMAIL=true
      - 'PARSE_SERVER_EMAIL_ADAPTER={"module": "parse-server-generic-email-adapter", "options": {"service": "Gmail", "email": "my@email.com", "password": "myPassword"}}'

The module needs to be installed before, I did this via a custom dockerfile as follows:

FROM parseplatform/parse-server

USER root
RUN npm install --save parse-server-generic-email-adapter
USER node

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants