I'm trying to raise a bridge between matrix and telegram.
I made the necessary preparations :
-
raised the service synapse at localport:8008 by https://upcloud.com/community/tutorials/install-matrix-synapse/?utm_term=&utm_campaign=DSA&utm_source=adwords&utm_medium=ppc&hsa_acc=9391663435&hsa_cam=7185608860&hsa_grp=81739862313&hsa_ad=391197952986&hsa_src=g&hsa_tgt=aud-312112117574:dsa-460992423274&hsa_kw=&hsa_mt=b&hsa_net=adwords&hsa_ver=3&gclid=CjwKCAjwxev3BRBBEiwAiB_PWJCHEngvBpwC95VGNzZ2n3LLG7mbOzTdhzb22KF2u0t-SQiTX8zxsxoCueMQAvD_BwE
-
get id and hash for app rom my.telegram.org
-
create user with login 'test_user' by command 'register_new_matrix_user -c homeserver.yaml http://localhost:8008'
I trying to raise mautrix-telegram with config
config.yaml
`
homeserver:
address: http://localhost:8008
domain: localhost
verify_ssl: false
appservice:
address: http://localhost:8008
tls_cert: false
tls_key: false
hostname: 0.0.0.0
port: 8008
max_body_size: 1
database: sqlite:////data/mautrix-telegram.db
public:
enabled: false
prefix: /public
external: https://localhost/public
provisioning:
enabled: true
prefix: /_matrix/provision/v1
shared_secret: ury62lmda4sskulftx65ugzidabfdj51a3q6qqa2tsjtdtpj0iwcsuc9je1nnun2
id: telegram
bot_username: test_user
bot_displayname: Telegram bridge bot
bot_avatar: mxc://maunium.net/tJCRmUyJDsgRNgqhOgoiHWbX
community_id: false
as_token: kl9s45zak3oro67ngww2sabprevf6ru4gq1p9ozu2endmrokqyx2jckmuzfv0u0s
hs_token: t1bygs8d0sqrf033tu423lqt1eyr6gru8ptu9y1whdkxrok1zz45j57nr2shxswj
metrics:
enabled: false
listen_port: 8000
manhole:
enabled: false
path: /var/tmp/mautrix-telegram.manhole
whitelist:
- 0
bridge:
username_template: telegram_{userid}
alias_template: telegram_{groupname}
displayname_template: '{displayname} (Telegram)'
displayname_preference:
- full name
- username
- phone number
displayname_max_length: 100
allow_avatar_remove: false
max_initial_member_sync: -1
sync_channel_members: true
skip_deleted_members: true
startup_sync: true
sync_dialog_limit: 30
sync_direct_chats: false
max_telegram_delete: 10
sync_matrix_state: true
allow_matrix_login: true
plaintext_highlights: false
public_portals: true
sync_with_custom_puppets: true
login_shared_secret:
telegram_link_preview: true
inline_images: false
image_as_file_size: 10
max_document_size: 100
parallel_file_transfer: false
federate_rooms: true
animated_sticker:
target: gif
args:
width: 256
height: 256
background: '020202' # only for gif
fps: 30 # only for webm
encryption:
allow: false
default: false
private_chat_portal_meta: false
delivery_receipts: false
delivery_error_reports: false
resend_bridge_info: false
initial_power_level_overrides:
user: {}
group: {}
bot_messages_as_notices: true
bridge_notices:
default: false
exceptions:
- '@importantbot:localhost'
deduplication:
pre_db_check: false
cache_queue_length: 20
message_formats:
m.text: '$sender_displayname: $message'
m.notice: '$sender_displayname: $message'
m.emote: '* $sender_displayname $message'
m.file: '$sender_displayname sent a file: $message'
m.image: '$sender_displayname sent an image: $message'
m.audio: '$sender_displayname sent an audio file: $message'
m.video: '$sender_displayname sent a video: $message'
m.location: '$sender_displayname sent a location: $message'
emote_format: '* $mention $formatted_body'
state_event_formats:
join: $displayname joined the room.
leave: $displayname left the room.
name_change: $prev_displayname changed their name to $displayname
filter:
mode: blacklist
list: []
command_prefix: '!tg'
permissions:
'*': relaybot
public.localhost: user
localhost: full
'@admin:localhost': admin
relaybot:
private_chat:
invite: []
state_changes: true
message: This is a Matrix bridge relaybot and does not support direct chats
group_chat_invite: []
ignore_unbridged_group_chat: true
authless_portals: true
whitelist_group_admins: true
ignore_own_incoming_events: true
whitelist:
- test_user
telegram:
api_id: 141XXXX
api_hash: c8df66XXX....
bot_token: disabled
connection:
timeout: 120
retries: 5
retry_delay: 1
flood_sleep_threshold: 60
request_retries: 5
device_info:
device_model: auto
system_version: auto
app_version: auto
lang_code: en
system_lang_code: en
server:
enabled: false
dc: 2
ip: 149.154.167.40
port: 80
proxy:
type: disabled
address: 127.0.0.1
port: 1080
rdns: true
username: ''
password: ''
logging:
version: 1
formatters:
colored:
(): mautrix_telegram.util.ColorFormatter
format: '[%(asctime)s] [%(levelname)s@%(name)s] %(message)s'
normal:
format: '[%(asctime)s] [%(levelname)s@%(name)s] %(message)s'
handlers:
file:
class: logging.handlers.RotatingFileHandler
formatter: normal
filename: ./mautrix-telegram.log
maxBytes: 10485760
backupCount: 10
console:
class: logging.StreamHandler
formatter: colored
loggers:
mau:
level: DEBUG
telethon:
level: INFO
aiohttp:
level: INFO
root:
level: DEBUG
handlers: [file, console]
**and registration.yaml:**
id: telegram
as_token: kl9s45zak3oro67ngww2sabprevf6ru4gq1p9ozu2endmrokqyx2jckmuzfv0u0s
hs_token: t1bygs8d0sqrf033tu423lqt1eyr6gru8ptu9y1whdkxrok1zz45j57nr2shxswj
namespaces:
users:
- exclusive: true
regex: '@telegram_.+:localhost'
- exclusive: true
regex: '@test_user:localhost'
aliases:
- exclusive: true
regex: '#telegram_.+:localhost'
url: http://localhost:8008
sender_localpart: f3uvwdd0ef6z2fkx18lg80x67sd6xdguf1a8hovdkgeijju13czb4tak77ndnc7d
rate_limited: false
`
in homeserver.yaml added app_service_config_files registration.yaml
config.yaml and registration.yaml configs genereted by 'docker run --rm -v pwd:/data:z dock.mau.dev/tulir/mautrix-telegram:latest'
Run bridge 'docker run --restart unless-stopped -p 29317:29317 -v pwd:/data:z dock.mau.dev/tulir/mautrix-telegram:latest'
and get a error :
127.0.0.1 [30/Jun/2020:15:08:23 +0000] "GET /_matrix/client/r0/account/whoami?user_id=@test_user:localhost HTTP/1.1" 404 172 "-" "Python/3.8 aiohttp/3.6.2" [2020-06-30 15:08:23,779] [CRITICAL@mau.init] Unexpected error in main event loop Traceback (most recent call last): File "/usr/lib/python3.8/site-packages/mautrix/util/program.py", line 170, in _run self.loop.run_until_complete(self.start()) File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "/usr/lib/python3.8/site-packages/mautrix/bridge/bridge.py", line 125, in start await self.matrix.wait_for_connection() File "/usr/lib/python3.8/site-packages/mautrix/bridge/matrix.py", line 75, in wait_for_connection await self.az.intent.whoami() File "/usr/lib/python3.8/site-packages/mautrix/client/api/authentication.py", line 32, in whoami resp = await self.api.request(Method.GET, Path.account.whoami) File "/usr/lib/python3.8/site-packages/mautrix/api/http.py", line 203, in request return await self._send(method, endpoint, content, query_params, headers or {}) File "/usr/lib/python3.8/site-packages/mautrix/api/http.py", line 143, in _send raise make_request_error(http_status=response.status, mautrix.errors.request.MatrixUnknownRequestError: 404: 404: Not Found
It is not a clear .
Tell me what I'm doing wrong, please.
I'm trying to raise a bridge between matrix and telegram.
I made the necessary preparations :
raised the service synapse at localport:8008 by https://upcloud.com/community/tutorials/install-matrix-synapse/?utm_term=&utm_campaign=DSA&utm_source=adwords&utm_medium=ppc&hsa_acc=9391663435&hsa_cam=7185608860&hsa_grp=81739862313&hsa_ad=391197952986&hsa_src=g&hsa_tgt=aud-312112117574:dsa-460992423274&hsa_kw=&hsa_mt=b&hsa_net=adwords&hsa_ver=3&gclid=CjwKCAjwxev3BRBBEiwAiB_PWJCHEngvBpwC95VGNzZ2n3LLG7mbOzTdhzb22KF2u0t-SQiTX8zxsxoCueMQAvD_BwE
get id and hash for app rom my.telegram.org
create user with login 'test_user' by command 'register_new_matrix_user -c homeserver.yaml http://localhost:8008'
I trying to raise mautrix-telegram with config
config.yaml
`
homeserver:
address: http://localhost:8008
domain: localhost
verify_ssl: false
appservice:
address: http://localhost:8008
tls_cert: false
tls_key: false
hostname: 0.0.0.0
port: 8008
max_body_size: 1
database: sqlite:////data/mautrix-telegram.db
public:
enabled: false
prefix: /public
external: https://localhost/public
provisioning:
enabled: true
prefix: /_matrix/provision/v1
shared_secret: ury62lmda4sskulftx65ugzidabfdj51a3q6qqa2tsjtdtpj0iwcsuc9je1nnun2
id: telegram
bot_username: test_user
bot_displayname: Telegram bridge bot
bot_avatar: mxc://maunium.net/tJCRmUyJDsgRNgqhOgoiHWbX
community_id: false
as_token: kl9s45zak3oro67ngww2sabprevf6ru4gq1p9ozu2endmrokqyx2jckmuzfv0u0s
hs_token: t1bygs8d0sqrf033tu423lqt1eyr6gru8ptu9y1whdkxrok1zz45j57nr2shxswj
metrics:
enabled: false
listen_port: 8000
manhole:
enabled: false
path: /var/tmp/mautrix-telegram.manhole
whitelist:
- 0
bridge:
username_template: telegram_{userid}
alias_template: telegram_{groupname}
displayname_template: '{displayname} (Telegram)'
displayname_preference:
- full name
- username
- phone number
displayname_max_length: 100
allow_avatar_remove: false
max_initial_member_sync: -1
sync_channel_members: true
skip_deleted_members: true
startup_sync: true
sync_dialog_limit: 30
sync_direct_chats: false
max_telegram_delete: 10
sync_matrix_state: true
allow_matrix_login: true
plaintext_highlights: false
public_portals: true
sync_with_custom_puppets: true
login_shared_secret:
telegram_link_preview: true
inline_images: false
image_as_file_size: 10
max_document_size: 100
parallel_file_transfer: false
federate_rooms: true
animated_sticker:
target: gif
args:
width: 256
height: 256
background: '020202' # only for gif
fps: 30 # only for webm
encryption:
allow: false
default: false
private_chat_portal_meta: false
delivery_receipts: false
delivery_error_reports: false
resend_bridge_info: false
initial_power_level_overrides:
user: {}
group: {}
bot_messages_as_notices: true
bridge_notices:
default: false
exceptions:
- '@importantbot:localhost'
deduplication:
pre_db_check: false
cache_queue_length: 20
message_formats:
m.text: '$sender_displayname: $message'
m.notice: '$sender_displayname: $message'
m.emote: '* $sender_displayname $message'
m.file: '$sender_displayname sent a file: $message'
m.image: '$sender_displayname sent an image: $message'
m.audio: '$sender_displayname sent an audio file: $message'
m.video: '$sender_displayname sent a video: $message'
m.location: '$sender_displayname sent a location: $message'
emote_format: '* $mention $formatted_body'
state_event_formats:
join: $displayname joined the room.
leave: $displayname left the room.
name_change: $prev_displayname changed their name to $displayname
filter:
mode: blacklist
list: []
command_prefix: '!tg'
permissions:
'*': relaybot
public.localhost: user
localhost: full
'@admin:localhost': admin
relaybot:
private_chat:
invite: []
state_changes: true
message: This is a Matrix bridge relaybot and does not support direct chats
group_chat_invite: []
ignore_unbridged_group_chat: true
authless_portals: true
whitelist_group_admins: true
ignore_own_incoming_events: true
whitelist:
- test_user
telegram:
api_id: 141XXXX
api_hash: c8df66XXX....
bot_token: disabled
connection:
timeout: 120
retries: 5
retry_delay: 1
flood_sleep_threshold: 60
request_retries: 5
device_info:
device_model: auto
system_version: auto
app_version: auto
lang_code: en
system_lang_code: en
server:
enabled: false
dc: 2
ip: 149.154.167.40
port: 80
proxy:
type: disabled
address: 127.0.0.1
port: 1080
rdns: true
username: ''
password: ''
logging:
version: 1
formatters:
colored:
(): mautrix_telegram.util.ColorFormatter
format: '[%(asctime)s] [%(levelname)s@%(name)s] %(message)s'
normal:
format: '[%(asctime)s] [%(levelname)s@%(name)s] %(message)s'
handlers:
file:
class: logging.handlers.RotatingFileHandler
formatter: normal
filename: ./mautrix-telegram.log
maxBytes: 10485760
backupCount: 10
console:
class: logging.StreamHandler
formatter: colored
loggers:
mau:
level: DEBUG
telethon:
level: INFO
aiohttp:
level: INFO
root:
level: DEBUG
handlers: [file, console]
**and registration.yaml:**id: telegram
as_token: kl9s45zak3oro67ngww2sabprevf6ru4gq1p9ozu2endmrokqyx2jckmuzfv0u0s
hs_token: t1bygs8d0sqrf033tu423lqt1eyr6gru8ptu9y1whdkxrok1zz45j57nr2shxswj
namespaces:
users:
- exclusive: true
regex: '@telegram_.+:localhost'
- exclusive: true
regex: '@test_user:localhost'
aliases:
- exclusive: true
regex: '#telegram_.+:localhost'
url: http://localhost:8008
sender_localpart: f3uvwdd0ef6z2fkx18lg80x67sd6xdguf1a8hovdkgeijju13czb4tak77ndnc7d
rate_limited: false
`
in homeserver.yaml added app_service_config_files registration.yaml
config.yaml and registration.yaml configs genereted by 'docker run --rm -v
pwd:/data:z dock.mau.dev/tulir/mautrix-telegram:latest'Run bridge 'docker run --restart unless-stopped -p 29317:29317 -v
pwd:/data:z dock.mau.dev/tulir/mautrix-telegram:latest'and get a error :
127.0.0.1 [30/Jun/2020:15:08:23 +0000] "GET /_matrix/client/r0/account/whoami?user_id=@test_user:localhost HTTP/1.1" 404 172 "-" "Python/3.8 aiohttp/3.6.2" [2020-06-30 15:08:23,779] [CRITICAL@mau.init] Unexpected error in main event loop Traceback (most recent call last): File "/usr/lib/python3.8/site-packages/mautrix/util/program.py", line 170, in _run self.loop.run_until_complete(self.start()) File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "/usr/lib/python3.8/site-packages/mautrix/bridge/bridge.py", line 125, in start await self.matrix.wait_for_connection() File "/usr/lib/python3.8/site-packages/mautrix/bridge/matrix.py", line 75, in wait_for_connection await self.az.intent.whoami() File "/usr/lib/python3.8/site-packages/mautrix/client/api/authentication.py", line 32, in whoami resp = await self.api.request(Method.GET, Path.account.whoami) File "/usr/lib/python3.8/site-packages/mautrix/api/http.py", line 203, in request return await self._send(method, endpoint, content, query_params, headers or {}) File "/usr/lib/python3.8/site-packages/mautrix/api/http.py", line 143, in _send raise make_request_error(http_status=response.status, mautrix.errors.request.MatrixUnknownRequestError: 404: 404: Not FoundIt is not a clear .
Tell me what I'm doing wrong, please.