Mercurial > prosody-modules
annotate mod_block_registrations/README.md @ 6562:5da6fb562df9 default tip
mod_unified_push: Fix push error handling (fixes #2000)
Use the error object that send_iq() passes
as an argument to it's reject callback instead of attempting
and failing to do the parsing in the callback itself.
| author | kmq |
|---|---|
| date | Mon, 06 Jul 2026 14:23:57 +0200 |
| parents | cdb9c2616c05 |
| children |
| rev | line source |
|---|---|
|
1803
4d73a1a6ba68
Convert all wiki pages to Markdown
Kim Alvefur <zash@zash.se>
parents:
1782
diff
changeset
|
1 Introduction |
|
4d73a1a6ba68
Convert all wiki pages to Markdown
Kim Alvefur <zash@zash.se>
parents:
1782
diff
changeset
|
2 ============ |
| 1782 | 3 |
|
1803
4d73a1a6ba68
Convert all wiki pages to Markdown
Kim Alvefur <zash@zash.se>
parents:
1782
diff
changeset
|
4 On a server with public registration it is usually desirable to prevent |
|
4d73a1a6ba68
Convert all wiki pages to Markdown
Kim Alvefur <zash@zash.se>
parents:
1782
diff
changeset
|
5 registration of certain "reserved" accounts, such as "admin". |
| 1782 | 6 |
|
1803
4d73a1a6ba68
Convert all wiki pages to Markdown
Kim Alvefur <zash@zash.se>
parents:
1782
diff
changeset
|
7 This plugin allows you to reserve individual usernames, or those |
|
4d73a1a6ba68
Convert all wiki pages to Markdown
Kim Alvefur <zash@zash.se>
parents:
1782
diff
changeset
|
8 matching certain patterns. It also allows you to ensure that usernames |
|
4d73a1a6ba68
Convert all wiki pages to Markdown
Kim Alvefur <zash@zash.se>
parents:
1782
diff
changeset
|
9 conform to a certain pattern. |
| 1782 | 10 |
|
1803
4d73a1a6ba68
Convert all wiki pages to Markdown
Kim Alvefur <zash@zash.se>
parents:
1782
diff
changeset
|
11 Configuration |
|
4d73a1a6ba68
Convert all wiki pages to Markdown
Kim Alvefur <zash@zash.se>
parents:
1782
diff
changeset
|
12 ============= |
| 1782 | 13 |
| 14 Enable the module as any other: | |
| 15 | |
|
6405
cdb9c2616c05
mod_block_registrations: Enable syntax highlighting in examples
Kim Alvefur <zash@zash.se>
parents:
6404
diff
changeset
|
16 ``` lua |
|
cdb9c2616c05
mod_block_registrations: Enable syntax highlighting in examples
Kim Alvefur <zash@zash.se>
parents:
6404
diff
changeset
|
17 modules_enabled = { |
|
cdb9c2616c05
mod_block_registrations: Enable syntax highlighting in examples
Kim Alvefur <zash@zash.se>
parents:
6404
diff
changeset
|
18 "block_registrations"; |
|
cdb9c2616c05
mod_block_registrations: Enable syntax highlighting in examples
Kim Alvefur <zash@zash.se>
parents:
6404
diff
changeset
|
19 } |
|
cdb9c2616c05
mod_block_registrations: Enable syntax highlighting in examples
Kim Alvefur <zash@zash.se>
parents:
6404
diff
changeset
|
20 ``` |
| 1782 | 21 |
| 22 You can then set some options to configure your desired policy: | |
| 23 | |
|
6404
a1df76ba4f68
mod_block_registrations: Add username length requirements
Kim Alvefur <zash@zash.se>
parents:
6322
diff
changeset
|
24 Option Default Description |
|
a1df76ba4f68
mod_block_registrations: Add username length requirements
Kim Alvefur <zash@zash.se>
parents:
6322
diff
changeset
|
25 ------------------------------------ ------------------- ----------------------------------------------------------------------------------------------------------------------------------------------- |
|
a1df76ba4f68
mod_block_registrations: Add username length requirements
Kim Alvefur <zash@zash.se>
parents:
6322
diff
changeset
|
26 block_registrations_users *See source code* A list of reserved usernames |
|
a1df76ba4f68
mod_block_registrations: Add username length requirements
Kim Alvefur <zash@zash.se>
parents:
6322
diff
changeset
|
27 block_registrations_matching `{ }` A list of [Lua patterns](http://www.lua.org/manual/5.1/manual.html#5.4.1) matching reserved usernames (slower than block_registrations_users) |
|
a1df76ba4f68
mod_block_registrations: Add username length requirements
Kim Alvefur <zash@zash.se>
parents:
6322
diff
changeset
|
28 block_registrations_require `nil` A pattern that registered user accounts MUST match to be allowed |
|
a1df76ba4f68
mod_block_registrations: Add username length requirements
Kim Alvefur <zash@zash.se>
parents:
6322
diff
changeset
|
29 block_registrations_confusable `true` Block usernames that look similar to the reserved usernames (requires Prosody be built with ICU) |
|
a1df76ba4f68
mod_block_registrations: Add username length requirements
Kim Alvefur <zash@zash.se>
parents:
6322
diff
changeset
|
30 block_registrations_length_minimum `1` Block usernames that are shorter than the given length |
|
a1df76ba4f68
mod_block_registrations: Add username length requirements
Kim Alvefur <zash@zash.se>
parents:
6322
diff
changeset
|
31 block_registrations_length_maximum `255` Block usernames that are longer than the given length |
| 1782 | 32 |
| 33 Some examples: | |
| 34 | |
|
6405
cdb9c2616c05
mod_block_registrations: Enable syntax highlighting in examples
Kim Alvefur <zash@zash.se>
parents:
6404
diff
changeset
|
35 ``` lua |
|
cdb9c2616c05
mod_block_registrations: Enable syntax highlighting in examples
Kim Alvefur <zash@zash.se>
parents:
6404
diff
changeset
|
36 block_registrations_users = { "admin", "root", "xmpp" } |
|
cdb9c2616c05
mod_block_registrations: Enable syntax highlighting in examples
Kim Alvefur <zash@zash.se>
parents:
6404
diff
changeset
|
37 block_registrations_matching = { |
|
cdb9c2616c05
mod_block_registrations: Enable syntax highlighting in examples
Kim Alvefur <zash@zash.se>
parents:
6404
diff
changeset
|
38 "master$" -- matches anything ending with master: postmaster, hostmaster, webmaster, etc. |
|
cdb9c2616c05
mod_block_registrations: Enable syntax highlighting in examples
Kim Alvefur <zash@zash.se>
parents:
6404
diff
changeset
|
39 } |
|
cdb9c2616c05
mod_block_registrations: Enable syntax highlighting in examples
Kim Alvefur <zash@zash.se>
parents:
6404
diff
changeset
|
40 block_registrations_require = "^[a-zA-Z0-9_.-]+$" -- Allow only simple ASCII characters in usernames |
|
cdb9c2616c05
mod_block_registrations: Enable syntax highlighting in examples
Kim Alvefur <zash@zash.se>
parents:
6404
diff
changeset
|
41 ``` |
|
1803
4d73a1a6ba68
Convert all wiki pages to Markdown
Kim Alvefur <zash@zash.se>
parents:
1782
diff
changeset
|
42 |
|
4d73a1a6ba68
Convert all wiki pages to Markdown
Kim Alvefur <zash@zash.se>
parents:
1782
diff
changeset
|
43 Compatibility |
|
4d73a1a6ba68
Convert all wiki pages to Markdown
Kim Alvefur <zash@zash.se>
parents:
1782
diff
changeset
|
44 ============= |
| 1782 | 45 |
|
5422
72f23107beb4
mod_block_registrations: Refresh Compatibility section
Kim Alvefur <zash@zash.se>
parents:
5421
diff
changeset
|
46 ------ ------- |
|
6322
f110bce35630
mod_block_registrations: Support blocking confusable usernames (UTS 39)
Kim Alvefur <zash@zash.se>
parents:
5975
diff
changeset
|
47 13.0 Should work (please test) |
|
5422
72f23107beb4
mod_block_registrations: Refresh Compatibility section
Kim Alvefur <zash@zash.se>
parents:
5421
diff
changeset
|
48 0.12 Works |
|
72f23107beb4
mod_block_registrations: Refresh Compatibility section
Kim Alvefur <zash@zash.se>
parents:
5421
diff
changeset
|
49 ------ ------- |
