Skip to content

Commit

Permalink
Don't use host from url in webadmin, prefer host used for authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
prefiks committed Jul 3, 2024
1 parent 35042eb commit 54f5db8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ejabberd_web_admin.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1691,7 +1691,7 @@ make_command2(Name, Request, BaseArguments, Options) ->
CallerInfo =
#{usr => {RUser, RServer, <<"">>},
ip => RIp,
caller_host => RHost,
caller_host => RServer,
caller_module => ?MODULE},
try {ejabberd_commands:get_command_definition(Name),
ejabberd_access_permissions:can_access(Name, CallerInfo)}
Expand Down

7 comments on commit 54f5db8

@Thomas301263
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,
I have updated ejabberd to 24.06 and the same happens here. Before the update all was working fine.
I found that file in : /opt/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_webadmin_config/src# vi mod_webadmin_config.erl but there isn't what is shown on line 1694 here. I do not find RHost or RServer or else or any other file where I am able to change the caller_host from RHost to RServer.
The ejabberd server is running on Ubuntu 22.04.
What can be done to solve that problem?
Thanks
Thomas

@prefiks
Copy link
Member Author

@prefiks prefiks commented on 54f5db8 Jul 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,
This file lives in ejabberd repository, not ejabberd-contrib, so you can't change it that way, you need to rebuild ejabberd proper or install ejabberd package that was build after that commit. You can try grabbing ejabberd-packages at the bottom of https://github.com/processone/ejabberd/actions/runs/9813439100, it should contains installers that were build on github ci.

@Thomas301263
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,

I got now the file "ejabberd_24.06.19-1_amd64.deb" from https://github.com/processone/ejabberd/actions/runs/9813439100
I installed it using "dpkg -i ejabberd_24.06.19-1_amd64.deb"

The result is the same the webinterface is empty.

So what can I do next? All the applications are running on a virtual machine. Should I go back to an older snapshot?
That problem with an empty webinterface comes up after "apt upgrade"
There was the new package of ejabberd.

@prefiks
Copy link
Member Author

@prefiks prefiks commented on 54f5db8 Jul 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may also want to tweak ejabberd.yml config file, see #4249 at bottom are rules that need to be added.

@Thomas301263
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not working and that modification I have done a long time before.
It looks different but it is working with it
My ejabberd configuration file is attached. IP and domains are changed.

ejabberd.txt

@prefiks
Copy link
Member Author

@prefiks prefiks commented on 54f5db8 Jul 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see this section:

api_permissions:
  "webadmin":
    from:
      - ejabberd_web_admin
    who:
      access:
        allow:
          - acl: admin
    what:
      - "*"

in your config file, could you try adding it? Also please use #4249 for further questions, it will be easier to track that.

@Thomas301263
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh shit that I haven't really seen at all.
Now it works thanks a lot.
Sorry for circumstances

Please sign in to comment.