Skip to content

Commit

Permalink
Update INSTALL.md and README.md files
Browse files Browse the repository at this point in the history
  • Loading branch information
Googlom committed Nov 8, 2019
1 parent 5a4cdb0 commit 1d1fee4
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 6 deletions.
15 changes: 12 additions & 3 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ See [instructions](./docker/README.md)

1. Install [Go environment](https://golang.org/doc/install). Make sure Go version is at least 1.9. Building with Go 1.8 or below **will fail**!

2. Make sure either [RethinkDB](https://www.rethinkdb.com/docs/install/) or MySQL (or MariaDB or Percona) is installed and running. MySQL 5.7 or above is required. MySQL 5.6 or below **will not work**.
2. Make sure either [RethinkDB](https://www.rethinkdb.com/docs/install/) or MySQL (or MariaDB or Percona) is installed and running. MySQL 5.7 or above is required. MySQL 5.6 or below **will not work**. MongoDB (v4.2 and above) also available but it is experimental on not tested in production.

3. Fetch, build Tinode server and tinode-db database initializer:
- **RethinkDb**:
Expand All @@ -41,8 +41,13 @@ See [instructions](./docker/README.md)
go get -tags mysql github.com/tinode/chat/server && go install -tags mysql github.com/tinode/chat/server
go get -tags mysql github.com/tinode/chat/tinode-db && go install -tags mysql github.com/tinode/chat/tinode-db
```

Note the required **`-tags rethinkdb`** or **`-tags mysql`** build option.
- **MongoDB**:
```
go get -tags mongodb github.com/tinode/chat/server && go install -tags mongodb github.com/tinode/chat/server
go get -tags mongodb github.com/tinode/chat/tinode-db && go install -tags mongodb github.com/tinode/chat/tinode-db
```

Note the required **`-tags rethinkdb`**, **`-tags mysql`** or **`-tags mongodb`** build option.

You may also optionally define `main.buildstamp` for the server by adding a build option, for instance, with a timestamp:
```
Expand Down Expand Up @@ -76,6 +81,10 @@ See [instructions](./docker/README.md)
```
mysql.server start
```
- **MongoDB**: https://docs.mongodb.com/manual/administration/install-community/
```
mongod
```

2. Run DB initializer
```
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Tinode Instant Messaging Server

<img src="docs/logo.svg" align="left" width=128 height=128> Instant messaging server. Backend in pure [Go](http://golang.org) (license [GPL 3.0](http://www.gnu.org/licenses/gpl-3.0.en.html)), client-side binding in Java, Javascript, and Swift, as well as [gRPC](https://grpc.io/) client support for C++, C#, Go, Java, Node, PHP, Python, Ruby, Objective-C, etc. (license [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0)). Wire transport is JSON over websocket (long polling is also available) for custom bindings, or [protobuf](https://developers.google.com/protocol-buffers/) with gRPC. Persistent storage [RethinkDB](http://rethinkdb.com/) and MySQL. A third-party [DynamoDB adapter](https://github.com/riandyrn/chat/tree/master/server/db/dynamodb) also exists. Other databases can be supported by writing custom adapters.
<img src="docs/logo.svg" align="left" width=128 height=128> Instant messaging server. Backend in pure [Go](http://golang.org) (license [GPL 3.0](http://www.gnu.org/licenses/gpl-3.0.en.html)), client-side binding in Java, Javascript, and Swift, as well as [gRPC](https://grpc.io/) client support for C++, C#, Go, Java, Node, PHP, Python, Ruby, Objective-C, etc. (license [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0)). Wire transport is JSON over websocket (long polling is also available) for custom bindings, or [protobuf](https://developers.google.com/protocol-buffers/) with gRPC. Persistent storage [RethinkDB](http://rethinkdb.com/), MySQL and MongoDB (experimental). A third-party [DynamoDB adapter](https://github.com/riandyrn/chat/tree/master/server/db/dynamodb) also exists. Other databases can be supported by writing custom adapters.

Tinode is *not* XMPP/Jabber. It is *not* compatible with XMPP. It's meant as a replacement for XMPP. On the surface, it's a lot like open source WhatsApp or Telegram.

Expand Down
5 changes: 5 additions & 0 deletions chatbot/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ Quotes are read from `quotes.txt` by default. The file is plain text with one qu
```
$ docker run -p 6060:18080 -d --name tinode-srv --env PLUGIN_PYTHON_CHAT_BOT_ENABLED=true --volume botdata:/botdata --network tinode-net tinode/tinode-mysql:latest
```
3. **MongoDB**:
```
$ docker run -p 6060:18080 -d --name tinode-srv --env PLUGIN_PYTHON_CHAT_BOT_ENABLED=true --volume botdata:/botdata --network tinode-net tinode/tinode-mongodb:latest
```

3. Run the chatbot
```
Expand All @@ -109,6 +113,7 @@ Quotes are read from `quotes.txt` by default. The file is plain text with one qu
You may replace the `:latest` with a different tag. See all available tags here:
* [Tinode-MySQL tags](https://hub.docker.com/r/tinode/tinode-mysql/tags/)
* [Tinode-RethinkDB tags](https://hub.docker.com/r/tinode/tinode-rethink/tags/)
* [Tinode-MongoDB tags](https://hub.docker.com/r/tinode/tinode-mongodb/tags/)
* [Chatbot tags](https://hub.docker.com/r/tinode/chatbot/tags/)

In general try to use docker images all with the same tag.
14 changes: 13 additions & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ All images are available at https://hub.docker.com/r/tinode/
```
See [instructions](https://hub.docker.com/_/mysql/) for more options. MySQL 5.7 or above is required.

The name `rethinkdb` or `mysql` in the `--name` assignment is important. It's used by other containers as a database's host name.
3. **MongoDB**: If you've decided to use MongoDB backend, run the official MongoDB Docker container:
```
$ docker run --name mongodb --network tinode-net -d mongo:latest
```
See [instructions](https://hub.docker.com/_/mongo/) for more options. MongoDB 4.2 or above is required.

The name `rethinkdb`, `mysql` or `mongodb` in the `--name` assignment is important. It's used by other containers as a database's host name.

4. Run the Tinode container for the appropriate database:

Expand All @@ -37,13 +43,19 @@ All images are available at https://hub.docker.com/r/tinode/
$ docker run -p 6060:18080 -d --name tinode-srv --network tinode-net tinode/tinode-mysql:latest
```

3. **MongoDB**:
```
$ docker run -p 6060:18080 -d --name tinode-srv --network tinode-net tinode/tinode-mongodb:latest
```

See [below](#supported-environment-variables) for more options.

The port mapping `-p 6060:18080` tells Docker to map container's port 18080 to host's port 6060 making server accessible at http://localhost:6060/. The container will initialize the database with test data on the first run.

You may replace `:latest` with a different tag. See all all available tags here:
* [MySQL tags](https://hub.docker.com/r/tinode/tinode-mysql/tags/)
* [RethinkDB tags](https://hub.docker.com/r/tinode/tinode-rethink/tags/)
* [MongoDB tags](https://hub.docker.com/r/tinode/tinode-mongodb/tags/) (comming soon)

5. Test the installation by pointing your browser to [http://localhost:6060/](http://localhost:6060/).

Expand Down
4 changes: 3 additions & 1 deletion docker/tinode/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ LABEL version=$VERSION
# Build-time options.

# Database selector. Builds for RethinkDB by default.
# Alternatively use `--build-arg TARGET_DB=mysql` to build for MySQL.
# Alternatively use
# `--build-arg TARGET_DB=mysql` to build for MySQL or
# `--build-arg TARGET_DB=mongodb` to build for MongoDB.
ARG TARGET_DB=rethinkdb
ENV TARGET_DB=$TARGET_DB

Expand Down
4 changes: 4 additions & 0 deletions docker/tinode/config.template
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@
"database": "tinode",
"addresses": "rethinkdb"
}
"mongodb": {
"database": "tinode",
"addresses": "mongodb"
}
}
},

Expand Down
4 changes: 4 additions & 0 deletions tinode-db/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ This utility initializes the `tinode` database and optionally loads it with samp
- **MySQL**
`go build -tags mysql` or `go build -i -tags mysql` to automatically install missing dependencies.

- **MongoDB**
`go build -tags mongodb` or `go build -i -tags mongodb` to automatically install missing dependencies.


## Run

Expand Down Expand Up @@ -40,3 +43,4 @@ Avatar photos curtesy of https://www.pexels.com/ under [CC0 license](https://www

* [RethinkDB schema](https://github.com/tinode/chat/tree/master/server/db/rethinkdb/schema.md)
* [MySQL schema](https://github.com/tinode/chat/tree/master/server/db/mysql/schema.sql)
* [MongoDB schema](https://github.com/tinode/chat/tree/master/server/db/mongodb/schema.md)

0 comments on commit 1d1fee4

Please sign in to comment.