Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add db argument to srv #2451

Closed
lvnilesh opened this issue Dec 8, 2018 · 1 comment · Fixed by #2598
Closed

Add db argument to srv #2451

lvnilesh opened this issue Dec 8, 2018 · 1 comment · Fixed by #2598
Assignees
Labels
good first issue Good for newcomers issue: enhancement Issue suggesting an enhancement to an existing feature severity: medium If it breaks the basic use of the product but can be worked around

Comments

@lvnilesh
Copy link

lvnilesh commented Dec 8, 2018

Information

  • Node.js version: v10.14.1
  • NPM version: v6.4.1
  • Strapi version: commit hash 2edd056
  • Database: mongo with replicas and +srv string
  • Operating system: Google Kubernetes Engine running linux and custom docker based on commit 2edd056

What is the current behavior?

There is no ENV to specify +srv

Steps to reproduce the problem

Can't setup mongo replicas without resorting to manually editing configuration database.json

strapi new appname is missing a parameter where I could specify +srv=true

strapi new <name> \
--dbclient=<dbclient> \
--dbhost=<dbhost> \
--dbport=<dbport> \
--dbname=<dbname> \
--dbusername=<dbusername> \
--dbpassword=<dbpassword> \
--dbssl=<dbssl> \
--dbauth=<dbauth>

https://strapi.io/documentation/3.x.x/cli/CLI.html#strapi-new

What is the expected behavior?

Specifically, the command line strapi new app should take command line params to NONINTERACTIVELY save database.json like this.

{
  "defaultConnection": "default",
  "connections": {
    "default": {
      "connector": "strapi-hook-mongoose",
      "settings": {
        "client": "mongo",
        "host": "some.mongodb.net",
        "srv": true,
        "port": 27017,
        "database": "strapi",
        "username": "username",
        "password": "password"
      },
      "options": {
        "authenticationDatabase": "admin",
        "ssl": true
      }
    }
  }
}

Need ENV to set +srv connection: true (default false) that sets -> scope.database.settings.srv

Related to strapi/strapi-docker#71 and strapi/strapi-docker#52

@lvnilesh lvnilesh changed the title Need ENV to set +srv connection: true (default false) that sets -> scope.database.settings.srv strapi new appname is missing key command line params. Needed for scope.database.settings.srv Dec 8, 2018
@lauriejim lauriejim self-assigned this Dec 10, 2018
@lauriejim lauriejim added issue: enhancement Issue suggesting an enhancement to an existing feature severity: medium If it breaks the basic use of the product but can be worked around labels Dec 10, 2018
@lauriejim
Copy link
Contributor

Hello @lvnilesh , thank you for reporting this issue. We are currently on another feature and bug fix. Since time is lacking on our side, feel free investigate and submit a PR, we’ll appreciate your contribution on this issue!

Check this file: https://github.com/strapi/strapi/blob/master/packages/strapi/bin/strapi-new.js#L48

Check out the contributing guide to get started: https://github.com/strapi/strapi/blob/master/CONTRIBUTING.md

@lauriejim lauriejim changed the title strapi new appname is missing key command line params. Needed for scope.database.settings.srv Add db argument to srv Dec 10, 2018
@lauriejim lauriejim added the good first issue Good for newcomers label Dec 26, 2018
@Liroo Liroo mentioned this issue Jan 8, 2019
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers issue: enhancement Issue suggesting an enhancement to an existing feature severity: medium If it breaks the basic use of the product but can be worked around
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants