Commit Graph

40 Commits

Author SHA1 Message Date
Badlop 6e0161470e Update newest copyright year to 2021 (#3464) 2021-01-27 17:02:06 +01:00
Stu Tomlinson bd11a00f8f
Use include_lib() to include headers from dependencies (#3369) 2020-09-03 13:45:57 +02:00
Badlop 2febd1c220 Copy more option explanations from ejabberd Docs site 2020-04-08 18:49:41 +02:00
Badlop 2d32c66fd7 Update copyright to 2020 (#3149) 2020-01-28 15:49:23 +01:00
Evgeny Khramtsov 97da380acd Generate ejabberd.yml.5 man page from source code directly
Several documentation callbacks (doc/0 and mod_doc/0) are implemented
and `ejabberdctl man` command is added to generate a man page. Note
that the command requires a2x to be installed (which is a part of
asciidoc package).
2020-01-08 12:24:51 +03:00
Evgeny Khramtsov 5770946f03 Correctly handle unicode in log messages 2019-09-23 15:17:20 +03:00
Evgeny Khramtsov 2168489ddf Don't retain module option on gen_mod supervisor
When module's options were updated (e.g. by reloading ejabberd.yml)
and, later, the module's process crashed, gen_mod supervisor
restarts the process with outdated options. This is now fixed.
2019-08-04 21:46:18 +03:00
Evgeny Khramtsov 39cf8d86d6 Avoid using broad map() type wherever possible 2019-06-27 15:22:27 +03:00
Evgeny Khramtsov a3e0cbbdd8 Make logging messages more consistent 2019-06-24 20:32:34 +03:00
Evgeny Khramtsov a02cff0e78 Use new configuration validator 2019-06-14 12:33:26 +03:00
Badlop 55417dfb37 Update copyright to 2019 (#2756) 2019-01-08 22:53:27 +01:00
Holger Weiss c5dd1bdd9d mod_http_upload_quota: Fix process name lookup
Fix mod_http_upload_quota's process name lookup for the case where a
slot is requested by a JID whose domain part is not the virtual host the
mod_http_upload_quota process is running on.
2018-07-10 21:19:15 +02:00
Holger Weiss 48c5ab59f1 mod_http_upload*: Remove empty lines after specs
Remove blank lines following function specifications in mod_http_upload
and mod_http_upload_quota for consistency with other modules.
2018-04-16 18:22:54 +02:00
Holger Weiss b2855d63a7 mod_http_upload*: Add function specifications 2018-04-16 18:17:28 +02:00
Evgeniy Khramtsov ba2b650464 Introduce new gen_mod callback: mod_options/1
The callback is supposed to provide known options and their default
values, as long as the documentation. Passing default values into
get_mod functions is now deprecated: all defaults should be provided
by the Mod:mod_options/1 callback.
2018-01-23 10:54:52 +03:00
Evgeniy Khramtsov cdc7c1d1ed Update copyright dates 2018-01-05 23:18:58 +03:00
Evgeniy Khramtsov fddd6110e0 Don't validate an option in gen_mod:get*opt() functions
The changes are very similar to those from previous commit:
* Now there is no need to pass validating function in
  gen_mod:get_opt() and gen_mod:get_module_opt() functions,
  because the modules' configuration keeps already validated values.
* New functions gen_mod:get_opt/2 and gen_mod:get_module_opt/3 are
  introduced.
* Functions gen_mod:get_opt/4 and get_module_opt/5 are deprecated.
  If the functions are still called, the "function" argument is
  simply ignored.
* Validating callback Mod:listen_opt_type/1 is introduced to validate
  listening options at startup.
2017-04-30 19:01:47 +03:00
Evgeniy Khramtsov c1439ddd5b Get rid of jid:to_string/1 and jid:from_string/1 2017-02-26 10:07:12 +03:00
Evgeniy Khramtsov 940ca9311d Fix some dialyzer warnings 2017-02-18 09:36:27 +03:00
Evgeniy Khramtsov f61c933a7a Only use GEN_SERVER macro where appropriate 2017-02-14 15:39:57 +03:00
Evgeniy Khramtsov 28f66ddd7c Attach modules to gen_mod's supervisor 2017-02-14 12:39:26 +03:00
Badlop 5fdd1c39fe Update copyright date automatically (#1442) 2017-01-02 21:42:06 +01:00
Evgeniy Khramtsov 78a44e0176 Merge branch 'master' into xml-ng
Conflicts:
	src/adhoc.erl
	src/cyrsasl_oauth.erl
	src/ejabberd_c2s.erl
	src/ejabberd_config.erl
	src/ejabberd_service.erl
	src/gen_mod.erl
	src/mod_admin_extra.erl
	src/mod_announce.erl
	src/mod_carboncopy.erl
	src/mod_client_state.erl
	src/mod_configure.erl
	src/mod_echo.erl
	src/mod_mam.erl
	src/mod_muc.erl
	src/mod_muc_room.erl
	src/mod_offline.erl
	src/mod_pubsub.erl
	src/mod_stats.erl
	src/node_flat_sql.erl
	src/randoms.erl
2016-11-12 13:27:15 +03:00
Evgeniy Khramtsov 31faa4eb9a Add more type specs 2016-08-12 13:17:42 +03:00
Evgeniy Khramtsov 792e6a7c1c Rewrite mod_http_upload to use XML generator 2016-07-30 17:48:52 +03:00
Holger Weiss 72445bb374 mod_http_upload_quota: Apply cosmetic changes
Use "fun f/1" syntax in place of "fun(X) -> f(X) end".
2016-07-27 00:28:47 +02:00
Holger Weiss 5f48d2641b mod_http_upload_quota: Depend on mod_http_upload
mod_http_upload_quota uses mod_http_upload's "docroot" option, so the
mod_http_upload configuration must be parsed, first.  Fixes #1025.
2016-07-08 20:47:02 +02:00
Evgeniy Khramtsov 4220a2b98c Make modules loading in a dependent order (#1191) 2016-07-06 14:58:48 +03:00
Paweł Chmielowski 3a8da27d86 Use {access,shaper}_rules_validator in other places where access rules are used 2016-06-21 13:18:24 +02:00
Holger Weiss 382c6ce1fb Specify type of second terminate/2 parameter 2016-04-19 09:15:09 +02:00
Holger Weiss 44f581c3b5 mod_http_upload: Also expand @HOST@ in 'docroot'
In some environments, it might be desirable to use separate document
roots for each virtual host.
2016-02-20 20:13:30 +01:00
Holger Weiss 63777f830d Use maps instead of dicts in HTTP upload modules
ejabberd currently depends on Erlang/OTP 17.1 or higher, so we can now
use maps.
2016-01-16 01:30:22 +01:00
Badlop f448ff608a Update copyright to 2016 (#901) 2016-01-13 12:29:14 +01:00
Evgeniy Khramtsov 95265dd3ad Move JID related functions to jid.erl (#847) 2015-11-24 18:44:13 +03:00
Holger Weiss 415a75c25a mod_http_upload_quota: Don't track all users
Don't track the disk usage of accounts that have an unlimited quota.
2015-11-10 22:08:16 +01:00
Holger Weiss 20709f9880 mod_http_upload: Make case indentation consistent
Use four spaces (or the corresponding amount of tab characters) for case
indentation everywhere in mod_http_upload and mod_http_upload_quota.
2015-11-09 19:23:52 +01:00
Holger Weiss fec7e47169 Add copyright and license to HTTP upload modules 2015-11-04 01:22:39 +01:00
Holger Weiss ff46738218 mod_http_upload_quota: Omit info message
The mod_http_upload_quota module attempts to delete a directory whenever
it removes a file from that directory.  However, if thumbnail creation
is enabled, directories will often contain two files.  Therefore, don't
log an info (but only a debug) message if directory removal fails.
2015-11-03 00:00:44 +01:00
Holger Weiss 4566325241 mod_http_upload: Don't complain during shutdown
Ignore the case where, for some reason, no process is found to be
stopped.

Closes #810.
2015-11-02 23:46:58 +01:00
Holger Weiss 5dfd95e5a7 Support user quotas for HTTP File Upload
mod_http_upload_quota implements two features:

- When a "hard quota" is exceeded during a file upload, old files are
  removed until the disk usage equals or falls below the "soft quota".

- Once a day, all uploaded files (and directories) older than a
  configurable number of days are deleted.
2015-10-26 13:10:10 +01:00