wallet icon indicating copy to clipboard operation
wallet copied to clipboard

Is it a good idea to prepopulate new installation with some sample questions, sample users?

Open stefek99 opened this issue 6 years ago • 6 comments

The other day I've cloned the repository... I've created the account and realized:

  • there are very cool screenshots in the whitepaper
  • when starting on the platform everything is fresh
  • can we provide a default demo/demo credentials, can we pre-populate the system with a few a sample proposals for easier testing?

I'm worried about security considerations, even if the password is changeme some people won't... That's the downside of default credentials. Also the pre-populated database could be problematic in terms of security, maintenance.

stefek99 avatar Apr 08 '18 14:04 stefek99

Hello @stefek99 !

This is a legitimate question, and a practice often seen on distributed applications. The keyword here is fixtures. We aim to provide a command line that will populate the database with such fixtures for easier testing. But to do that, and to be able to maintain them sanely, we need some more architecture (see #220).


In regard to the security issues raised by such practice, well… A good solution is to generate random passwords for the dummy users and ask for a username and password during the installation of the fixtures.

domi41 avatar Apr 08 '18 17:04 domi41

Also, other option is to only create fixtures when Meteor.isDevelopment so you can start a site in production with an empty database and a dev site with some data.

vjrj avatar Apr 09 '18 07:04 vjrj

Happy to take any recommendations and suggestions regarding this. I think it's a good idea.

santisiri avatar Apr 09 '18 20:04 santisiri

I use: https://www.npmjs.com/package/@cleverbeagle/seeder

Quite easy usage: https://cleverbeagle.com/packages/seeder/usage

Example in action: https://github.com/cleverbeagle/pup/blob/master/imports/startup/server/fixtures.js

vjrj avatar Apr 10 '18 14:04 vjrj

@vjrj Seeder looks super-nice ! We should probably use it in the feature suite as well, no ?

This way, we can have fixtures written in gherkin, and that will provide boilerplates for bug reporters to expose their bugs using gherkin as well ?

domi41 avatar Apr 10 '18 23:04 domi41

SGTM!

vjrj avatar Apr 11 '18 08:04 vjrj