Matthew Wild
c07d15cf71
util.startup: Handle missing nparams field from debug info (not present in 5.1)
5 years ago
Kim Alvefur
c5933e9ed7
util.startup: Include arguments in function string representation
...
Improves usability of the console when digging around the internals.
No specific rationale for the function<file:line>(args) format, it
looked best of the variants I tried.
5 years ago
Kim Alvefur
9302a14d80
util.startup: Retrieve less data for function string representation
...
debug.getinfo(f) collects more info than what is needed here.
5 years ago
Kim Alvefur
f7f0a20abf
util.startup: Save the path used by the installer to prosody.paths
...
Makes it easier for other parts of the code to use this for things, such
as determining whether a certain module is from this path or from
elsewhere.
5 years ago
Kim Alvefur
4b4f32104f
util.startup: Fix startup failure if CFG_DATADIR is unset
...
As is normal when running from source
5 years ago
Kim Alvefur
defba34a6c
util.startup: Re-enable installer path setup
5 years ago
Kim Alvefur
e9c3e1dedc
util.startup: Put 'installer_plugin_path' under data directory by default
...
Fixes issue where it ends up creating this in $PWD, which might be
~prosody, ~you or /, depending on how it's invoked.
5 years ago
Matthew Wild
c313b10cd9
util.startup: Configure the GC on startup, using the config or built-in defaults
6 years ago
Kim Alvefur
bd36651336
util.startup: Remove duplicated initialization of logging ( fix #1527 )
6 years ago
Matthew Wild
fa462b8505
util.startup: Init util.error with defaults if none given
5 years ago
Matthew Wild
7507996371
util.error: Allow optional tracebacks to be injected on errors
...
This allows extra debug info to be provided for development purposes.
5 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
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
758df8e14d
util.startup: Configure the GC on startup, using the config or built-in defaults
6 years ago
Kim Alvefur
e199091987
util.startup: Break out command line argument parsing into util.argparse
...
This will allow using it from other places such as prosodyctl
sub-commands and plugins
6 years ago
Matthew Wild
028a6e499f
util.startup: expose current process type (prosody/prosodyctl) in the global prosody object
6 years ago
Kim Alvefur
bbb1aae80f
util.startup: Ignore unused errno variable [luacheck]
6 years ago
Kim Alvefur
91156ab5d9
util.startup: Ensure prosody.paths are absolute (see #1430 )
...
Normally these paths are injected into the installed 'prosody'
executable as absolute paths, but it is possible to override at least
the config path via environment variable or command line argument. This
makes sure a path relative to pwd stays relative to that instead of the
data directory.
6 years ago
Kim Alvefur
5e4bc6299b
util.startup: Update config path ( fixes #1430 )
6 years ago
Kim Alvefur
f10cf81e37
util.startup: Disable plugin installer path creation for now (see comments)
6 years ago
Kim Alvefur
829aaea2fd
util.startup: Split plugin installer path setup into a separate function
6 years ago
João Duarte
68f40ef5ff
util.startup: Changed the way util.paths.complement_lua_path was being accessed
6 years ago
João Duarte
9ef4fbdbf8
util.startup: Reorganized code at setup_plugindir
7 years ago
João Duarte
f088ddc713
util.startup: Now calls a function to complement lua's path/cpath
7 years ago
João Duarte
f27cd24e27
util.startup: setup_plugindir now also checks package.cpath for duplicates
7 years ago
João Duarte
d2fc41c9e7
util.startup: Directly calling lfs.currentdir instead of storing it in a local variable
7 years ago
João Duarte
a3f41c2b14
util.startup: Removed/rewrote comments at setup_plugindir
7 years ago
João Duarte
ded9e843e3
util.startupt: setup_plugindir now uses lfs.mkdir to check/create directories
7 years ago
João Duarte
92fafa3343
util.startupt: I'm now using the resolve_relative_path function from util/paths at the setup_plugindir function
7 years ago
João Duarte
ad26c41fa6
util.startup: Improved how .set_plugindir updates prosody.paths.plugins, package.path and package.cpath
7 years ago
João Duarte
093110478e
util.startup: .setup_plugindir now checks if the specified directory for custom plugins exists, and creates it if it doesn't
7 years ago
João Duarte
6307133669
util.startup: The .setup_plugindir function now correctly sets a default/specified path for custom plugins
7 years ago
João Duarte
c20cc1a17b
util.startup: Removed unnecessary if clause at startup.set_plugindir
7 years ago
João Duarte
20f233099e
util.startup: Now it also loads default or configured paths to custom plugin directories and creates them
7 years ago
Kim Alvefur
ce17a974fc
util.startup: Always reload logging after config ( fixes #1284 )
...
This chancged in 6e24a69b03af likely because of confusion about the
`reopen-log-files` event which was fired but never hooked.
7 years ago
Kim Alvefur
57b3a1dc87
util.startup: Remove tostring call from logging
...
Taken care of by loggingmanager now
7 years ago
Matthew Wild
cbaa78ecca
util.startup: Set flag when config fully loaded
7 years ago
Kim Alvefur
62c13b733a
util.startup: Add a comment marking some compat code
8 years ago
Matthew Wild
5e9616894f
util.startup: Don't initialize global protection for prosodyctl, for now
8 years ago
Kim Alvefur
97a34d6199
util.startup: Force console logging before initializing logging (see 2fdeb979cc7c)
8 years ago
Matthew Wild
76a81554ff
util.startup: Initialize logging immediately after configuration is read (which is how it used to work)
8 years ago
Kim Alvefur
e91ebc0e78
util.startup/prosodyctl: Delay enabling global protection until last (silences warning about CFG_PLUGINDIR)
8 years ago
Kim Alvefur
6f810e2837
util.startup: Fix traceback due to both plugin path becoming nil if plugin_paths is unset
8 years ago
Kim Alvefur
3ec060fc0c
Fix spelling throughout the codebase [codespell]
8 years ago
Kim Alvefur
b594f3b843
util.startup: Set up event hooks for reloading logging here instead of in loggingmanager to simplify startup dependencies
8 years ago
Kim Alvefur
eacc7b0dd3
util.startup: Initialize prosody.log / _G.log here instead of in loggingmanager to reduce dependencies
8 years ago