Kim Alvefur
c98a6d205e
util.dependencies: Prefer net.unbound over net.adns
6 years ago
Kim Alvefur
57253b7f87
util.dependencies: Add awareness of luaunbound
6 years ago
Kim Alvefur
49dd598e71
util.dns: Library for decoding DNS records
...
Imported from luaunbound-prosody 5f7c771138b1
7 years ago
Kim Alvefur
bd36651336
util.startup: Remove duplicated initialization of logging ( fix #1527 )
6 years ago
Kim Alvefur
15227ecbc6
util.adminstream: Prevent closure on read timeout
6 years ago
Kim Alvefur
3077309ce7
util.prosodyctl.shell: Collect extra return values
...
Forgot in previous commit
6 years ago
Kim Alvefur
e2685cad2f
util.prosodyctl.shell: Handle argument parsing errors
...
While almost identical to the handling in util.startup, this seems more
appropriate. It would also simplify if shell-specific options need to be
handled in the future.
6 years ago
Kim Alvefur
2b2f9903ae
util.argparse: Move exiting and error to util.startup
...
It's not so nice to have a library that exits the entire application
from under you, so this and the error reporting belongs in util.startup.
The argparse code was originally in util.startup but moved out in
1196f1e8d178 but the error handling should have stayed.
6 years ago
Matthew Wild
7c632da844
util.gc: Linter fixes [luacheck]
6 years ago
Matthew Wild
758df8e14d
util.startup: Configure the GC on startup, using the config or built-in defaults
6 years ago
Matthew Wild
63ce191722
util.gc: New module for configuring the Lua garbage collector
6 years ago
Kim Alvefur
9ea29301ad
util.prosodyctl.check: Fix traceback by handling SRV '.' target to
...
The IDNA to-ASCII operation returns nil in this case, which causes an
error in net.dns
6 years ago
Matthew Wild
020454b7a3
util.async: Don't attempt to close thread if not created yet
6 years ago
Matthew Wild
3c53df7847
util.async: Call coroutine.close() on dead threads (Lua 5.4)
6 years ago
Matthew Wild
9691969c44
util.async: Rename wait -> wait_for (w/compat)
...
Agreed this name is clearer and wait_for(thing) reads well in code.
6 years ago
Kim Alvefur
9dfc424f2e
util.statsd: Update for API change
...
See change d75d805c852f to util.statistics
6 years ago
Matthew Wild
9e0186b0ed
util.promise: Add all_settled, which follows semantics of allSettled from ES2020
6 years ago
Kim Alvefur
b50db46086
util.sslconfig: Process TLS 1.3-specific cipher list
...
Same way as with other cipher list options
6 years ago
Kim Alvefur
4a0cb5a306
util.human.io: Fix right-alignment
6 years ago
Kim Alvefur
9b70ffb0ca
util.human.io.table: Allow a map callaback per column
...
This allows e.g. mapping booleans to "yes" or "no", specific number
formatting or generating virtual columns. All while not mutating the
underlying data or creating additional temporary tables.
6 years ago
Kim Alvefur
4e554bc4d1
util.human.io: Consider separator when calculating remaining width
6 years ago
Kim Alvefur
87777b26af
util.human.io: Use literal ellipsis instead of \u escape
...
For compat with Lua 5.2 and before
6 years ago
Kim Alvefur
435cd19373
util.human.io: Replace overflow with ellipsis
6 years ago
Kim Alvefur
ad3d047685
util.human.io: Draw a separator between columns
6 years ago
Matthew Wild
bec20ff0b4
util.dependencies: Use util.human.io.table to replace custom layout code
6 years ago
Matthew Wild
1b30a8e979
util.human.io: Remove padding option and use $COLUMNS as default width
6 years ago
Kim Alvefur
8c7811ec43
util.human.units: Factor out function for getting multiplier
6 years ago
Kim Alvefur
a6c4ce73ef
util.adminstream: Set a read timeout handler
...
So that net.server doesn't close the connection on inactivity.
6 years ago
Matthew Wild
19b7e38e1c
util.human.io: table: Fix title printing when columns use named keys
6 years ago
Matthew Wild
b4ec6112e4
util.array: pluck: Support default value to avoid holes
6 years ago
Matthew Wild
7b7084ad68
util.human.io: table: Return title row when no row data passed
6 years ago
Matthew Wild
8467f4f9ea
util.human.io: table: switch row function to simply returning prepared row string
6 years ago
Matthew Wild
56c159d7c9
util.adminstream: Fire event based on stanza name too for convenience
6 years ago
Matthew Wild
baf9f5aeef
util.human.io: Add padleft, padright and a table printing function
6 years ago
Kim Alvefur
b2ad87f966
util.human.units: Handle lack of math.log(n, base) on Lua 5.1
6 years ago
Kim Alvefur
b73cad7f8e
util.human.units: Put math functions into locals
...
Primarily because the next commit will deal with math.log behaving
differently on Lua 5.1 and that's eaiser with locals.
6 years ago
Kim Alvefur
b95b0e6026
util.human.units: Handle location of unpack() in Lua 5.1
6 years ago
Kim Alvefur
a7083d1ded
util.sasl.plain: Apply saslprep to stored password
...
Fixes something like #1560 here too.
The password sent by the user already had saslprep applied.
6 years ago
Kim Alvefur
5dd049acf0
util.sasl.scram: Apply saslprep before hashing password, fixes #1560
6 years ago
Kim Alvefur
375b817e8a
util.prosodyctl: Tell prosody do daemonize via command line flag ( fixes #1514 )
...
Backport of 88be11e9f9b9
6 years ago
Kim Alvefur
d8fda82e40
util.datamanager: Fix iterating over "users" (thanks marc0s)
...
The 'store' path componend used to be unescaped until 756a2a00e7e7 added
escaping to address issues with characters like '/' used in PEP, but
with a special case for '_' which was already in common use in 'store'
path components.
Missed adding this escaping here.
6 years ago
Matthew Wild
73355a4f31
util.startup: Ensure prosody.opts exists even when no options provided
6 years ago
Matthew Wild
0d5f5c9229
util.startup: Remove accidentally-committed debugging
6 years ago
Matthew Wild
704acb8b7a
util.startup: Fix logic to make --config work again
6 years ago
Matthew Wild
e52171b0cd
prosody/util.startup: Switch to parse_args() for --root and --config
6 years ago
Matthew Wild
ec3865fa9d
util.startup: Add startup step for parsing command-line options
6 years ago
Kim Alvefur
994f59501b
util.human.units: A library for formatting numbers with SI units
7 years ago
Kim Alvefur
f10b1ff165
util.statistics: Unify API of methods to include a config table
...
The primary goal here is to allow specifying an unit that each
statistic is measured in.
7 years ago
Kim Alvefur
6264bd48c1
util.prosodyctl.shell: Save readline history
6 years ago
Matthew Wild
9aebf2d7db
util.adminstream: Import net.server [luacheck]
6 years ago