Code Monkey home page Code Monkey logo

matrix-appservice-tg's Introduction

Installation

$ git clone ...
$ cd matrix-appservice-tg
$ npm install

Setup

  1. Create a new Matrix room to act as the administration control room. Note its internal room ID.

  2. Create a telegram-config.yaml file for global configuration. There is a sample one to begin with in config/telegram-config-sample.yaml you may wish to copy and edit as appropriate. This needs the following keys:

    matrix_homeserver: "http URL pointing at the homeserver"
    
    matrix_user_domain: "domain part of the homeserver's name. Used for
                         ghost username generation"
    
    username_template: "template for virtual users, e.g. telegram_${USER}"
    
    matrix_admin_room: "the ID of the room created in step 2"
    
    auth_key_password: "a random string used to obfuscate authentication keys
                        stored in the user database"
  3. Pick/decide on a spare local TCP port number to run the application service on. This needs to be visible to the homeserver - take care to configure firewalls correctly if that is on another machine to the bridge. The port number will be noted as $PORT in the remaining instructions.

  4. Generate the appservice registration file (if the application service runs on the same server you can use localhost as $URL):

    $ node index.js --generate-registration -f telegram-registration.yaml  -u $URL:$PORT
  5. Start the actual application service. You can use forever

    $ forever start index.js --config telegram-config.yaml --port $PORT

    or node

    $ node index.js --config telegram-config.yaml --port $PORT
  6. Copy the newly-generated telegram-registration.yaml file to the homeserver. Add the registration file to your homeserver config (default homeserver.yaml):

    app_service_config_files:
       - ...
       - "/path/to/telegram-registration.yaml"

    Don't forget - it has to be a YAML list of strings, not just a single string.

    Restart your homeserver to have it reread the config file and establish a connection to the bridge.

  7. Invite the newly-created @telegrambot:DOMAIN user into the admin control room created at step 1.

The bridge should now be running.

matrix-appservice-tg's People

Contributors

leonerd avatar ara4n avatar

Watchers

James Cloos avatar pa0ti avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.