]> granicus.if.org Git - ejabberd/commitdiff
Warn about 'service_url' option during config transformation
authorEvgeny Khramtsov <ekhramtsov@process-one.net>
Fri, 14 Jun 2019 14:38:55 +0000 (17:38 +0300)
committerEvgeny Khramtsov <ekhramtsov@process-one.net>
Fri, 14 Jun 2019 14:38:55 +0000 (17:38 +0300)
src/ejabberd_config_transformer.erl
src/mod_http_upload.erl
src/mod_http_upload_opt.erl

index d76126e7e153e16acb870c8ad55ccf53018a8155..693d86f1d029420d72e5f227e4383e4bc3821a00 100644 (file)
@@ -398,6 +398,15 @@ transform_module(_Host, mod_http_api, Opts, Acc) ->
                      true
              end, Opts),
     {{mod_http_api, Opts1}, Acc};
+transform_module(_Host, mod_http_upload, Opts, Acc) ->
+    Opts1 = lists:filter(
+             fun({service_url, _}) ->
+                     warn_deprecated_option(service_url, external_secret),
+                     true;
+                (_) ->
+                     true
+             end, Opts),
+    {{mod_http_upload, Opts1}, Acc};
 transform_module(_Host, Mod, Opts, Acc) ->
     {{Mod, Opts}, Acc}.
 
index dc02bb11dc583514ffa3b2c623cc8bfad679787c..92185e30fe7078208411f017f95e026a6741d39d 100644 (file)
@@ -174,13 +174,7 @@ mod_opt_type(put_url) ->
 mod_opt_type(get_url) ->
     econf:url();
 mod_opt_type(service_url) ->
-    econf:and_then(
-      econf:url(),
-      fun(URL) ->
-             ?WARNING_MSG("Option 'service_url' is deprecated, consider using "
-                          "the 'external_secret' interface instead", []),
-             URL
-      end);
+    econf:url();
 mod_opt_type(custom_headers) ->
     econf:map(econf:binary(), econf:binary());
 mod_opt_type(rm_on_unregister) ->
@@ -203,8 +197,7 @@ mod_opt_type(host) ->
 mod_opt_type(hosts) ->
     econf:well_known(hosts, ?MODULE).
 
--spec mod_options(binary()) -> [{service_url, binary()} |
-                               {thumbnail, boolean()} |
+-spec mod_options(binary()) -> [{thumbnail, boolean()} |
                                {atom(), any()}].
 mod_options(Host) ->
     [{host, <<"upload.", Host/binary>>},
index a985c229e72042b1e5408512241f77e91a9fd5e1..9c35b3c02ab4968ab38aa818e95f228781fdb17c 100644 (file)
@@ -111,7 +111,7 @@ secret_length(Opts) when is_map(Opts) ->
 secret_length(Host) ->
     gen_mod:get_module_opt(Host, mod_http_upload, secret_length).
 
--spec service_url(gen_mod:opts() | global | binary()) -> binary().
+-spec service_url(gen_mod:opts() | global | binary()) -> 'undefined' | binary().
 service_url(Opts) when is_map(Opts) ->
     gen_mod:get_opt(service_url, Opts);
 service_url(Host) ->