Kim Alvefur
32ce8884ba
mod_admin_shell: Make 'Role' column dynamically sized
...
Some of the new roles don't quite fit nicely into 4 characters
(excluding ellipsis). Given the ability to dynamically add additional
roles from the config and possibly from modules, it seems better to just
make it a relative size since we can't know how long they will be.
2 years ago
Matthew Wild
f7323ed6e4
core, plugins: Split prosody:user role into prosody:{guest,registered,member}
...
This gives us more granular control over different types of user account.
Accounts registered by IBR get assigned prosody:registered by default, while
accounts provisioned by an admin (e.g. via prosodyctl shell) will receive
prosody:member by default.
3 years ago
Kim Alvefur
46781dc892
mod_admin_shell: Use new serialize preset to simplify default config
...
Two pairs replaced by one. Blame lua-format for the line diff delta.
3 years ago
Kim Alvefur
9777b5158f
mod_admin_shell: Warn when (un-)loading module would be undone by restart
...
Reminder to update the configuration if the change is to be permanent.
3 years ago
Kim Alvefur
9480954e92
mod_admin_shell: Show internal URL where different from external
3 years ago
Kim Alvefur
ba878e7230
mod_admin_shell: Show internal URL in addition to external in http:list
...
To help with configuring reverse proxies.
3 years ago
Kim Alvefur
c71ab7f1ef
mod_admin_shell: Allow logging HTTP events with debug:logevents("http")
...
Mirroring debug:events("http"), and to replace the "Firing event: GET /"
log lines in net.http.server
3 years ago
Kim Alvefur
f3ec84d5ef
mod_admin_shell: Allow logging global events with debug:logevents("*")
...
Missing feature. It should behave like debug:events()
3 years ago
Kim Alvefur
8a854d169b
mod_admin_shell: Refactor 'cert' column
...
Removes some dead code and hopefully simplifies a bit.
There's a tree of possibilities with the two tri-state status
properties, something like
chain:
* nil -- cert validation disabled?
* invalid -- something wrong with the chain (including ee cert)
* valid -- chain ok
cert:
* nil -- incomplete validation??
* invalid -- mismatched names or such
* valid -- all good!
3 years ago
Kim Alvefur
2fc0c66f01
mod_admin_shell: Use same wildcard matching in other s2s command
...
Consistency is nice.
3 years ago
Kim Alvefur
f9f118178a
mod_admin_shell: Factor apart wildcard matching into function for reuse
...
Applying this for s2s:close[all]() would also be nice.
3 years ago
Kim Alvefur
dbb0c688cb
mod_admin_shell: Add config:set([host,] key, value) because why not
...
We had config:get() but not this.
> <MattJ> Yeah, why did we never implement that?
Handy if you want to quickly try out settings without reloading the
whole config.
3 years ago
Kim Alvefur
9f691e9796
mod_admin_shell: Allow wildcard matches like s2s:show("*.example.com")
...
E.g. if you want to show connections to/from a domain, including its
subdomains, this is handy.
3 years ago
Kim Alvefur
2fa6a01018
mod_admin_shell: Allow "*" as substitute for 'nil' for easier CLI usage
...
Since prosodyctl shell with additional arguments assumes the first two
are a section:command() and any following arguments are strings, passing
a bare 'nil' is not possible. In order to avoid delving into this rabbit
hole, instead produce a token that alone is not really a legal JID for
use as wildcard.
3 years ago
Kim Alvefur
f937942519
mod_admin_shell: Make IP column thinner if IPv6 is disabled
...
IPv6 addresses can be pretty long, so if they can be more compact,
that's nice.
But nobody would disable IPv6, would they?
3 years ago
Kim Alvefur
c490579025
mod_admin_shell: Make default column width 1 part
...
These gets used for usernames, resources and other random session fields
that don't have a column definition in `available_columns`
3 years ago
Kim Alvefur
65dffa88a8
mod_admin_shell: Fix attempt to compare number with string
...
Missed the # in 93c1590b5951
3 years ago
Kim Alvefur
44689ccfd4
mod_admin_shell: Dynamically size JIDs and hosts
...
Reasoning: a hostname is one part, a JID is 3 parts.
3 years ago
Kim Alvefur
ab15502d8b
mod_admin_shell: More dynamic widths calculations
3 years ago
Kim Alvefur
31427da24f
mod_admin_shell: Calculate widths of columns from example values
...
Harder to accidentally count wrong if Lua is doing the counting on a
plausible input.
3 years ago
Kim Alvefur
56cfc08952
mod_admin_shell: Strip 'prosody:' prefix to allow narrower Role column
3 years ago
Kim Alvefur
13084baa38
mod_admin_shell: Allow matching on host or bare JID in c2s:show
...
Only supporting exact match on full JID isn't helpful if you want to
list sessions per host or user.
3 years ago
Kim Alvefur
e53ef27a1c
core.usermanager: Correct formatting of not implemented error
...
Spaces, no hyphen, apparently.
3 years ago
Kim Alvefur
8720067f24
mod_admin_shell: Enable user after creation with role
...
Fixes that otherwise the user was created in a disabled state and left
as such.
3 years ago
Kim Alvefur
1d6989afb1
mod_admin_shell: Simplify user creation when no role given
...
Idea here is to prevent a user from being created with the default role
if a different role was given, but that dance wouldn't be needed if no
role is provided.
3 years ago
Kim Alvefur
98922d54b1
plugins: Prefix module imports with prosody namespace
3 years ago
Kim Alvefur
c425da3c6a
mod_admin_shell: Limit module dependency listings to loaded on current host
...
E.g. module:info("http") with many http modules loaded would show a lot
of duplication, as each module would be listed for each host, even if
not actually enabled on that host.
3 years ago
Kim Alvefur
283322543e
mod_admin_shell: Show reverse dependencies in module:info()
...
Why was this module loaded? Now you can find out!
3 years ago
Kim Alvefur
701fb4fce0
mod_admin_shell: Add commands to disable and enable accounts
...
First proper UI to enable/disable, allowing it to be tested.
3 years ago
Kim Alvefur
dc958f1e40
mod_admin_shell: Match substring in muc:affiliations() like muc:occupants()
...
Maybe one day we'll get consistent filtering semantics everywhere.
3 years ago
Kim Alvefur
1b71a53fb7
mod_admin_shell: Sort MUC users by relation and JID
...
Suggested by MattJ, our resident UI expert :)
3 years ago
Kim Alvefur
5c676bab58
mod_admin_shell: Make Role and Affiliation columns the same width for aesthetics
...
The length of the title "Affiliation" made them both close enough that
it looked off.
3 years ago
Kim Alvefur
6e120ad485
mod_admin_shell: Use tables to present MUC users
...
Tables are awesome!
3 years ago
Kim Alvefur
d5b5b5ba86
mod_admin_shell: Factor out room retrieval into common function
...
Justification: See diffstat
3 years ago
Kim Alvefur
08a730746c
mod_admin_shell: Add muc:affiliations(room) command to list memberships
...
Easier than going trough muc:room():each_affiliation() since you have to
do fiddly things to reach the print() function.
3 years ago
Kim Alvefur
2b0584d2ee
mod_admin_shell: Add muc:occupants(room) command to list occupants
...
Easier than going trough muc:room():each_occupant() since you have to do
fiddly things to reach the print() function.
3 years ago
Kim Alvefur
8b82dc338c
mod_admin_shell: Fix display of session without role (thanks Link Mauve)
...
This can happen to sessions before they are assigned a role
3 years ago
Kim Alvefur
95bba786f1
mod_admin_shell: Rename variable to avoid confusion with global function
...
For luacheck, but it doesn't actually complain about this right now
3 years ago
Kim Alvefur
b292127500
mod_admin_shell: Fix output from user:roles()
...
It used _G.print instead of the shell session print, which would
silently write to stdout
3 years ago
Kim Alvefur
96e172167d
mod_admin_shell: Ensure account has role before it is usable
...
By creating the account first without a password it can't be used until
the role has set. This is most important for restricted accounts, as a
failure to set the role would lead to the account having more privileges
than indented.
3 years ago
Kim Alvefur
6f11c198b3
mod_admin_shell: Update help for user:create to reflect singular role argument
3 years ago
Matthew Wild
4db3f8cf46
mod_admin_shell: Update with new role management commands and help text
3 years ago
Kim Alvefur
1fac00b2af
mod_admin_shell: Show session role in c2s:show
3 years ago
Kim Alvefur
0e7e43f62f
mod_admin_shell: Remove obsolete module:load() argument from 0.8 time
...
This 'config' argument was removed without explanation in d8dbf569766c
3 years ago
Kim Alvefur
5251c9b686
compat: Remove handling of Lua 5.1 location of 'unpack' function
4 years ago
Kim Alvefur
d0ab468f40
mod_admin_shell: Show session id ping reply came
...
To point out which one when more than one connection was established, or
if it's an existing connection, allows correlation with s2s:show() or
with logs.
4 years ago
Kim Alvefur
b0c116f47b
mod_admin_shell: Include last (mod_cron) task run time in module:info()
...
Don't think this is otherwise shown anywhere outside of debug logs
4 years ago
Kim Alvefur
3717f5872a
mod_admin_shell: Drop unused argument [luacheck]
4 years ago
Kim Alvefur
b7bd70874a
mod_admin_shell: Show bound ports in module:info
...
I.e. the subset of port:list() relevant to the specified module.
4 years ago
Kim Alvefur
8ba6d3a2b1
mod_admin_shell: Document the 'watch' section in the built-in help
4 years ago