# HG changeset patch # User Matthew Wild # Date 1611735386 0 # Node ID 85c11eb4331baf0cb06377c9579e5f8d4e099dac # Parent 52e1ab99d25e1406443cdc71acd1ff002463e9a7 mod_invites_page: Allow disabling of built-in pages with invites_page_external option diff -r 52e1ab99d25e -r 85c11eb4331b mod_invites_page/README.markdown --- a/mod_invites_page/README.markdown Tue Jan 26 22:04:43 2021 +0100 +++ b/mod_invites_page/README.markdown Wed Jan 27 08:16:26 2021 +0000 @@ -45,11 +45,12 @@ Configuration ============= -| Name | Description | Default | -|---------------------------|--------------------------------------------------------------------------------|------------------------------------------------------------| -| invites_page | The format of an invite page URL (must begin with `https://`) | `"https://{host}:5281/invites_page?{invite.token}"` | -| invites_registration_page | The format of an invite registration page URL (may be relative to invites_page)| `"register?t={invite.token}&c={app.id}"` | -| site_name | The friendly name of the server | `"example.com"` | +| Name | Description | Default | +|---------------------------|--------------------------------------------------------------------------------|-----------------------------------------------------| +| invites_page | The format of an invite page URL (must begin with `https://`) | `"https://{host}:5281/invites_page?{invite.token}"` | +| invites_registration_page | The format of an invite registration page URL (may be relative to invites_page)| `"register?t={invite.token}&c={app.id}"` | +| site_name | The friendly name of the server | `"example.com"` | +| invites_page_external | Set this to true if your invitation pages will be rendered by something else | `false` | The `invites_page` and `invites_registration_page` options are templates that support a number of variables. The most useful being `{host}` and @@ -60,3 +61,8 @@ behind a reverse proxy such as nginx or Apache, you will probably want to set `http_external_url` so that Prosody knows what URLs should look like for users. + +If you want to disable this module's built-in pages and use an external +invitation page generator (such as [ge0rg/easy-xmpp-invitation](https://github.com/ge0rg/easy-xmpp-invitation) +then set `invites_page_external = true` and set `invites_page` to the +appropriate URL for your installation. diff -r 52e1ab99d25e -r 85c11eb4331b mod_invites_page/mod_invites_page.lua --- a/mod_invites_page/mod_invites_page.lua Tue Jan 26 22:04:43 2021 +0100 +++ b/mod_invites_page/mod_invites_page.lua Wed Jan 27 08:16:26 2021 +0000 @@ -27,6 +27,9 @@ local site_name = module:get_option_string("site_name", module.host); local site_apps = module:shared("register_apps/apps"); +-- Enable/disable built-in invite pages +local external_only = module:get_option_boolean("invites_page_external", false); + local http_files; if prosody.shutdown then @@ -52,6 +55,10 @@ module:hook("invite-created", add_landing_url); +if external_only then + return; +end + local function render_app_urls(apps, invite_vars) local rendered_apps = {}; for _, unrendered_app in ipairs(apps) do