Update mautrix-twitter config to be Jinja2 template

Updates based off the variable names used in mautrix-facebook role.

Also update port number in defauts/main.yml, and disable presence
checking, because Twitter doesn't support that.
This commit is contained in:
Matthew Cengia 2021-04-11 16:29:12 +10:00
parent 8282ab48c7
commit 68e6311a9f
2 changed files with 13 additions and 23 deletions

View File

@ -19,7 +19,7 @@ matrix_mautrix_twitter_docker_src_files_path: "{{ matrix_mautrix_twitter_base_pa
matrix_mautrix_twitter_homeserver_address: "{{ matrix_homeserver_container_url }}" matrix_mautrix_twitter_homeserver_address: "{{ matrix_homeserver_container_url }}"
matrix_mautrix_twitter_homeserver_domain: '{{ matrix_domain }}' matrix_mautrix_twitter_homeserver_domain: '{{ matrix_domain }}'
matrix_mautrix_twitter_appservice_address: 'http://matrix-mautrix-twitter:29319' matrix_mautrix_twitter_appservice_address: 'http://matrix-mautrix-twitter:29327'
# A list of extra arguments to pass to the container # A list of extra arguments to pass to the container
matrix_mautrix_twitter_container_extra_arguments: [] matrix_mautrix_twitter_container_extra_arguments: []
@ -72,8 +72,6 @@ matrix_mautrix_twitter_bridge_login_shared_secret_map: "{{ {matrix_mautrix_twitt
matrix_mautrix_twitter_appservice_bot_username: twitterbot matrix_mautrix_twitter_appservice_bot_username: twitterbot
matrix_mautrix_twitter_bridge_presence: true
# Default configuration template which covers the generic use case. # Default configuration template which covers the generic use case.
# You can customize it by controlling the various variables inside it. # You can customize it by controlling the various variables inside it.
# #

View File

@ -1,9 +1,10 @@
#jinja2: lstrip_blocks: "True"
# Homeserver details # Homeserver details
homeserver: homeserver:
# The address that this appservice can use to connect to the homeserver. # The address that this appservice can use to connect to the homeserver.
address: https://example.com address: {{ matrix_mautrix_twitter_homeserver_address }}
# The domain of the homeserver (for MXIDs, etc). # The domain of the homeserver (for MXIDs, etc).
domain: example.com domain: {{ matrix_mautrix_twitter_homeserver_domain }}
# Whether or not to verify the SSL certificate of the homeserver. # Whether or not to verify the SSL certificate of the homeserver.
# Only applies if address starts with https:// # Only applies if address starts with https://
verify_ssl: true verify_ssl: true
@ -13,7 +14,7 @@ homeserver:
# Changing these values requires regeneration of the registration. # Changing these values requires regeneration of the registration.
appservice: appservice:
# The address that the homeserver can use to connect to this appservice. # The address that the homeserver can use to connect to this appservice.
address: http://localhost:29327 address: {{ matrix_mautrix_twitter_appservice_address }}
# When using https:// the TLS certificate and key files for the address. # When using https:// the TLS certificate and key files for the address.
tls_cert: false tls_cert: false
tls_key: false tls_key: false
@ -26,7 +27,7 @@ appservice:
max_body_size: 1 max_body_size: 1
# The full URI to the database. Only Postgres is currently supported. # The full URI to the database. Only Postgres is currently supported.
database: postgres://username:password@hostname/db database: {{ matrix_mautrix_twitter_appservice_database|to_json }}
# Additional arguments for asyncpg.create_pool() # Additional arguments for asyncpg.create_pool()
# https://magicstack.github.io/asyncpg/current/api/index.html#asyncpg.pool.create_pool # https://magicstack.github.io/asyncpg/current/api/index.html#asyncpg.pool.create_pool
database_opts: database_opts:
@ -47,7 +48,7 @@ appservice:
# The unique ID of this appservice. # The unique ID of this appservice.
id: twitter id: twitter
# Username of the appservice bot. # Username of the appservice bot.
bot_username: twitterbot bot_username: {{ matrix_mautrix_twitter_appservice_bot_username|to_json }}
# Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty # Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty
# to leave display name/avatar as-is. # to leave display name/avatar as-is.
bot_displayname: Twitter bridge bot bot_displayname: Twitter bridge bot
@ -65,8 +66,8 @@ appservice:
ephemeral_events: false ephemeral_events: false
# Authentication tokens for AS <-> HS communication. Autogenerated; do not modify. # Authentication tokens for AS <-> HS communication. Autogenerated; do not modify.
as_token: "This value is generated when generating the registration" as_token: "{{ matrix_mautrix_twitter_appservice_token }}"
hs_token: "This value is generated when generating the registration" hs_token: "{{ matrix_mautrix_twitter_homeserver_token }}"
# Prometheus telemetry config. Requires prometheus-client to be installed. # Prometheus telemetry config. Requires prometheus-client to be installed.
metrics: metrics:
@ -99,8 +100,7 @@ bridge:
# Allow using double puppeting from any server with a valid client .well-known file. # Allow using double puppeting from any server with a valid client .well-known file.
double_puppet_allow_discovery: false double_puppet_allow_discovery: false
# Servers to allow double puppeting from, even if double_puppet_allow_discovery is false. # Servers to allow double puppeting from, even if double_puppet_allow_discovery is false.
double_puppet_server_map: double_puppet_server_map: {}
example.com: https://example.com
# Shared secret for https://github.com/devture/matrix-synapse-shared-secret-auth # Shared secret for https://github.com/devture/matrix-synapse-shared-secret-auth
# #
# If set, custom puppets will be enabled automatically for local users # If set, custom puppets will be enabled automatically for local users
@ -108,8 +108,7 @@ bridge:
# manually. # manually.
# If using this for other servers than the bridge's server, # If using this for other servers than the bridge's server,
# you must also set the URL in the double_puppet_server_map. # you must also set the URL in the double_puppet_server_map.
login_shared_secret_map: login_shared_secret_map: {{ matrix_mautrix_twitter_bridge_login_shared_secret_map|to_json }}
example.com: foo
# Whether or not created rooms should have federation enabled. # Whether or not created rooms should have federation enabled.
# If false, created portal rooms will never be federated. # If false, created portal rooms will never be federated.
federate_rooms: true federate_rooms: true
@ -181,8 +180,7 @@ bridge:
# domain - All users on that homeserver # domain - All users on that homeserver
# mxid - Specific user # mxid - Specific user
permissions: permissions:
"example.com": "user" '{{ matrix_mautrix_twitter_homeserver_domain }}': user
"@admin:example.com": "admin"
# Python logging configuration. # Python logging configuration.
@ -198,12 +196,6 @@ logging:
normal: normal:
format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s" format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s"
handlers: handlers:
file:
class: logging.handlers.RotatingFileHandler
formatter: normal
filename: ./mautrix-twitter.log
maxBytes: 10485760
backupCount: 10
console: console:
class: logging.StreamHandler class: logging.StreamHandler
formatter: colored formatter: colored
@ -214,4 +206,4 @@ logging:
level: INFO level: INFO
root: root:
level: DEBUG level: DEBUG
handlers: [file, console] handlers: [console]