Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing part in guide regarding YAML #110

Closed
CyrilPeponnet opened this issue Nov 13, 2013 · 18 comments
Closed

Missing part in guide regarding YAML #110

CyrilPeponnet opened this issue Nov 13, 2013 · 18 comments
Assignees

Comments

@CyrilPeponnet
Copy link

The section

4.2.2 Restrict Execution with AccessCommands

Is not "translated" in yaml.

I have issue trying configuring ejabberd_xmlrpc with acces_commands restriction and this new cfg format.

For example how did you translate :

{listen, [
  {{4560, "127.0.0.1"}, ejabberd_xmlrpc, [
    {access_commands, [
      %% This bot can execute any command:
      {xmlrpc_bot, all, []},
      %% This bot can execute any command,
      %% but if a 'host' argument is provided, it must be "example.org":
      {xmlrpc_bot_all_example, all, [{host, "example.org"}]},
      %% This bot can only execute the command 'dump'. No argument restriction:
      {xmlrpc_bot_backups, [dump], []}
      %% This bot can only execute the command 'register',
      %% and if argument 'host' is provided, it must be "example.org":
      {xmlrpc_bot_reg_example, [register], [{host, "example.org"}]},
      %% This bot can execute the commands 'register' and 'unregister',
      %% if argument host is provided, it must be "test.org":
      {xmlrpc_bot_reg_test, [register, unregister], [{host, "test.org"}]}
    ]}
  ]},
  ...
 ]}.

In yaml ?

@ghost ghost assigned zinid Nov 14, 2013
@zinid
Copy link
Contributor

zinid commented Nov 14, 2013

Yes, the complex configuration for xmlrpc is not supported in YAML yet.

@CyrilPeponnet
Copy link
Author

So I guess AccessCommands neither.

Any workaround or ETA or I have to rollback to stable release ?

Thanks

@zinid
Copy link
Contributor

zinid commented Nov 15, 2013

Does legacy version (Erlang terms) of the config work?

@CyrilPeponnet
Copy link
Author

Sure, I use it with 2.1.x release to give xmlrpc acces only to admin members.

@zinid
Copy link
Contributor

zinid commented Nov 15, 2013

I mean you can still use legacy config file with 13.10. And probably the stuff should work.

@CyrilPeponnet
Copy link
Author

Ah ! you mean I can use erlang term in yml and it will be interpreted ?

or fallback to default cfg file and use only erlang terms.

@zinid
Copy link
Contributor

zinid commented Nov 15, 2013

No :) I mean you run ejabberd with ejabberd.cfg. Don't convert it to YAML.
ejabberd 13.10 understands legacy format just fine.

@CyrilPeponnet
Copy link
Author

Great, I will stuck with this one for the moment. YAML support announcement was cool as it can be understood easily :) But I will wait a bit for advanced usages.

Should I close this one or you prefer keeping it open for the records (and todo list :p)

@zinid
Copy link
Contributor

zinid commented Nov 15, 2013

Let it be open for a while.

@Openmanage101
Copy link

Hi Guys

Any news as to when we can expect YAML support for XMLRPC configs?

@owais-a
Copy link

owais-a commented Mar 19, 2014

Cannot run xmlrpc with 13.12

@badlop
Copy link
Member

badlop commented Mar 25, 2014

Try this and tell me if it works. In /etc/ejabberd/ejabberd.yml put a line like this:

include_config_file: "/etc/ejabberd/xmlrpc.cfg"

Then, in /etc/ejabberd/xmlrpc.cfg you can put whatever you used to have in ejabberd 2, like:

{listen, [
  {{4560, "127.0.0.1"}, ejabberd_xmlrpc, [
    {access_commands, [
      %% This bot can execute any command:
      {xmlrpc_bot, all, []},
      {xmlrpc_bot_reg_test, [register, unregister], [{host, "test.org"}]}
    ]}
  ]}
 ]}.

@owais-a
Copy link

owais-a commented Mar 28, 2014

ejabberd does start with port 4560 listening, but I cannot get it to output the response.. It just echoes back the params to me as is.

I followed the examples in:
http://svn.process-one.net/ejabberd-modules/ejabberd_xmlrpc/trunk/README.txt

Tried with multiple languages, same result.

@owais-a
Copy link

owais-a commented Mar 31, 2014

application: ejabberd
exited: {bad_return,
         {{ejabberd_app,start,[normal,[]]},
          {{'EXIT',
            {undef,
             [{xmlrpc,start_link,
               [{192,168,253,151},
                4560,10,5000,
                {ejabberd_xmlrpc,handler},
                {state,
                 [{xmlrpc_bot,all,[]},
                  {xmlrpc_bot_reg_test,
                   [register,unregister],
                   [{host,"debian-local"}]}],
                 noauth,true}],
               []},
              {supervisor,do_start_child,2,
               [{file,"supervisor.erl"},{line,303}]},
              {supervisor,handle_start_child,2,
               [{file,"supervisor.erl"},{line,674}]},
              {supervisor,handle_call,3,
               [{file,"supervisor.erl"},{line,383}]},
              {gen_server,handle_msg,5,
               [{file,"gen_server.erl"},{line,588}]},
              {proc_lib,init_p_do_apply,3,
               [{file,"proc_lib.erl"},{line,227}]}]}},
           {child,undefined,
            {4560,{192,168,253,151},tcp},
            {ejabberd_listener,start,
             [{4560,{192,168,253,151},tcp},
              ejabberd_xmlrpc,
              [{access_commands,
                [{xmlrpc_bot,all,[]},
                 {xmlrpc_bot_reg_test,
                  [register,unregister],
                  [{host,"debian-local"}]}]}]]},
            transient,brutal_kill,worker,
            [ejabberd_listener]}}}}

@owais-a
Copy link

owais-a commented Apr 4, 2014

And get_presence is not even defined in ejabberd_xmlrpc for 13.12

@badlop
Copy link
Member

badlop commented Apr 22, 2014

The error that says "undef...xmlrpc" means that ejabberd didn't find the xmlrpc erlang library. It should have been automatically downloaded to deps/ subdirectory, compiled and installed. Try:

$ rm -rf deps
$ ./configure
$ make
...
Pulling xmlrpc from {git,"git://github.com/rds13/xmlrpc"}
Cloning into 'xmlrpc'...
...

@badlop badlop closed this as completed May 8, 2014
@weiss
Copy link
Member

weiss commented Aug 20, 2014

I have issue trying configuring ejabberd_xmlrpc with acces_commands restriction and this new cfg format.

FWIW, the following configuration works for me with ejabberd 14.07:

listen:
  -
    module: ejabberd_xmlrpc
    port: 4560
    ip: "127.0.0.1"
    access_commands:
      xmlrpc_access:
        commands: all
        options: {}

access:
  xmlrpc_access:
    # ...

@lock
Copy link

lock bot commented Jun 12, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants