Skip to content

Latest commit

 

History

History
85 lines (67 loc) · 4.64 KB

faq.md

File metadata and controls

85 lines (67 loc) · 4.64 KB

Frequently Asked Questions

Q: Where can I find server logs when running in Docker?

A: The log is in the container at /var/log/tinode.log. Attach to a running container with command

docker exec -it name-of-the-running-container /bin/bash

Then, for instance, see the log with tail -50 /var/log/tinode.log

If the container has stopped already, you can copy the log out of the container (saving it to ./tinode.log):

docker cp name-of-the-container:/var/log/tinode.log ./tinode.log

Alternatively, you can instruct the docker container to save the logs to a directory on the host by mapping a host directory to /var/log/ in the container. Add -v /where/to/save/logs:/var/log to the docker run command.

Q: What are the options for enabling push notifications?

A: You can use Tinode Push Gateway (TNPG) or you can use Google FCM:

  • Tinode Push Gateway requires minimum configuration changes by sending pushes on behalf of Tinode.
  • Google FCM does not rely on Tinode infrastructure for pushes but requires you to recompile mobile apps (iOS and Android).

Q: How to setup push notifications with Tinode Push Gateway?

A: Enabling TNPG push notifications requires two steps:

  • register at console.tinode.co and obtain a TNPG token
  • configure server with the token

Obtain TNPG token

  1. Register at https://console.tinode.co and create an organization.
  2. Get the TPNG token from the On premise section by following the instructions there.

Configuring the server

Update the server config tinode.conf, section "push" -> "name": "tnpg":

{
  "enabled": true,
  "org": "test", // name of the organization you registered at console.tinode.co
  "token": "SoMe_LonG.RaNDoM-StRiNg.123" // authentication token obtained from console.tinode.co
}

Make sure the fcm section is disabled "enabled": false.

Q: How to setup push notifications with Google FCM?

A: Enabling FCM push notifications requires the following steps:

  • enable push sending from the server
  • enable receiving pushes in the clients

Server and TinodeWeb

  1. Create a project at https://firebase.google.com/ if you have not done so already.
  2. Follow instructions at https://cloud.google.com/iam/docs/creating-managing-service-account-keys to download the credentials file.
  3. Update the server config tinode.conf, section "push" -> "name": "fcm". Do ONE of the following:
  • Either enter the path to the downloaded credentials file into "credentials_file".
  • OR copy the file contents to "credentials".

    Remove the other entry. I.e. if you have updated "credentials_file", remove "credentials" and vice versa.
  1. Update TinodeWeb config firebase-init.js: update apiKey, messagingSenderId, projectId, appId, messagingVapidKey. See more info at https://github.com/tinode/webapp/#push_notifications

iOS and Android

  1. If you are using an Android client, add google-services.json to Tindroid by following instructions at https://developers.google.com/android/guides/google-services-plugin and recompile the client. You may also optionally submit it to Google Play Store. See more info at https://github.com/tinode/tindroid/#push_notifications
  2. If you are using an iOS client, add GoogleService-Info.plist to Tinodios by following instructions at https://firebase.google.com/docs/cloud-messaging/ios/client) and recompile the client. You may optionally submit the app to Apple AppStore. See more info at https://github.com/tinode/ios/#push_notifications

Q: How to add new users?

A: There are three ways to create accounts:

  • A user can create a new account using one of the applications (web, Android, iOS).
  • A new account can be created using tn-cli (acc command or useradd macro). The process can be scripted.
  • If the user already exists in an external database, the Tinode account can be automatically created on the first login using the rest authenticator.

Q: How to create a root user?

A: The root access can be granted to a user only by executing a database query. First create or choose the user you want to promote to root then execute the query:

  • RethinkDB:
r.db("tinode").table("auth").get("basic:login-of-the-user-to-make-root").update({authLvl: 30})
  • MySQL:
USE 'tinode';
UPDATE auth SET authlvl=30 WHERE uname='basic:login-of-the-user-to-make-root';

The test database has a stock user xena which has root access.