Compare commits

...

10 Commits

Author SHA1 Message Date
Mark Zealey bad55d8b16
Merge 5eace7823d into 0fdf58b1ec 2024-04-17 19:25:31 +05:30
Paweł Chmielowski 0fdf58b1ec Add ability to use additional custom errors when parsing options 2024-04-17 14:01:21 +02:00
Badlop 051bf2968a Runtime: Test 27.0-rc1 instead of 27, as port_compiler still fails in rc2 2024-04-12 17:56:02 +02:00
Badlop 4fd83631ec Mention in what ejabberd version was added update_sql_schema option 2024-04-12 16:41:25 +02:00
Badlop a29d54c497 Comment ERTS_VSN variable in ejabberdctl when not used (#4194)
That variable is not used in "make relive" and "make install",
so let's comment the variable in ejabberdctl when preparing
that file for those targets.
2024-04-12 16:41:21 +02:00
Badlop ed6762b8ee Don't name integer and string results in API examples (#4198)
Since ejabberd 24.02, mod_http_api does not name any results,
previously integer and strings were named, but other results were not.
And ejabberdctl obviously does not name results either.
Only ejabberd_xmlrpc does.
Consequently, the documentation should not name results in the examples.
2024-04-12 12:08:03 +02:00
Badlop b6a0c7e57f mod_configure: Retract 'Get User Password' command to update XEP-0133 1.3.0
https://github.com/xsf/xeps/pull/1314
2024-04-12 12:07:50 +02:00
Badlop ba0be28d45 CONTAINER.md: live in podman doesn't strictly require EJABBERD_BYPASS_WARNINGS 2024-04-12 12:07:46 +02:00
Badlop ef5a435480 sql_server option: Mention in what version it was last updated 2024-04-12 12:07:40 +02:00
Mark Zealey 5eace7823d Convert indexes to primary keys 2023-11-04 10:05:26 +00:00
8 changed files with 30 additions and 60 deletions

View File

@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
otp: ['20', '25', '26', '27']
otp: ['20', '25', '26', '27.0-rc1']
rebar: ['rebar', 'rebar3']
runs-on: ubuntu-22.04
container:

View File

@ -299,7 +299,7 @@ docker buildx build \
It's also possible to use podman instead of docker, just notice:
- `EXPOSE 4369-4399` port range is not supported, remove that in Dockerfile
- It mentions that `healthcheck` is not supported by the Open Container Initiative image format
- If you want to start with command `live`, add environment variable `EJABBERD_BYPASS_WARNINGS=true`
- to start with command `live`, you may want to add environment variable `EJABBERD_BYPASS_WARNINGS=true`
```bash
podman build \
-t ejabberd \
@ -313,6 +313,8 @@ podman exec eja1 ejabberdctl status
podman exec -it eja1 sh
podman stop eja1
podman run --name eja1 -it -e EJABBERD_BYPASS_WARNINGS=true -p 5222:5222 localhost/ejabberd live
```
### Package build for `arm64`

View File

@ -396,6 +396,7 @@ ejabberdctl.relive:
-e "s*{{spool_dir}}*${SPOOL_DIR}*g" \
-e "s*{{bindir}}*${BINDIR}*g" \
-e "s*{{libdir}}*${relivelibdir}${ELIXIR_LIBDIR}*g" \
-e "s*ERTS_VSN*# ERTS_VSN*g" \
-e "s*{{iexpath}}*${IEX}*g" \
-e "s*{{erl}}*${ERL}*g" \
-e "s*{{epmd}}*${EPMD}*g" ejabberdctl.template \
@ -420,6 +421,7 @@ ejabberdctl.example: vars.config
-e "s*{{spool_dir}}*${SPOOLDIR}*g" \
-e "s*{{bindir}}*${BINDIR}*g" \
-e "s*{{libdir}}*${LIBDIR}${ELIXIR_LIBDIR}*g" \
-e "s*ERTS_VSN*# ERTS_VSN*g" \
-e "s*{{iexpath}}*${IEX}*g" \
-e "s*{{erl}}*${ERL}*g" \
-e "s*{{epmd}}*${EPMD}*g" ejabberdctl.template \

View File

@ -57,11 +57,10 @@ CREATE INDEX i_rosteru_jid ON rosterusers USING btree (jid);
CREATE TABLE rostergroups (
username text NOT NULL,
jid text NOT NULL,
grp text NOT NULL
grp text NOT NULL,
PRIMARY KEY (username, jid, grp)
);
CREATE INDEX pk_rosterg_user_jid ON rostergroups USING btree (username, jid);
CREATE TABLE sr_group (
name text NOT NULL,
opts text NOT NULL,
@ -82,7 +81,7 @@ CREATE INDEX i_sr_user_grp ON sr_user USING btree (grp);
CREATE TABLE spool (
username text NOT NULL,
xml text NOT NULL,
seq BIGSERIAL,
seq BIGSERIAL PRIMARY KEY,
created_at TIMESTAMP NOT NULL DEFAULT now()
);
@ -95,7 +94,7 @@ CREATE TABLE archive (
bare_peer text NOT NULL,
xml text NOT NULL,
txt text,
id BIGSERIAL,
id BIGSERIAL PRIMARY KEY,
kind text,
nick text,
origin_id text,
@ -181,6 +180,7 @@ CREATE TABLE privacy_list (
CREATE UNIQUE INDEX i_privacy_list_username_name ON privacy_list USING btree (username, name);
CREATE TABLE privacy_list_data (
seq BIGSERIAL PRIMARY KEY,
id bigint REFERENCES privacy_list(id) ON DELETE CASCADE,
t character(1) NOT NULL,
value text NOT NULL,
@ -235,15 +235,14 @@ CREATE UNIQUE INDEX i_pubsub_node_tuple ON pubsub_node USING btree (host, node);
CREATE TABLE pubsub_node_option (
nodeid bigint REFERENCES pubsub_node(nodeid) ON DELETE CASCADE,
name text NOT NULL,
val text NOT NULL
val text NOT NULL,
PRIMARY KEY (nodeid, name)
);
CREATE INDEX i_pubsub_node_option_nodeid ON pubsub_node_option USING btree (nodeid);
CREATE TABLE pubsub_node_owner (
nodeid bigint REFERENCES pubsub_node(nodeid) ON DELETE CASCADE,
nodeid bigint PRIMARY KEY REFERENCES pubsub_node(nodeid) ON DELETE CASCADE,
owner text NOT NULL
);
CREATE INDEX i_pubsub_node_owner_nodeid ON pubsub_node_owner USING btree (nodeid);
CREATE TABLE pubsub_state (
nodeid bigint REFERENCES pubsub_node(nodeid) ON DELETE CASCADE,
@ -336,11 +335,10 @@ CREATE TABLE caps_features (
node text NOT NULL,
subnode text NOT NULL,
feature text,
created_at TIMESTAMP NOT NULL DEFAULT now()
created_at TIMESTAMP NOT NULL DEFAULT now(),
PRIMARY KEY (node, subnode, feature)
);
CREATE INDEX i_caps_features_node_subnode ON caps_features USING btree (node, subnode);
CREATE TABLE sm (
usec bigint NOT NULL,
pid text NOT NULL,

View File

@ -197,6 +197,11 @@ format_error(eimp_error) ->
format("ejabberd is built without image converter support", []);
format_error({mqtt_codec, Reason}) ->
mqtt_codec:format_error(Reason);
format_error({external_module_error, Module, Error}) ->
try Module:format_error(Error)
catch _:_ ->
format("Invalid value", [])
end;
format_error(Reason) ->
yconf:format_error(Reason).

View File

@ -247,13 +247,8 @@ json_call(Name, ArgsDesc, Values, ResultDesc, Result, HTMLOutput) ->
{200, [?STR(Text1)]};
{{_, restuple}, {_, Text2}} ->
{500, [?STR(Text2)]};
{{_, {list, _}}, _} ->
{200, json_gen(ResultDesc, Result, Indent, HTMLOutput)};
{{_, {tuple, _}}, _} ->
{200, json_gen(ResultDesc, Result, Indent, HTMLOutput)};
{{Name0, _}, _} ->
{200, [Indent, ?OP_L("{"), ?STR_A(Name0), ?OP_L(": "),
json_gen(ResultDesc, Result, Indent, HTMLOutput), ?OP_L("}")]}
{{_, _}, _} ->
{200, json_gen(ResultDesc, Result, Indent, HTMLOutput)}
end,
CodeStr = case Code of
200 -> <<" 200 OK">>;

View File

@ -924,6 +924,7 @@ doc() ->
[binary:part(ejabberd_config:version(), {0,5})]}}},
{update_sql_schema,
#{value => "true | false",
note => "added in 23.10",
desc =>
?T("Allow ejabberd to update SQL schema. "
"The default value is 'true'.")}},
@ -1379,6 +1380,7 @@ doc() ->
"or 'ram' if the latter is not set.")}},
{sql_server,
#{value => ?T("Host"),
note => "improved in 23.04",
desc =>
?T("The hostname or IP address of the SQL server. For _`sql_type`_ "
"'mssql' or 'odbc' this can also be an ODBC connection string. "

View File

@ -27,7 +27,7 @@
-author('alexey@process-one.net').
-protocol({xep, 133, '1.1'}).
-protocol({xep, 133, '1.3.0', '13.10', "complete", ""}).
-behaviour(gen_mod).
@ -133,8 +133,6 @@ get_local_identity(Acc, _From, _To, Node, Lang) ->
?INFO_COMMAND(?T("Delete User"), Lang);
?NS_ADMINL(<<"end-user-session">>) ->
?INFO_COMMAND(?T("End User Session"), Lang);
?NS_ADMINL(<<"get-user-password">>) ->
?INFO_COMMAND(?T("Get User Password"), Lang);
?NS_ADMINL(<<"change-user-password">>) ->
?INFO_COMMAND(?T("Change User Password"), Lang);
?NS_ADMINL(<<"get-user-lastlogin">>) ->
@ -219,8 +217,6 @@ get_local_features(Acc, From,
?INFO_RESULT(Allow, [?NS_COMMANDS], Lang);
?NS_ADMINL(<<"end-user-session">>) ->
?INFO_RESULT(Allow, [?NS_COMMANDS], Lang);
?NS_ADMINL(<<"get-user-password">>) ->
?INFO_RESULT(Allow, [?NS_COMMANDS], Lang);
?NS_ADMINL(<<"change-user-password">>) ->
?INFO_RESULT(Allow, [?NS_COMMANDS], Lang);
?NS_ADMINL(<<"get-user-lastlogin">>) ->
@ -447,8 +443,6 @@ get_local_items(Acc, From, #jid{lserver = LServer} = To,
?ITEMS_RESULT(Allow, LNode, {error, Err});
?NS_ADMINL(<<"end-user-session">>) ->
?ITEMS_RESULT(Allow, LNode, {error, Err});
?NS_ADMINL(<<"get-user-password">>) ->
?ITEMS_RESULT(Allow, LNode, {error, Err});
?NS_ADMINL(<<"change-user-password">>) ->
?ITEMS_RESULT(Allow, LNode, {error, Err});
?NS_ADMINL(<<"get-user-lastlogin">>) ->
@ -490,8 +484,6 @@ get_local_items(_Host, [<<"user">>], Server, Lang) ->
(?NS_ADMINX(<<"delete-user">>))),
?NODE(?T("End User Session"),
(?NS_ADMINX(<<"end-user-session">>))),
?NODE(?T("Get User Password"),
(?NS_ADMINX(<<"get-user-password">>))),
?NODE(?T("Change User Password"),
(?NS_ADMINX(<<"change-user-password">>))),
?NODE(?T("Get User Last Login Time"),
@ -1009,16 +1001,6 @@ get_form(_Host, ?NS_ADMINL(<<"end-user-session">>),
label = tr(Lang, ?T("Jabber ID")),
required = true,
var = <<"accountjid">>}]}};
get_form(_Host, ?NS_ADMINL(<<"get-user-password">>),
Lang) ->
{result,
#xdata{title = tr(Lang, ?T("Get User Password")),
type = form,
fields = [?HFIELD(),
#xdata_field{type = 'jid-single',
label = tr(Lang, ?T("Jabber ID")),
var = <<"accountjid">>,
required = true}]}};
get_form(_Host, ?NS_ADMINL(<<"change-user-password">>),
Lang) ->
{result,
@ -1324,23 +1306,6 @@ set_form(From, Host, ?NS_ADMINL(<<"end-user-session">>),
ejabberd_sm:kick_user(JID#jid.luser, JID#jid.lserver, R)
end,
{result, undefined};
set_form(From, Host,
?NS_ADMINL(<<"get-user-password">>), Lang, XData) ->
AccountString = get_value(<<"accountjid">>, XData),
JID = jid:decode(AccountString),
User = JID#jid.luser,
Server = JID#jid.lserver,
true = Server == Host orelse
get_permission_level(From) == global,
Password = ejabberd_auth:get_password(User, Server),
true = is_binary(Password),
{result,
#xdata{type = form,
fields = [?HFIELD(),
?XFIELD('jid-single', ?T("Jabber ID"),
<<"accountjid">>, AccountString),
?XFIELD('text-single', ?T("Password"),
<<"password">>, Password)]}};
set_form(From, Host,
?NS_ADMINL(<<"change-user-password">>), _Lang, XData) ->
AccountString = get_value(<<"accountjid">>, XData),
@ -1570,6 +1535,7 @@ mod_options(_) -> [].
mod_doc() ->
#{desc =>
?T("The module provides server configuration functionality via "
"https://xmpp.org/extensions/xep-0050.html"
"[XEP-0050: Ad-Hoc Commands]. This module requires "
"_`mod_adhoc`_ to be loaded.")}.
"https://xmpp.org/extensions/xep-0050.html[XEP-0050: Ad-Hoc Commands]. "
"Implements many commands as defined in "
"https://xmpp.org/extensions/xep-0133.html[XEP-0133: Service Administration]. "
"This module requires _`mod_adhoc`_ to be loaded.")}.