mirror of
https://github.com/processone/ejabberd
synced 2025-10-03 01:39:35 +02:00
Use new configuration validator
This commit is contained in:
parent
d48c067681
commit
a02cff0e78
265 changed files with 12412 additions and 9918 deletions
|
@ -23,7 +23,7 @@
|
|||
path = [] :: [binary()],
|
||||
q = [] :: [{binary() | nokey, binary()}],
|
||||
us = {<<>>, <<>>} :: {binary(), binary()},
|
||||
auth :: {binary(), binary()} | {oauth, binary(), []} | undefined,
|
||||
auth :: {binary(), binary()} | {oauth, binary(), []} | undefined | invalid,
|
||||
lang = <<"">> :: binary(),
|
||||
data = <<"">> :: binary(),
|
||||
ip :: {inet:ip_address(), inet:port_number()},
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
-type local_hint() :: integer() | {apply, atom(), atom()}.
|
||||
|
||||
-record(route, {domain :: binary() | '_',
|
||||
server_host :: binary() | '_',
|
||||
-record(route, {domain :: binary(),
|
||||
server_host :: binary(),
|
||||
pid :: undefined | pid(),
|
||||
local_hint :: local_hint() | undefined | '_'}).
|
||||
local_hint :: local_hint() | undefined}).
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
-type info() :: [{conn, atom()} | {ip, ip()} | {node, atom()}
|
||||
| {oor, boolean()} | {auth_module, atom()}
|
||||
| {num_stanzas_in, non_neg_integer()}
|
||||
| offline].
|
||||
| {atom(), term()}].
|
||||
-type prio() :: undefined | integer().
|
||||
|
||||
-endif.
|
||||
|
|
|
@ -17,19 +17,5 @@
|
|||
%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
%%%
|
||||
%%%----------------------------------------------------------------------
|
||||
|
||||
-define(SQL_MARK, sql__mark_).
|
||||
-define(SQL(SQL), ?SQL_MARK(SQL)).
|
||||
|
||||
-define(SQL_UPSERT_MARK, sql_upsert__mark_).
|
||||
-define(SQL_UPSERT(Host, Table, Fields),
|
||||
ejabberd_sql:sql_query(Host, ?SQL_UPSERT_MARK(Table, Fields))).
|
||||
-define(SQL_UPSERT_T(Table, Fields),
|
||||
ejabberd_sql:sql_query_t(?SQL_UPSERT_MARK(Table, Fields))).
|
||||
|
||||
-define(SQL_INSERT_MARK, sql_insert__mark_).
|
||||
-define(SQL_INSERT(Table, Fields), ?SQL_INSERT_MARK(Table, Fields)).
|
||||
|
||||
-record(sql_query, {hash, format_query, format_res, args, loc}).
|
||||
|
||||
-record(sql_escape, {string, integer, boolean, in_array_string}).
|
||||
-compile([{parse_transform, ejabberd_sql_pt}]).
|
||||
-include("ejabberd_sql.hrl").
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
attributes = [] :: [{binary(), [binary()]}]}).
|
||||
|
||||
-type tlsopts() :: [{encrypt, tls | starttls | none} |
|
||||
{tls_certfile, binary() | undefined} |
|
||||
{tls_cacertfile, binary() | undefined} |
|
||||
{tls_depth, non_neg_integer() | undefined} |
|
||||
{tls_verify, hard | soft | false}].
|
||||
|
@ -61,3 +62,18 @@
|
|||
-type eldap_config() :: #eldap_config{}.
|
||||
-type eldap_search() :: #eldap_search{}.
|
||||
-type eldap_entry() :: #eldap_entry{}.
|
||||
|
||||
-define(eldap_config(M, H),
|
||||
#eldap_config{
|
||||
servers = M:ldap_servers(H),
|
||||
backups = M:ldap_backups(H),
|
||||
tls_options = [{encrypt, M:ldap_encrypt(H)},
|
||||
{tls_verify, M:ldap_tls_verify(H)},
|
||||
{tls_certfile, M:ldap_tls_certfile(H)},
|
||||
{tls_cacertfile, M:ldap_tls_cacertfile(H)},
|
||||
{tls_depth, M:ldap_tls_depth(H)}],
|
||||
port = M:ldap_port(H),
|
||||
dn = M:ldap_rootdn(H),
|
||||
password = M:ldap_password(H),
|
||||
base = M:ldap_base(H),
|
||||
deref_aliases = M:ldap_deref_aliases(H)}).
|
||||
|
|
|
@ -22,19 +22,19 @@
|
|||
-compile([{parse_transform, lager_transform}]).
|
||||
|
||||
-define(DEBUG(Format, Args),
|
||||
lager:debug(Format, Args)).
|
||||
lager:debug(Format, Args), ok).
|
||||
|
||||
-define(INFO_MSG(Format, Args),
|
||||
lager:info(Format, Args)).
|
||||
lager:info(Format, Args), ok).
|
||||
|
||||
-define(WARNING_MSG(Format, Args),
|
||||
lager:warning(Format, Args)).
|
||||
lager:warning(Format, Args), ok).
|
||||
|
||||
-define(ERROR_MSG(Format, Args),
|
||||
lager:error(Format, Args)).
|
||||
lager:error(Format, Args), ok).
|
||||
|
||||
-define(CRITICAL_MSG(Format, Args),
|
||||
lager:critical(Format, Args)).
|
||||
lager:critical(Format, Args), ok).
|
||||
|
||||
%% Use only when trying to troubleshoot test problem with ExUnit
|
||||
-define(EXUNIT_LOG(Format, Args),
|
||||
|
|
|
@ -19,12 +19,12 @@
|
|||
%%%----------------------------------------------------------------------
|
||||
|
||||
-record(archive_msg,
|
||||
{us = {<<"">>, <<"">>} :: {binary(), binary()} | '$2',
|
||||
id = <<>> :: binary() | '_',
|
||||
timestamp = erlang:timestamp() :: erlang:timestamp() | '_' | '$1',
|
||||
peer = {<<"">>, <<"">>, <<"">>} :: ljid() | '_' | '$3' | undefined,
|
||||
bare_peer = {<<"">>, <<"">>, <<"">>} :: ljid() | '_' | '$3',
|
||||
packet = #xmlel{} :: xmlel() | message() | '_',
|
||||
{us = {<<"">>, <<"">>} :: {binary(), binary()},
|
||||
id = <<>> :: binary(),
|
||||
timestamp = erlang:timestamp() :: erlang:timestamp(),
|
||||
peer = {<<"">>, <<"">>, <<"">>} :: ljid() | undefined,
|
||||
bare_peer = {<<"">>, <<"">>, <<"">>} :: ljid(),
|
||||
packet = #xmlel{} :: xmlel() | message(),
|
||||
nick = <<"">> :: binary(),
|
||||
type = chat :: chat | groupchat}).
|
||||
|
||||
|
|
|
@ -24,11 +24,13 @@
|
|||
|
||||
-record(lqueue,
|
||||
{
|
||||
queue :: p1_queue:queue(),
|
||||
max = 0 :: integer()
|
||||
queue = p1_queue:new() :: p1_queue:queue(),
|
||||
max = 0 :: integer()
|
||||
}).
|
||||
|
||||
-type lqueue() :: #lqueue{}.
|
||||
-type lqueue_elem() :: {binary(), message(), boolean(),
|
||||
erlang:timestamp(), non_neg_integer()}.
|
||||
|
||||
-record(config,
|
||||
{
|
||||
|
@ -63,7 +65,7 @@
|
|||
captcha_whitelist = (?SETS):empty() :: gb_sets:set(),
|
||||
mam = false :: boolean(),
|
||||
pubsub = <<"">> :: binary(),
|
||||
lang = ejabberd_config:get_mylang() :: binary()
|
||||
lang = ejabberd_option:language() :: binary()
|
||||
}).
|
||||
|
||||
-type config() :: #config{}.
|
||||
|
@ -89,8 +91,8 @@
|
|||
{
|
||||
message_time = 0 :: integer(),
|
||||
presence_time = 0 :: integer(),
|
||||
message_shaper = none :: shaper:shaper(),
|
||||
presence_shaper = none :: shaper:shaper(),
|
||||
message_shaper = none :: ejabberd_shaper:shaper(),
|
||||
presence_shaper = none :: ejabberd_shaper:shaper(),
|
||||
message :: message() | undefined,
|
||||
presence :: {binary(), presence()} | undefined
|
||||
}).
|
||||
|
@ -110,11 +112,11 @@
|
|||
robots = #{} :: map(),
|
||||
nicks = #{} :: map(),
|
||||
affiliations = #{} :: map(),
|
||||
history :: lqueue(),
|
||||
history = #lqueue{} :: lqueue(),
|
||||
subject = [] :: [text()],
|
||||
subject_author = <<"">> :: binary(),
|
||||
just_created = erlang:system_time(microsecond) :: true | integer(),
|
||||
activity = treap:empty() :: treap:treap(),
|
||||
room_shaper = none :: shaper:shaper(),
|
||||
room_shaper = none :: ejabberd_shaper:shaper(),
|
||||
room_queue :: p1_queue:queue() | undefined
|
||||
}).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue