From 3fe34d6c1aba8aa51363619a53e8bdebf7545e7e Mon Sep 17 00:00:00 2001 From: annelin Date: Tue, 16 Apr 2019 09:22:59 +0300 Subject: [PATCH] Release 0.8.1 [UPD] renamed config param xmpp:secret to xmpp:password according to ejabberd config name [UPD] updated README.md and config example --- README.md | 4 ++-- config.yml.example | 14 +++++++------- inc/xmppcomponent.rb | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index c7943ce..01f9879 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ listen: ip: "127.0.0.1" service_check_from: false hosts: - "telegram.jabber.ru": + "tlgrm.localhost": password: "secret" ``` @@ -33,7 +33,7 @@ Next, move **config.yml.example** to and **config.yml** and edit **xmpp** sectio ``` xmpp: db_path: 'users.db' - jid: 'telegram.jabber.ru' + jid: 'tlgrm.localhost' host: 'localhost' port: 8888 secret: 'secret' diff --git a/config.yml.example b/config.yml.example index c5cb042..7440ddd 100644 --- a/config.yml.example +++ b/config.yml.example @@ -1,22 +1,22 @@ telegram: - api_id: '17349' # telegram API ID (my.telegram.org) # - api_hash: '344583e45741c457fe1862106095a5eb' # telegram API HASH (my.telegram.org) # + api_id: '845316' # telegram API ID (my.telegram.org) # + api_hash: '27fe5224bc822bf3a45e015b4f9dfdb7' # telegram API HASH (my.telegram.org) # verbosity: 2 # 1 = no verbosity, 2 = moderate verbosity, 3 = network requests debug useragent: 'Zhabogram XMPP Gateway' # client name version: '0.8' # client version use_test_dc: false # always use false loglevel: 0 # 0 = debug, 1 = info, 2 = warn, 3 = err, 4 = fatal, 5 = unknown (ruby logger class) - content_path: '/var/www/tg_media' # we will move (symlink) downloaded content here — you must setup web server that serve this directry - content_link: 'https://localhost/tg_media' # web server that serve `content_path` internet address - content_upload_prefix: 'https://localhost/upload' # we will send files with URL starting with this string as document to Telegram (mod_http_upload get_url, see readme) + content_path: '/var/zhabogram/content' # we will move (symlink) downloaded content here — you must setup web server that serve this directry + content_link: 'https://tlgrm.localhost/content' # web server that serve `content_path` internet address + content_upload_prefix: 'https://xmppfiles.localhost/upload' # we will send files with URL starting with this string as document to Telegram (mod_http_upload get_url, see readme) xmpp: db_path: 'users.db' # sqlite3 users (JID:Telegram Login) database jid: 'tlgrm.localhost' # component JID host: 'localhost' # XMPP server - port: 8899 # component port - secret: 'password' # component auth secret + port: 8888 # component port + password: 'secret' # component auth secret loglevel: 0 # 0 = debug, 1 = info, 2 = warn, 3 = err, 4 = fatal, 5 = unknown (ruby logger class) diff --git a/inc/xmppcomponent.rb b/inc/xmppcomponent.rb index 571fd02..4a03156 100644 --- a/inc/xmppcomponent.rb +++ b/inc/xmppcomponent.rb @@ -25,7 +25,7 @@ class XMPPComponent def initialize(params) @@loglevel = params['loglevel'] || Logger::DEBUG @logger = Logger.new(STDOUT); @logger.level = @@loglevel; @logger.progname = '[XMPPComponent]' - @config = { host: params["host"] || 'localhost', port: params["port"] || 8899, jid: params["jid"] || 'tlgrm.rxtx.us', secret: params['secret'] || '' } # default config + @config = { host: params["host"] || 'localhost', port: params["port"] || 8899, jid: params["jid"] || 'tlgrm.rxtx.us', secret: params['password'] || '' } # default config @sessions = {} @db = SQLite3::Database.new(params['db_path'] || 'users.db') @db.execute("CREATE TABLE IF NOT EXISTS users(jid varchar(256), tg_login varchar(256), PRIMARY KEY(jid) );")