aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* util.startup: Support systemd Type=notify service typeKim Alvefur2024-04-042-0/+35
| | | | | | | | | | | | | This lets Prosody report its lifecycle status to systemd, so it knows when Prosody has completed its startup, when it's reloading and shutting down. Both Type=notify and Type=notify-reload is supported Example systemd .service configuration snippet: [Service] Type=notify
* MUC: Fix legacy hats (thanks nicoco)Kim Alvefur2024-03-281-2/+8
| | | | Why do we not have tests for this?
* MUC: Switch to official XEP-0317 namespace for Hats (including compat) ↵Kim Alvefur2024-03-282-3/+12
| | | | (thanks nicoco)
* util.startup: Fix exiting on pidfile troubleKim Alvefur2024-03-271-3/+3
| | | | | | | | | | | prosody.shutdown() relies on prosody.main_thread, which has not been set yet at this point. Doing a clean shutdown might actually be harmful in case it tears down things set up by the conflicting Prosody, such as the very pidfile we were looking at. Thanks again SigmaTel71 for noticing
* Merge 0.12->trunkMatthew Wild2024-03-271-0/+51
|\
| * prosodyctl check: Warn about invalid domain names in the config fileMatthew Wild2024-03-271-0/+51
| | | | | | | | | | This ensures that domain names of virtual hosts and components are valid in XMPP, and that they are encoded correctly.
* | util.startup: Abort before initialization of logging when started as rootKim Alvefur2024-03-241-3/+3
| | | | | | | | | | Prevents creation of log files owned by the root user which could be inaccessible once started correctly.
* | util.startup: Don't use not yet existent shutdown procedure when started as ↵Kim Alvefur2024-03-241-1/+1
| | | | | | | | root (thanks SigmaTel71)
* | util.startup: Check root after detecting platform and reading config (thanks ↵Kim Alvefur2024-03-241-1/+1
| | | | | | | | | | | | | | | | SigmaTel71) Ensures that startup.detect_platform() runs so know whether to use the POSIX method of checking the current user or something else. Also after reading the config so we know whether the root override setting is set.
* | mod_posix: Move everything to util.startupKim Alvefur2024-03-232-121/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows greater control over the order of events. Notably, the internal ordering between daemonization, initialization of libunbound and setup of signal handling is sensitive. libunbound starts a separate thread for processing DNS requests. If this thread is started before signal handling has been set up, it will not inherit the signal handlers and instead behave as it would have before signal handlers were set up, i.e. cause the whole process to immediately exit. libunbound is usually initialized on the first DNS request, usually triggered by an outgoing s2s connection attempt. If daemonization happens before signals have been set up, signals may not be processed at all.
* | mod_bosh: Set base_type on sessionMatthew Wild2024-03-171-1/+1
| | | | | | | | | | This fixes a traceback with mod_saslauth. Ideally we move this to util.session at some point, though.
* | util.startup: Back out 598df17b8ebbKim Alvefur2024-03-101-1/+1
| | | | | | | | | | | | | | | | Broke signal handling again, such that an early s2s connection results in libunbound catching signals and getting Prosody killed on e.g. SIGHUP This returns to the situation where prosody --daemonize does not respond to signals.
* | util.startup: Hook signals after daemonizationKim Alvefur2024-03-061-1/+1
| | | | | | | | | | | | signalfds stop working with epoll after forking hooking signals later should not affect anything
* | mod_pubsub: Ignore shadowed variable [luacheck]Kim Alvefur2024-03-061-0/+1
| |
* | mod_pubsub: Add shell commands to create and list nodesMatthew Wild2024-03-061-0/+42
| |
* | core.features: Advertise that events are fired for SIGUSR1/2Kim Alvefur2024-03-021-0/+3
| | | | | | | | Moved here from mod_posix since these events no longer originate there
* | util.startup: Fix firing of USR1/2 eventsKim Alvefur2024-03-021-2/+2
| |
* | net.server: Restore epoll signalfd handlingKim Alvefur2024-03-021-5/+0
| | | | | | | | Reverts 4a9a69659727
* | mod_posix: Move POSIX signal handling into util.startup to avoid raceKim Alvefur2024-03-022-50/+43
| | | | | | | | | | | | | | | | | | | | When libunbound is initialized, it spawns a thread to work in. In case a module initializes libunbound, e.g. by triggering a s2s connection, Prosody would not handle signals, instead immediately quit on e.g. the reload (SIGHUP) signal. Likely because the libunbound thread would not have inherited the signal mask from the main Prosody thread. Thanks Menel, riau and franck-x for reporting and help narrowing down
* | net.server: Disable epoll signalfd handling by default until problems resolvedKim Alvefur2024-03-011-0/+5
| |
* | net.server_epoll: Log creation of signalfd handles at noise levelKim Alvefur2024-03-011-0/+1
| | | | | | | | To aid in tracking down signalfd-related problems
* | util.bit53: Add bnot() methodMatthew Wild2024-03-012-0/+7
| |
* | util.signal: Fail signalfd() if unable to change signal maskKim Alvefur2024-02-281-1/+4
| | | | | | | | | | By aborting early, the failure should be brought to the attention somehow.
* | net.server_epoll: Log failure to hook signalsKim Alvefur2024-02-281-1/+6
| | | | | | | | To make any such failures noticeable
* | Merge 0.12->trunkKim Alvefur2024-02-271-1/+1
|\|
| * net.http.files: Validate argument to setup functionKim Alvefur2024-02-271-1/+1
| | | | | | | | Fixes error in #1765 by throwing an error earlier
* | mod_s2s: Comment on why we avoid hostnames in stanza bounce messagesKim Alvefur2024-02-241-0/+2
| |
* | mod_cron: Fix log format to account for float that was integer beforeKim Alvefur2024-02-242-2/+2
| |
* | mod_cron: Sync Teal source with 92301fa7a673Kim Alvefur2024-02-241-2/+10
| | | | | | | | | | Yeah, it's weird to have two versions. Needing more build dependencies is also something we want to avoid, so here we are.
* | util.signal: Wrap signalfd in an userdatum for gc handling etcKim Alvefur2024-02-242-9/+63
| |
* | net.server_epoll: Support hooking signals via signalfdKim Alvefur2024-02-241-0/+15
| | | | | | | | | | | | Handling signal events the same way as all other events makes sense and seems safer than the signal handling just jumping around in C and messing with Lua states.
* | util.signal: Add support for signalfd(2) on LinuxKim Alvefur2024-02-241-0/+34
| | | | | | | | | | | | | | | | | | signalfd allows handling signal events using the same method as sockets, via file descriptors. Thus all signal dispatch can go through the same main event loop as everything else, removing need for thread-scary signal handling where execution would just jump to the signal handler regardless of the state of Lua, and needing to keep track of Lua states/threads.
* | features: Add mod_server_infoMatthew Wild2024-02-231-0/+2
| |
* | mod_server_contact_info: Update to publish fields via new mod_server_infoMatthew Wild2024-02-231-12/+25
| |
* | mod_server_info: New module to manage the serverinfo disco extension formMatthew Wild2024-02-231-0/+55
| | | | | | | | | | | | | | | | This allows multiple modules to populate the form dynamically. Currently the form is "owned" by mod_server_contact_info, which prevents other modules from contributing to it. A further commit will port mod_server_contact_info to use this module.
* | util.strbitop: Add common_prefix_bits() to Teal interface descriptionKim Alvefur2024-02-231-0/+1
| |
* | util.hashes: Add missing entries to Teal interface descriptionKim Alvefur2024-02-231-2/+6
| | | | | | | | Also sorted to match C source
* | util.crypto: Update Teal interface description to match C sourcesKim Alvefur2024-02-231-12/+40
| | | | | | | | | | | | Was missing some entries. Rearranged to match order of entries in the C source Reg table.
* | tools/test_mutants.sh: Load loader helper when running bustedMatthew Wild2024-02-231-1/+1
| |
* | util.ip: Remove ip.bits and related code, switch to more efficient strbitopMatthew Wild2024-02-231-22/+6
| | | | | | | | 100,000 iterations of match() on my laptop from 3.5s -> 0.5s.
* | util.strbitop: Remove unused import in testsMatthew Wild2024-02-231-1/+1
| |
* | util.strbitop: Add common_prefix_bits() methodMatthew Wild2024-02-232-0/+81
| | | | | | | | | | This returns the number of bits that two strings have in common. It is significantly more efficient than similar calculations in Lua.
* | util.ip: Add another test case for match() and commonPrefixLength()Matthew Wild2024-02-231-0/+4
| |
* | util.strbitop: Rename spec file to correct name so tests actually runMatthew Wild2024-02-231-0/+0
| |
* | util.rfc6724: Remove, unused since introduction of Happy EyeballsKim Alvefur2024-02-224-239/+1
| | | | | | | | | | | | | | | | It was mainly used to determine whether to try IPv6 or IPv4 first, following the rules for this in the RFC. Now we always try IPv6 and IPv4 at roughly the same time, thus there no need to carry these rules.
* | features: Add module-ready (for commit e20949a10118)Matthew Wild2024-02-221-0/+3
| |
* | util.startup: Expose core.features.available as prosody.featuresMatthew Wild2024-02-221-0/+2
| | | | | | | | for convenience.
* | mod_s2s_auth_certs: Handle potential string errorKim Alvefur2024-02-211-3/+6
| | | | | | | | | | conn:ssl_peerverification() can now return a single error in case the connection has been closed for whatever reason
* | net.server_epoll: Prevent traceback when checking TLS after connection goneKim Alvefur2024-01-211-0/+5
| | | | | | | | Unclear why this would be done, but an error is not great.
* | mod_cron: Allow configuring various "internal" delay parametersMatthew Wild2024-02-201-2/+10
| | | | | | | | | | Notably, it is now possible to add a randomized spread factor to the check interval.