jadahl / mod_restful Goto Github PK
View Code? Open in Web Editor NEWRESTful interface to ejabberd
RESTful interface to ejabberd
see below
POST /api/admin HTTP/1.1 HOST: v3.example.com Content-Type: application/json Content-Length: 71 {"key":"secret","command":"registered_users","args":["v3.example.com"]}
=ERROR REPORT==== 2011-02-23 13:28:06 === ** Generic server 'mod_restful_v3.example.com' terminating ** Last message in was {process, ["admin"], {request,'POST', ["api","admin"], [{nokey, "{\"key\":\"secret\",\"command\":\"registered_users\",\"args\":[\"v3.example.com\"]}"}], undefined,undefined,"en", "{\"key\":\"secret\",\"command\":\"registered_users\",\"args\":[\"v3.example.com\"]}", {{127,0,0,1},49433}, "v3.example.com",80,http, [{'Content-Length',"71"}, {'Content-Type',"application/json"}, {'Host',"v3.example.com"}]}} ** When Server state == {state,undefined, [{["admin"], mod_restful_admin, [{key,"secret"}, {allowed_commands, [register,unregister,registered_users, get_roster]}]}, {["register"], mod_restful_register, [{key,"secret"}]}]} ** Reason for termination == ** {function_clause, [{mod_restful_admin,format_result_json, [["aaa","aaaa","admin","asdf","asdfg","asdfga","fdsa","qqq", "qqqa","qqqq","qqqqq","z1","z2","zaz","zaz1","zaza","zzcc", "zzccc","zzz","zzzz"], {users,{list,{username,string}}}]}, {mod_restful_admin,format_result,3}, {mod_restful_admin,do_process,1}, {mod_restful,handle_call,3}, {gen_server,handle_msg,5}, {proc_lib,init_p_do_apply,3}]}
diff --git a/src/mod_restful_admin.erl b/src/mod_restful_admin.erl index 1b254fa..4d55f42 100644 --- a/src/mod_restful_admin.erl +++ b/src/mod_restful_admin.erl @@ -201,8 +201,10 @@ format_result_json(Code, {_, rescode}) -> Code; format_result_json({Code, Text}, {_, restuple}) -> [{Code, list_to_binary(Text)}]; -format_result_json([Es], {_, {list, ElementsF}}) -> - [format_result_json(E, ElementsF) || E <- Es]; +format_result_json([E], {_, {list, ElementsF}}) -> + [format_result_json(E, ElementsF)]; +format_result_json([E|T], {X, {list, ElementsF}}) -> + [format_result_json(E, ElementsF) | format_result_json(T, {X, {list, ElementsF}}) ]; format_result_json(Tuple, {_, {tuple, ElementsF}}) -> TupleL = tuple_to_list(Tuple), % format a tuple as a list
2016-05-12 23:55:26.648 [error] <0.38.0> CRASH REPORT Process <0.38.0> with 0 neighbours exited with reason: call to undefined function mod_restful:mod_opt_type(db_type) in application_master:init/4 line 134 2016-05-12 23:55:26.649 [info] <0.7.0> Application ejabberd exited with reason: call to undefined function mod_restful:mod_opt_type(db_type)
Hi. could someone provide an example of how to:
I use ejabberd 16.03 on ubuntu 14.04
my mod_restful config:
port: 5289
module: ejabberd_http
request_handlers:
"/api": mod_restful
mod_restful:
api:
-
path: ["admin"]
module: mod_restful_admin
params:
key: "admin"
allowed_commands: [register, unregister]
-
path: ["register"]
module: mod_restful_register
params:
key: "admin"
First I register an account, that's ok.
but when I want to change the password:
http://localhost:5289/api/register/change_password
the log tell me:
[error] <0.18174.0> Processing throwed error undef
trace: [{ejabberd_auth,check_password,[<<"abcdefg">>,<<"localhost">>,<<"123456">>],[]},{mod_restful_register,post_change_password,1,[{file,"src/mod_restful_register.erl"},{line,124}]},{mod_restful,handle_rest_request,5,[{file,"src/mod_restful.erl"},{line,193}]},{mod_restful,process,2,[{file,"src/mod_restful.erl"},{line,161}]},{ejabberd_http,process,5,[{file,"src/ejabberd_http.erl"},{line,363}]},{ejabberd_http,process_request,1,[{file,"src/ejabberd_http.erl"},{line,451}]},{ejabberd_http,process_header,2,[{file,"src/ejabberd_http.erl"},{line,291}]},{ejabberd_http,parse_headers,1,[{file,"src/ejabberd_http.erl"},{line,211}]}]
Documentation needs improvement in some areas, such as:
Hello,
i can ask for registered_users, but when i register a new user, i am always getting 401 Unauthorized. Any idea? Any help is very much apreciated.
Regards
Chris
Unfortunatly, I run into the same as stated here: #11, which is already closed.
I've created a gist with my ejabberd.yml, the console output and the request I make, which results in an 401 Unauthorized error:
https://gist.github.com/dirkmoors/4b60c9573d3d49cbf1cd
My modules section in ejabberd.yml looks like:
modules:
mod_restful:
api:
- path: ["admin"]
module: mod_restful_admin
params:
key: "secret"
allowed_commands: [register, unregister]
- path: ["register"]
module: mod_restful_register
params:
key: "secret"
...
As you can see in the console output, there are no issues loading the module itself.
Obviously, the user I use in the example; "[email protected]" is an existing user.
I've compiled ejabberd Community (13.12) from source on Ubuntu 14.04 LTS, and I've used the master branch of mod_restful. What could be wrong here?
Some REST clients set the Content-Type as "application/json; charset=UTF-8". This results in a bad_match inside mod_restful, which expects "application/json".
Even though charset=UTF-8 is redundant with JSON, it would be nice if mod_restful accepted this formulation anyways.
Hi, i need your help to understand why i get this error:
"<0.575.0> Processing throwed error {badmatch,{error,bad_request}}
trace: [{mod_restful,handle_rest_request,5,[{file,"src/mod_restful.erl"},{line,187}]},{mod_restful,process,2,[{file,"src/mod_restful.erl"},{line,161}]},{ejabberd_http,process,2,[{file,"src/ejabberd_http.erl"},{line,355}]},{ejabberd_http,process_request,1,[{file,"src/ejabberd_http.erl"},{line,461}]},{ejabberd_http,process_header,2,[{file,"src/ejabberd_http.erl"},{line,287}]},{ejabberd_http,receive_headers,1,[{file,"src/ejabberd_http.erl"},{line,181}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]
"
The configuration is:
mod_restful:
api:
- path: ["admin"]
module: mod_restful_admin
params:
allowed_commands: [status]
and i send a post request with command argument and none args.
Thank you in advance for your help.
I had installed mod_restful in ejabberd 16.09 .The api is working fine for user creation,chat room creation etc.But when trying to unregister a user,it is getting the response as 400 Bad Request and getting the following error from the ejabberd log.
2017-03-02 09:07:32.304 [debug] <0.536.0>@ejabberd_http:process_header:286 (#Port<0.24524>) http query: 'POST' <<"/api/admin">>
2017-03-02 09:07:32.304 [debug] <0.536.0>@ejabberd_http:extract_path_query:400 client data: <<"{"key":"secret","command":"unregister","args":["shaju1111112","ec2domain.com","password"]}">>
2017-03-02 09:07:32.305 [debug] <0.536.0>@ejabberd_http:process:358 [<<"api">>,<<"admin">>] matches [<<"api">>]
2017-03-02 09:07:32.305 [error] <0.536.0> Processing throwed error function_clause
trace: [{lists,zip,[[],[<<"nagainfo">>]],[{file,"lists.erl"},{line,386}]},{lists,zip,2,[{file,"lists.erl"},{line,386}]},{lists,zip,2,[{file,"lists.erl"},{line,386}]},{mod_restful_admin,format_args,2,[{file,"src/mod_restful_admin.erl"},{line,163}]},{mod_restful_admin,run_command,3,[{file,"src/mod_restful_admin.erl"},{line,153}]},{mod_restful_admin,do_process,1,[{file,"src/mod_restful_admin.erl"},{line,89}]},{mod_restful,handle_rest_request,5,[{file,"src/mod_restful.erl"},{line,193}]},{mod_restful,process,2,[{file,"src/mod_restful.erl"},{line,161}]}]
Following is the api i used to call
POST /api/admin HTTP/1.1
Host: ec2domain:5285
Content-Type: application/json
Cache-Control: no-cache
{"key":"secret","command":"unregister","args":["shaju1111112","ec2domain","password"]}
Following is the ejabberd.yml configuration
mod_restful:
api:
- path: ["admin"]
module: mod_restful_admin
params:
key: "secret"
allowed_commands: [srg_create, srg_user_add, status, registered_users, register, unregister, add_rosteritem, create_room]
- path: ["register"]
module: mod_restful_register
params:
key: "secret"
allowed_commands: [register, unregister]
in mod_restful:handle_request/3, Host is compared to:
true = lists:member(Host, ejabberd_config:get_global_option(hosts)),
However, shouldn't the hostname be ignored in favor of the Host header?
I can easily see having the xmpp domain foo.com running on a server bar.com. And then trying to access:
POST /api/admin
Host: foo.com
mod_restful is prepared to AJAX Cross Domain POST?
Is it possible to execute a AJAX Cross Domain POST without change the server side (mod_restful)?
Like this: http://en.wikipedia.org/wiki/Cross-origin_resource_sharing
(New at this so I might be doing something wrong)
Installed erlang on my mac (w/ brew), downloaded the ejabberd source from github and put it at the same level of mod_restful.
Under mod_restful dir, I typed "make" to run the Makefile, and got this:
$ make
erlc -pa ./ebin -I ./include -I ../ejabberd/src -pa ../ejabberd/src -o ./ebin src/gen_restful_api.erl
src/gen_restful_api.erl:76: variable 'Host' is unbound
src/gen_restful_api.erl:76: variable 'User' is unbound
src/gen_restful_api.erl:76: record jid undefined
make: *** [ebin/gen_restful_api.beam] Error 1
all paths seem valid.
What am I doing wrong?
Is it possible to just put the .beam file and activate the mod in the .cfg or does it require more?
When implementing the mod_restful api, I noticed that I would require the user's password to remove an ejabberd user-account?
The use case -were I needed mod_restful for in the first place- was to be able to have my user management system (written in Python/Django) create and remove ejabberd user-accounts, to keep them in sync with the Django user accounts.
Since I do not know the user passwords in my backend (and for security reasons, I don't want to know them), I'm not able to supply the password to the "unregister" function. Is there no way around this? I would like to use the mod_restful module as an administrator interface, it won't be exposed to the outside world. Moreover, only "admin" accounts (or when I use the shared key) would be able to call the mod_restful api's)
I'm using ejabberd 15.04 and CentOS
config:
mod_restful:
api:
- path: ["admin"]
module: mod_restful_admin
params:
key: "secret"
allowed_commands: [register, unregister, change_password, get_vcard]
- path: ["register"]
module: mod_restful_register
params:
key: "secret"
POST request:
url:
http://localhost:8088/api/admin
headers:
CSP: active
Origin: chrome-extension://hgmloofddffdnphfgcellkdfbfbjeloo
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36
Content-Type: application/json
Accept: */*
DNT: 1
Accept-Encoding: gzip, deflate
Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4
body:
{"args": ["some_login", "guest.example.ru", "FN"], "command": "get_vcard", "key": "secret"}
error:
[error] <0.795.0> Processing throwed error badarg
trace: [{erlang,list_to_binary,[<<"Test_Name">>],[]},{mod_restful_admin,format_result_json,2,[{file,"src/mod_restful_admin.erl"},{line,188}]},
{mod_restful_admin,format_result,3,[{file,"src/mod_restful_admin.erl"},{line,176}]},
{mod_restful_admin,do_process,1,[{file,"src/mod_restful_admin.erl"},{line,89}]},
{mod_restful,handle_rest_request,5,[{file,"src/mod_restful.erl"},{line,193}]},
{mod_restful,process,2,[{file,"src/mod_restful.erl"},{line,161}]},
{ejabberd_http,process,5,[{file,"src/ejabberd_http.erl"},{line,365}]},
{ejabberd_http,process_request,1,[{file,"src/ejabberd_http.erl"},{line,449}]}]
to reproduce the error:
You've get BadRequest.
I'm test it in chrome extension "Advanced REST client", Python script, and wget (Linux utility) and I always get the same result(error in ejabberd.log).
"Test_Name" In first block it's a vcard "Full Name" - that I changed via pidgin before request.
Other similar requests like "register" "unregister, etc." work's fine, but those commands is a part of mod_admin module. Maybe it's because get_vcard is a part of mod_admin_extra and it's output has a different format?
Hi,
I installed the ejabberd 15.09 via the osx installer and installed the mod_restful module via ejabberdctl module_install.
Warnings on module_install:
src/mod_restful_admin.erl:63: Warning: behaviour gen_restful_api undefined
src/mod_restful_register.erl:32: Warning: behaviour gen_restful_api undefined
Here's my yml:
mod_restful:
api:
- path: ["admin"]
module: mod_restful_admin
params:
key: "secret"
allowed_commands: [register, unregister]
- path: ["register"]
module: mod_restful_register
params:
key: "secret"
Warning on ejabberd start up:
2015-10-05 13:02:30.594 [warning] <0.37.0>@gen_mod:validate_opts:255 module 'mod_restful' doesn't export mod_opt_type/1
Here's the error I got:
2015-10-05 13:24:30.118 [debug] <0.470.0>@ejabberd_http:process_header:283 (#Port<0.4074>) http query: 'GET' <<"/api/register/is_registered?username=admin&host=chat.myhost.com&key=secret">>
2015-10-05 13:24:30.118 [debug] <0.470.0>@ejabberd_http:process:361 [<<"api">>,<<"register">>,<<"is_registered">>] matches [<<"api">>]
2015-10-05 13:24:30.119 [error] <0.470.0> Processing throwed error {badmatch,false}
trace: [{mod_restful,handle_request,3,[{file,"src/mod_restful.erl"},{line,179}]},{mod_restful,process,2,[{file,"src/mod_restful.erl"},{line,161}]},{ejabberd_http,process,5,[{file,"src/ejabberd_http.erl"},{line,371}]},{ejabberd_http,process_request,1,[{file,"src/ejabberd_http.erl"},{line,459}]},{ejabberd_http,process_header,2,[{file,"src/ejabberd_http.erl"},{line,293}]},{ejabberd_http,parse_headers,1,[{file,"src/ejabberd_http.erl"},{line,209}]},{ejabberd_http,init,2,[{file,"src/ejabberd_http.erl"},{line,163}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,237}]}]
I'm pretty new at ejabberd, so any help is appreciated.
hi
i am working on ejabberd_16.01 and i'm facing problems using mod_restful.
ejabberd.yml:
listen:
-
port: 8088
ip: "::"
module: ejabberd_http
request_handlers:
"/api": mod_restful
modules:
mod_restful:
api:
-
path: ["admin"]
module: mod_restful_admin
params:
key: "secret" ## if you want to use basic auth, you need to remove this line
allowed_commands: [srg_create, srg_user_add, status, registered_users]
I added the module:
> sudo /opt/ejabberd-16.01/bin/ejabberdctl module_install mod_restful
src/mod_restful_admin.erl:63: Warning: behaviour en_restful_api undefined
src/mod_restful_register.erl:32: Warning: behaviour en_restful_api undefined
ok
when I call :
POST /api/admin HTTP/1.1
Host: 173.39.250.116:8088
Content-Type: application/json
Cache-Control: no-cache
{"key":"secret", "command":"status", "args":[]}
I get :
<?xml version='1.0'?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
</head>
<body>
<h1>401 Unauthorized</h1>
</body>
</html>
any idea what am I missing?
Thanks
Itay
Hey there,
I've been trying to compile this under windows for the whole day already, and I don't have much of a clue of what's wrong.
This is what I've been doing so far:
I extracted both in to the same directory (they needed to be at the same level, right?)
but I keep getting errors like:
erlc: Error executing 'erl.exe': 2erlc -pa ./ebin -I ./include -o ./ebin src/mod_restful.erl
erlc: Error executing 'erl.exe': 2erlc -pa ./ebin -I ./include -o ./ebin src/mod_restful_admin.erl
erlc: Error executing 'erl.exe': 2erlc -pa ./ebin -I ./include -o ./ebin src/mod_restful_register.erl
erlc: Error executing 'erl.exe': 2erlc -pa ./ebin -I ./include -o ./ebin src/mod_restful_mochinum.erl
erlc: Error executing 'erl.exe': 2erlc -pa ./ebin -I ./include -o ./ebin src/mod_restful_mochijson2.erl
it does not say what's wrong... whether is my environment or the make file, or anything else.
Or Is there a precompiled .beam file that I can just download from some place?
I don't see a LICENSE file in this code, and I don't see the license mentioned in the README. What license is this code covered under? Can you add documentation on the license to the repository?
thank you ~
ejabberd 13.10 improves performance and memory usage compared to ejabberd 2.1.x. It also introduces a bunch of incompatibilities (large part due to using binary type instead of string), so in order to use mod_restful (and mod_private_email) with ejabberd 13.10, it needs to be ported.
If so, a note in the documentation about how to enable that would be useful.
acl:
admin:
user:
- "admin": "192.168.11.78"
Unable to start ejabberd with admin user enabled.....
when I comment the last three lines, it starts fine... this is ejabberd v13.12
Implement support for ejabberd_hooks in mod_restful to enable external modules to add RESTful interfaces to them.
I've installed ejabberd 2.1.11.
To build module, I used ejabberd 2.1.11 source code and 0.1.x branch.
And I've done all settings as same as in ReadMe.
But when I send request to mod_restful_register, I got 401 error.
The followings are my configuration.
{{8088,{0,0,0,0}}, ejabberd_http, [
{request_handlers,
[
{["api"], mod_restful}
]}
]}
{mod_restful, [
{api,
[
{["admin"], mod_restful_admin, [
{key, "secret"},
{allowed_commands, [register, unregister]}
]},
{["register"], mod_restful_register, [{key, "secret"}]}
]}
And here is the post request I sent.
URL: http://messaging.goldenspear.com:8088/api/register/register
params: {
"key": "secret",
"username": "newuser",
"host": "localhost",
"password": "newuser"
}
But it returns 401 Unauthorized error.
Also Get request is_registered returns 401 error.
Please let me know what I've done wrong.
Hooks can be used to add extra functionality to mod_restful_register.
Hooks can be used when:
Hi,
Sorry for this simple question but I haven´t got much experience in linux. I installed in CentOS ejabberd using this tutoria https://www.digitalocean.com/community/articles/how-to-install-ejabberd-on-a-centos-5-and-centos-6-vps that says basically execute sudo yum install ejabberd
But I can´t get to add this module. Where should I put it to compile and which version should I use?
thx
Hi,
No matter what I do, I keep getting the 401 unauthorize error. I did review an earlier reported issue on the same subject and has tried all the tips there.
Following is the issue I can find from the log file.
[error] <0.2921.0> Processing throwed error {badmatch,false}
trace: [{mod_restful,handle_request,3,[{file,"src/mod_restful.erl"},{line,179}]},{mod_restful,process,2,[{file,"src/mod_restful.erl"},{line,161}]},{ejabberd_http,process,2,[{file,"src/ejabberd_http.erl"},{line,356}]},{ejabberd_http,process_request,1,[{file,"src/ejabberd_http.erl"},{line,405}]},{ejabberd_http,process_header,2,[{file,"src/ejabberd_http.erl"},{line,288}]},{ejabberd_http,receive_headers,1,[{file,"src/ejabberd_http.erl"},{line,182}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]
Please need some urgent help.
Hi,
I am unable to install mod_restful on ejabberd 17.04. It shows following stack trace while installing plugin:
opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:48: can't find include file "include/mod_restful.hrl"
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:63: record rest_req undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:64: record rest_req undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:65: variable 'Options' is unbound
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:70: record rest_req undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:73: variable 'HTTPRequest' is unbound
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:73: record request undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:79: variable 'ReqHost' is unbound
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:101: record rest_req undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:102: record rest_req undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:108: variable 'Q' is unbound
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:109: variable 'GlobalOpts' is unbound
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:109: variable 'Opts' is unbound
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:110: record rest_req undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:115: variable 'Format' is unbound
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:120: variable 'GlobalOpts' is unbound
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:120: variable 'Opts' is unbound
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:123: record rest_req undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:129: variable 'Struct' is unbound
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:141: record rest_req undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:144: variable 'Q' is unbound
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:158: record rest_req undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:159: variable 'Data' is unbound
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:189: record rest_req undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful.erl:30: Warning: undefined callback function depends/2 (behaviour 'gen_mod')
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful.erl:30: Warning: undefined callback function mod_opt_type/1 (behaviour 'gen_mod')
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_admin.erl:67: can't find include file "include/mod_restful.hrl"
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_admin.erl:69: record rest_req undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_admin.erl:70: variable 'Path' is unbound
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_admin.erl:104: record rest_req undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_admin.erl:105: variable 'Data' is unbound
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_admin.erl:127: record rest_req undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_admin.erl:128: variable 'Options' is unbound
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_admin.erl:175: record rest_req undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_admin.erl:176: record rest_resp undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_admin.erl:177: record rest_req undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_admin.erl:63: Warning: behaviour gen_restful_api undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_admin.erl:175: Warning: variable 'Res' is unused
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_admin.erl:175: Warning: variable 'ResF' is unused
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_admin.erl:181: Warning: function format_result_json/2 is unused
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_register.erl:36: can't find include file "include/mod_restful.hrl"
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_register.erl:46: record rest_req undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_register.erl:47: variable 'Path' is unbound
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_register.erl:59: record rest_req undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_register.erl:60: variable 'Path' is unbound
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_register.erl:32: Warning: behaviour gen_restful_api undefined
Error: {compilation_failed,"/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl"}
If i look into the directory the hrl file was there but its not in src its in include directory that is outside src directory with proper ejabberd user and group permissions.
Can you tell me what's wrong here?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.