[openstreetmap/openstreetmap-website] Create a dev:populate task to add fake data to your dev environment (#3101)

Robbendebiene notifications at github.com
Sun Jun 20 15:15:12 UTC 2021


I'm currently also in need of a dummy user account, because I cannot easily create it via the web interface since the server is running in a docker instance on Github actions.

I first tried the following approach which is a modified version from this issue: https://github.com/openstreetmap/openstreetmap-website/issues/3136 

```
bundle exec rails runner 'pw_hash = PasswordHash.create("test.user at osm.org")
          admin = User.find_or_create_by(
            :email => "test.user at osm.org",
            :email_valid => true,
            :display_name => "My New User Name",
            :status => "confirmed",
            :terms_seen => true,
            :terms_agreed => Time.now.getutc,
            :data_public => true,
            :pass_crypt => pw_hash
          )
          admin.save!'
```

But when trying this on my local server I cannot login via the website (server [log.txt](https://github.com/openstreetmap/openstreetmap-website/files/6682559/log.txt))
I'm pretty sure I'm using the `PasswordHash.create()` function the wrong way, because in the official code it is only used for `pass_salt`.


In your approach the user name (and password?) seems to be generated and thus (kind of) unknown. For my use case it would be nice to have a fixed user account, with known name and password.

Thanks in advance.

______

My use case:
Set up automated testing for an OSM API implementation. I decided against using the dev server (https://master.apis.dev.openstreetmap.org/) because the credentials will be publicly available on Github. I also don't want to endlessly pollute the server.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/3101#issuecomment-864569577
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20210620/95416329/attachment.htm>


More information about the rails-dev mailing list