tinode / chat

Instant messaging platform. Backend in Go. Clients: Swift iOS, Java Android, JS webapp, scriptable command line; chatbots
GNU General Public License v3.0
11.95k stars 1.87k forks source link

how to find default users from data.json for test #263

Closed beanhacker closed 5 years ago

beanhacker commented 5 years ago

hi, the author: i want find a test account from data.json which i have import into rethinkdb, but i can not find any that auth pass, could you help me to do so?

"users": [ { "createdAt": "-140h", "email": "alice@example.com", "tel": "+17025550001", "passhash": "alice123", "private": {"comment": "some comment 123"}, "public": {"fn": "Alice Johnson", "photo": "alice-64.jpg", "type": "jpg"}, "tags": ["Alice"], "state": 1, "status": { "text": "DND" }, "username": "alice", "addressBook": ["email:bob@example.com", "email:carol@example.com", "email:dave@example.com", "email:eve@example.com","email:frank@example.com","email:george@example.com","email:tino@example.com", "tel:+17025550001", "tel:+17025550002", "tel:+17025550003", "tel:+17025550004", "tel:+17025550005", "tel:+17025550006", "tel:+17025550007", "tel:+17025550008", "tel:+17025550009"] }, { "createdAt": "-139h", "email": "bob@example.com", "tel": "+17025550002", "passhash": "bob123", "private": {"comment": "no comments :)"}, "public": {"fn": "Bob Smith", "photo": "bob-64.jpg", "type": "jpg"}, "state": 1, "status": "stuff", "username": "bob", "addressBook": ["email:alice@example.com", "email:carol@example.com", "email:dave@example.com", "email:eve@example.com", "email:frank@example.com", "email:george@example.com", "email:tino@example.com", "tel:+17025550001", "tel:+17025550002", "tel:+17025550003", "tel:+17025550004", "tel:+17025550005", "tel:+17025550006", "tel:+17025550007", "tel:+17025550008", "tel:+17025550009"] }, { "createdAt": "-138h", "email": "carol@example.com", "tel": "+17025550003", "passhash": "carol123", "private": {"comment": "more stuff"}, "public": {"fn": "Carol Xmas", "photo": "carol-64.jpg", "type": "jpg"}, "state": 1, "status": "ho ho ho", "username": "carol", "addressBook": ["email:alice@example.com", "email:bob@example.com", "email:dave@example.com", "email:eve@example.com", "email:frank@example.com", "email:george@example.com", "email:tino@example.com", "tel:+17025550001", "tel:+17025550002", "tel:+17025550003", "tel:+17025550004", "tel:+17025550005", "tel:+17025550006", "tel:+17025550007", "tel:+17025550008", "tel:+17025550009"] }, { "createdAt": "-137h", "email": "dave@example.com", "tel": "+17025550004", "passhash": "dave123", "private": {"comment": "stuff 123"}, "public": {"fn": "Dave Goliathsson", "photo": "dave-64.jpg", "type": "jpg"}, "state": 1, "status": "hiding!", "username": "dave", "addressBook": ["email:alice@example.com", "email:bob@example.com", "email:carol@example.com", "email:eve@example.com", "email:frank@example.com", "email:george@example.com", "email:tino@example.com", "tel:+17025550001", "tel:+17025550002", "tel:+17025550003", "tel:+17025550004", "tel:+17025550005", "tel:+17025550006", "tel:+17025550007", "tel:+17025550008", "tel:+17025550009"] }, { "createdAt": "-136h", "email": "eve@example.com", "tel": "+17025550005", "passhash": "eve123", "private": {"comment": "apples?"}, "public": {"fn": "Eve Adams", "photo": "eve-64.jpg", "type": "jpg"}, "state": 1, "username": "eve", "addressBook": ["email:alice@example.com", "email:bob@example.com", "email:carol@example.com", "email:dave@example.com", "email:george@example.com", "email:tino@example.com", "tel:+17025550001", "tel:+17025550002", "tel:+17025550003", "tel:+17025550004", "tel:+17025550005", "tel:+17025550006", "tel:+17025550007", "tel:+17025550008", "tel:+17025550009"] }, { "createdAt": "-135h", "email": "frank@example.com", "tel": "+17025550006", "passhash": "frank123", "private": {"comment": "things, not stuff"}, "public": {"fn": "Frank Singer"}, "state": 2, "status": "singing!", "username": "frank", "addressBook": ["email:bob@example.com", "email:carol@example.com", "email:dave@example.com", "email:eve@example.com", "email:george@example.com", "email:tino@example.com", "tel:+17025550001", "tel:+17025550002", "tel:+17025550003", "tel:+17025550004", "tel:+17025550005", "tel:+17025550007", "tel:+17025550008", "tel:+17025550009"] }, { "createdAt": "-134h", "email": "tino@example.com", "tel": "+17025550010", "passhash": "(random)", "private": {"comment": "I'm a chatbot short and stout"}, "public": {"fn": "Tino the Chatbot", "photo": "tino-64.jpg", "type": "jpg"}, "state": 1, "status": "Chatting nonsensically", "username": "tino", "addressBook": [] }, { "createdAt": "-133h", "email": "xena@example.com", "tel": "+17025550099", "passhash": "xena123", "authLevel": "root", "private": {"comment": "No one knowns that Xena exists"}, "public": {"fn": "Xena Pacifist Peasant", "photo": "xena-128.jpg", "type": "jpg"}, "state": 1, "status": "Just a simple peaceful agriculture specialist", "username": "xena", "addressBook": [] } ]

or-else commented 5 years ago

I completely do not understand your question. Please try rephrasing it.

or-else commented 5 years ago

Ot try writing in your language, I'll use google-translate to figure it out.

beanhacker commented 5 years ago

我安装了一个rethinkdb,同时把tinode中携带的data.json导入到了rethinkdb。然后启动了rethinkdb,并启动了tinode连接到了rethinkdb,并且下载了tinode的安卓客户端,打开客户端后,我想登录一个账户,但是不知导入的data.json中包含了哪些用户,以及他们的密码是多少?所以向您求助,谢谢!

or-else commented 5 years ago

The data.json uses the same users as api.tinode.co: alice-alice123, bob-bob123, etc.

See here:

{
  "createdAt": "-140h",
  "email": "alice@example.com",
  "tel": "+17025550001",
  "passhash": "alice123", <==== PASSWORD =======
  "private": {"comment": "some comment 123"},
  "public": {"fn": "Alice Johnson", "photo": "alice-64.jpg", "type": "jpg"},
  "tags": ["Alice"],
  "state": 1,
  "status": {
    "text": "DND"
  },
  "username": "alice", <===== LOGIN ========
  "addressBook": ["email:bob@example.com", "email:carol@example.com", 
...
beanhacker commented 5 years ago

我输入对应的用户信息,但是下面的截图报错,看不明白,用的是刚下载最新的tinode服务器和安卓客户端。

2019-08-30_153244
or-else commented 5 years ago

When you run init-db, did you load the data? Did you run it with --data=data.json parameter?

or-else commented 5 years ago

Please show the log of your init-db run.

beanhacker commented 5 years ago

哦,不好意思,是我这边的问题,第一次执行init_db.exe时,忘记加data选项了,结果数据库创建出来了,但是由于没数据,这些表没创建,第二次执行init_db并加上data选项后,提示已经创建过了,就没有再继续执行。 这次我把数据库删除了,重新执行了init_db.exe并带上了data选项,终于可以正常登录了,谢谢辛苦支持!

or-else commented 5 years ago

Great! Happy to hear that.

好消息