From 188314cb66bc331fab4102ab8619701b1174ccd4 Mon Sep 17 00:00:00 2001 From: Yannick Goossens Date: Sat, 27 Mar 2021 16:34:49 +0100 Subject: [PATCH] Sessions and realms are optional --- roles/matrix-bot-go-neb/defaults/main.yml | 4 ++-- roles/matrix-bot-go-neb/templates/config.yaml.j2 | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/roles/matrix-bot-go-neb/defaults/main.yml b/roles/matrix-bot-go-neb/defaults/main.yml index 758f9f01d..c8f59fa8f 100644 --- a/roles/matrix-bot-go-neb/defaults/main.yml +++ b/roles/matrix-bot-go-neb/defaults/main.yml @@ -68,7 +68,7 @@ matrix_bot_go_neb_clients: {} # Delete or modify this list as appropriate. # See the docs for /configureAuthRealm for the full list of options: # https://matrix-org.github.io/go-neb/pkg/github.com/matrix-org/go-neb/api/index.html#ConfigureAuthRealmRequest -matrix_bot_go_neb_realms: {} +#matrix_bot_go_neb_realms: # - ID: "github_realm" # Type: "github" # Config: {} # No need for client ID or Secret as Go-NEB isn't generating OAuth URLs @@ -78,7 +78,7 @@ matrix_bot_go_neb_realms: {} # The full list of options are shown below: there is no single HTTP endpoint # which maps to this section. # https://matrix-org.github.io/go-neb/pkg/github.com/matrix-org/go-neb/api/index.html#Session -matrix_bot_go_neb_sessions: {} +#matrix_bot_go_neb_sessions: # - SessionID: "your_github_session" # RealmID: "github_realm" # UserID: "@YOUR_USER_ID:{{ matrix_domain }}" # This needs to be the username of the person that's allowed to use the !github commands diff --git a/roles/matrix-bot-go-neb/templates/config.yaml.j2 b/roles/matrix-bot-go-neb/templates/config.yaml.j2 index c72dbf8df..fb2b05be7 100644 --- a/roles/matrix-bot-go-neb/templates/config.yaml.j2 +++ b/roles/matrix-bot-go-neb/templates/config.yaml.j2 @@ -25,16 +25,20 @@ clients: # Delete or modify this list as appropriate. # See the docs for /configureAuthRealm for the full list of options: # https://matrix-org.github.io/go-neb/pkg/github.com/matrix-org/go-neb/api/index.html#ConfigureAuthRealmRequest +{% if matrix_bot_go_neb_realms is defined %} realms: {{ matrix_bot_go_neb_realms|to_json }} +{% endif %} # The list of *authenticated* sessions which Go-NEB is aware of. # Delete or modify this list as appropriate. # The full list of options are shown below: there is no single HTTP endpoint # which maps to this section. # https://matrix-org.github.io/go-neb/pkg/github.com/matrix-org/go-neb/api/index.html#Session +{% if matrix_bot_go_neb_sessions is defined %} sessions: {{ matrix_bot_go_neb_sessions|to_json }} +{% endif %} # The list of services which Go-NEB is aware of. # Delete or modify this list as appropriate.