-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Internal Admin API and Draupnir Hjack Command Config #3389
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2747,6 +2747,8 @@ matrix_bot_draupnir_container_image_self_build: "{{ matrix_architecture not in [ | |
|
||
matrix_bot_draupnir_container_network: "{{ matrix_addons_container_network }}" | ||
|
||
matrix_bot_draupnir_admin_api_enabled: "{{ matrix_bot_draupnir_room_hijack_enabled }}" | ||
|
||
matrix_bot_draupnir_container_additional_networks_auto: |- | ||
{{ | ||
([] if matrix_addons_homeserver_container_network == '' else [matrix_addons_homeserver_container_network]) | ||
|
@@ -4307,6 +4309,7 @@ matrix_synapse_container_labels_public_client_root_redirection_enabled: "{{ matr | |
matrix_synapse_container_labels_public_client_root_redirection_url: "{{ (('https://' if matrix_playbook_ssl_enabled else 'http://') + matrix_server_fqn_element) if matrix_client_element_enabled else '' }}" | ||
|
||
matrix_synapse_container_labels_public_client_synapse_admin_api_enabled: "{{ matrix_synapse_admin_enabled }}" | ||
matrix_synapse_container_labels_internal_client_synapse_admin_api_enabled: "{{ matrix_bot_draupnir_admin_api_enabled }}" | ||
|
||
matrix_synapse_container_labels_public_federation_api_traefik_hostname: "{{ matrix_server_fqn_matrix_federation }}" | ||
matrix_synapse_container_labels_public_federation_api_traefik_entrypoints: "{{ matrix_federation_traefik_entrypoint_name }}" | ||
|
@@ -4466,6 +4469,7 @@ matrix_synapse_reverse_proxy_companion_container_labels_traefik_hostname: "{{ ma | |
|
||
matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_client_api_enabled: "{{ matrix_synapse_container_labels_public_client_synapse_client_api_enabled }}" | ||
matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_admin_api_enabled: "{{ matrix_synapse_container_labels_public_client_synapse_admin_api_enabled }}" | ||
matrix_synapse_reverse_proxy_companion_container_labels_internal_client_synapse_admin_api_enabled: "{{ matrix_synapse_container_labels_internal_client_synapse_admin_api_enabled }}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Like There should be a definition with some default value ( |
||
|
||
matrix_synapse_reverse_proxy_companion_container_labels_public_federation_api_traefik_entrypoints: "{{ matrix_synapse_container_labels_public_federation_api_traefik_entrypoints }}" | ||
matrix_synapse_reverse_proxy_companion_container_labels_public_federation_api_traefik_tls: "{{ matrix_synapse_container_labels_public_federation_api_traefik_tls }}" | ||
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -119,6 +119,44 @@ traefik.http.routers.matrix-synapse-reverse-proxy-companion-public-client-synaps | |||
############################################################ | ||||
{% endif %} | ||||
|
||||
{% if matrix_synapse_reverse_proxy_companion_container_labels_internal_client_synapse_admin_api_enabled %} | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems like For the "public" exposure of these, we have dedicated variables: So it's odd to have a single variable ( I suggest to create an additional variable ( Of course, you can wire the new variable ( I don't know if Draupnir room hijacking requires both You've added labels to Similar labels should be added to
The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I should note that when it comes to this PR i am blindly taking the labels from the issue in question. So like it makes sense that these flaws exist. And i need to thank you for this very thuroughly written review. I will try to take a look at this during the week to see how much of this stuff i can fix on my own based on all this valuable feedback and trying to look at other roles more closely to understand how they are plumbed. (Primarily Synapse admin i think i will need to look closer at as i think it helps a lot.) As for the exact API surface Draupnir needs for its admin commands i will come back with an answer on that front as i honestly dont know but i know i can find out. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's understandable! Thank you for looking into it! |
||||
############################################################ | ||||
# # | ||||
# Internal Synapse Admin API (/_synapse/client) # | ||||
# # | ||||
############################################################ | ||||
|
||||
traefik.http.routers.matrix-synapse-reverse-proxy-companion-internal-client-synapse-client-api.rule=PathPrefix(`/_synapse/client`) | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It'd be better if the rule is coming from a variable ( Here's an example: matrix-docker-ansible-deploy/roles/custom/matrix-synapse-reverse-proxy-companion/defaults/main.yml Line 78 in e000cbf
You may even consider adding a |
||||
|
||||
|
||||
traefik.http.routers.matrix-synapse-reverse-proxy-companion-internal-client-synapse-client-api.service=matrix-synapse-reverse-proxy-companion-client-api | ||||
traefik.http.routers.matrix-synapse-reverse-proxy-companion-internal-client-synapse-client-api.entrypoints=matrix-internal-matrix-client-api | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It'd be better if the entrypoints are coming from a variable ( Then, matrix_synapse_reverse_proxy_companion_container_labels_internal_client_synapse_admin_api_traefik_entrypo: "{{ matrix_playbook_internal_matrix_client_api_traefik_entrypoint_name }}" Here's an example:
|
||||
|
||||
############################################################ | ||||
# # | ||||
# /Internal Synapse Admin API (/_synapse/client) # | ||||
# # | ||||
############################################################ | ||||
|
||||
|
||||
############################################################ | ||||
# # | ||||
# Internal Synapse Admin API (/_synapse/admin) # | ||||
# # | ||||
############################################################ | ||||
|
||||
traefik.http.routers.matrix-synapse-reverse-proxy-companion-internal-client-synapse-admin-api.rule=PathPrefix(`/_synapse/admin`) | ||||
|
||||
|
||||
traefik.http.routers.matrix-synapse-reverse-proxy-companion-internal-client-synapse-admin-api.service=matrix-synapse-reverse-proxy-companion-client-api | ||||
traefik.http.routers.matrix-synapse-reverse-proxy-companion-internal-client-synapse-admin-api.entrypoints=matrix-internal-matrix-client-api | ||||
Comment on lines
+148
to
+152
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as for |
||||
|
||||
############################################################ | ||||
# # | ||||
# /Internal Synapse Admin API (/_synapse/admin) # | ||||
# # | ||||
############################################################ | ||||
{% endif %} | ||||
|
||||
{% if matrix_synapse_reverse_proxy_companion_container_labels_public_federation_api_enabled %} | ||||
############################################################ | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
matrix_synapse_container_labels_internal_client_synapse_admin_api_enabled
variable is written to here, but it's not defined indefaults/main.yml
in thematrix-synapse
role.There should be a definition with some default value (
false
) there.